lostplaces-backend/source/lostplaces/lostplaces_app/views.py

23 lines
693 B
Python
Raw Normal View History

2020-07-26 22:19:37 +02:00
from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic.edit import CreateView
from .forms import ExplorerCreationForm
2020-07-26 22:19:37 +02:00
from .models import Place
# Create your views here.
class SignUpView(CreateView):
form_class = ExplorerCreationForm
success_url = reverse_lazy('login')
template_name = 'signup.html'
2020-07-26 23:25:07 +02:00
def place_list_view(request,):
2020-07-26 23:34:03 +02:00
return render(request, 'placeList.html', {'place_list':Place.objects.all()})
2020-07-26 23:25:07 +02:00
2020-07-26 22:19:37 +02:00
def place_detail_view(request, pk):
2020-07-26 23:25:07 +02:00
return render(request, 'placeOverview.html', {'place':Place.objects.get(pk=pk)})
2020-07-26 22:19:37 +02:00
def hello_world(request):
return render(request, 'hello_world.html', {'text':'Hello World!'})