Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.shortcuts import render
- from django.http import HttpResponse
- from django.http import HttpResponseRedirect
- from django.shortcuts import redirect
- from .models import Trailer
- from .forms import NameForm
- def index(request):
- return render(request, 'polls/index.html')
- def trailers(request):
- return render(request, 'polls/trailers.html')
- def about(request):
- return render(request, 'polls/about.html')
- def login(request):
- return render(request, 'polls/login.html')
- def registration(request):
- return render(request, 'polls/registration.html')
- def test(request):
- return render(request, 'polls/test.html')
- def get_name(request):
- # if this is a POST request we need to process the form data
- if request.method == 'POST':
- # create a form instance and populate it with data from the request:
- form = NameForm(request.POST)
- # check whether it's valid:
- if form.is_valid():
- username = form.cleaned_data['user_user']
- email_user = form.cleaned_data['user_email']
- pass_user = form.cleaned_data['user_pass']
- sender = form.cleaned_data['user_submit']
- return HttpResponseRedirect('test.html')
- else:
- form = NameForm()
- return render(request, 'test.html', {'form': form})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement