Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added: Signup view with respective url, Signup and success page. #10

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Main/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.urls import path

from .views import index_view, login_view, signUp_view

urlpatterns = [
Expand Down
4 changes: 4 additions & 0 deletions Main/views.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from django.contrib.auth import authenticate, login
from django.shortcuts import render
from django.http import HttpResponse
from django.contrib.auth import login, authenticate
from django.contrib.auth.forms import UserCreationForm

# Create your views here.

def index_view(request):
if request.method == 'GET':

return render(request, 'Index.html')
return HttpResponse(405)

Expand All @@ -22,3 +25,4 @@ def login_view(request):
return HttpResponse(201)
else:
return HttpResponse(405)

6 changes: 6 additions & 0 deletions templates/Main/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h2>Welcome to Django To-Do!</h2>
<ul>
<li>
<a href="/signup/">Sign-up</a>
</li>
</ul>
6 changes: 6 additions & 0 deletions templates/Main/signup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h2>Sign up</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Sign up</button>
</form>
3 changes: 3 additions & 0 deletions templates/Main/success-signup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h1>
Successfully signed up.
</h1>