2020-07-26 22:19:37 +02:00
|
|
|
from django.shortcuts import render
|
2020-07-29 00:15:12 +02:00
|
|
|
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.
|
|
|
|
|
2020-07-29 00:15:12 +02:00
|
|
|
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!'})
|