Initial commit
This commit is contained in:
21
account/views.py
Normal file
21
account/views.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.shortcuts import render
|
||||
from django.http import HttpResponse
|
||||
from .forms import SiteUserForm
|
||||
|
||||
|
||||
def index(request):
|
||||
if request.method == 'POST':
|
||||
form = SiteUserForm(request.POST)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return HttpResponse("User was created successfully.")
|
||||
else:
|
||||
return HttpResponse("There was an error.")
|
||||
else:
|
||||
form = SiteUserForm()
|
||||
|
||||
return render(request, 'account.html', {'form': form})
|
||||
|
||||
|
||||
# def index(request):
|
||||
# return render(request, 'account.html')
|
||||
Reference in New Issue
Block a user