6
0
Эх сурвалжийг харах

Added transition to authorization page

1Mike21 1 жил өмнө
parent
commit
cfdaf68ac6

+ 7 - 4
templates/webservice_running/registration.html

@@ -5,8 +5,8 @@
 <div class="text-center" style="margin-top: 150px;">
     <div class="form-signin" style="width: 100%; max-width:330px; margin: auto; display:block;">
         <form class="m-2 p-2" method="post">
-            <img class="mb-4" src="{% static 'SharixAdmin/img/logo.svg' %}" alt="" width="72" >
-            <h1 class="h3 mb-3 fw-normal">Sign up</h1>
+            <img class="mb-4" src="{% static 'SharixAdmin/img/logo.png' %}" alt="" width="72" >
+            <h1 class="h3 mb-3 fw-normal">Регистрация</h1>
             {% csrf_token %}
             
             {% for item in form %}
@@ -25,8 +25,11 @@
                     Please, enter the correct phone number and password.
                 </div>
             {% endif %}
-            <button class="w-100 btn btn-primary btn-lg" type="submit">Sign up</button>
-            <p class="mt-5 mb-3 text-muted">© 2022</p>
+            <div>
+              <a class="w-100 btn btn-primary btn-lg mb-3" href="{% url 'authweb' %}">Авторизация</a>
+              <button class="w-100 btn btn-primary btn-lg" type="submit">Зарегистрироваться</button>
+            </div>
+              <p class="mt-5 mb-3 text-muted">© 2022</p>
           </form>
     </div>
 </div>

+ 3 - 1
views.py

@@ -1,3 +1,4 @@
+from django.urls import reverse_lazy
 import requests
 from django.http import HttpResponse
 from webservice_running.apps import api
@@ -20,7 +21,8 @@ def registration(request):
     if request.method == 'POST':
       form = RegisterUserForm(request.POST)
       if form.is_valid():
-        return redirect('accounts/login/')
+        form.save()
+        return redirect('authweb')
     else:
        form = RegisterUserForm()
     return render(request, 'webservice_running/registration.html', {'form': form})