0.0.17
login routines
This commit is contained in:
@@ -13,6 +13,18 @@ from django.template.loader import render_to_string
|
||||
from django.urls import reverse
|
||||
|
||||
|
||||
def my_routes_ajax(request):
|
||||
if request.method != 'POST':
|
||||
raise Http404
|
||||
|
||||
from RoutesApp.forms import RegistrationForm
|
||||
Dict = {
|
||||
'form': RegistrationForm()
|
||||
}
|
||||
|
||||
html = render_to_string('blocks/profile/b_new_route.html', Dict, request=request)
|
||||
return JsonResponse({'html': html}, status=200)
|
||||
|
||||
|
||||
def new_route_view_ajax(request):
|
||||
if request.method != 'POST':
|
||||
@@ -39,7 +51,7 @@ def login_ajax(request):
|
||||
form = LoginForm(data)
|
||||
if not form.is_valid():
|
||||
Dict = {'form': form}
|
||||
html = render_to_string('forms/f_registration.html', Dict, request=request)
|
||||
html = render_to_string('forms/f_login.html.html', Dict, request=request)
|
||||
return JsonResponse({'html': html}, status=400)
|
||||
|
||||
from django.contrib.auth import authenticate
|
||||
|
||||
Reference in New Issue
Block a user