Created very basic initial login / logout functionality. Absolutely rudimentary templates included.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
from django.urls import path
|
||||
from .views import hello_world, place_detail_view, place_list_view
|
||||
from .views import hello_world, place_detail_view, place_list_view, SignUpView
|
||||
|
||||
urlpatterns = [
|
||||
path('hello_world/', hello_world),
|
||||
path('hello_world/', hello_world), # You know what this is :P
|
||||
path('signup/', SignUpView.as_view(), name='signup'),
|
||||
path('place/<int:pk>/', place_detail_view, name='place_detail'),
|
||||
path('places/', place_list_view)
|
||||
]
|
@@ -1,8 +1,17 @@
|
||||
from django.shortcuts import render
|
||||
from django.urls import reverse_lazy
|
||||
from django.views.generic.edit import CreateView
|
||||
|
||||
from .forms import ExplorerCreationForm
|
||||
from .models import Place
|
||||
|
||||
# Create your views here.
|
||||
|
||||
class SignUpView(CreateView):
|
||||
form_class = ExplorerCreationForm
|
||||
success_url = reverse_lazy('login')
|
||||
template_name = 'signup.html'
|
||||
|
||||
def place_list_view(request,):
|
||||
return render(request, 'placeList.html', {'place_list':Place.objects.all()})
|
||||
|
||||
|
Reference in New Issue
Block a user