added signup page

This commit is contained in:
iou1name 2018-08-10 19:14:33 -04:00
parent 0cfb4eb697
commit 53bb7c4d75
9 changed files with 63 additions and 0 deletions

0
signup/__init__.py Normal file
View File

3
signup/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
signup/apps.py Normal file
View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class SignupConfig(AppConfig):
name = 'signup'

View File

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block title %}Sign up a new account{% endblock %}
{% block content %}
<h1>Sign up</h1>
<div id="namePassRules">
<p>Username rules:
<ul>
<li>Must be between 3 and 20 characters</li>
<li>Can only contain ASCII letters (case sensitive) and numbers</li>
</ul>
<p>Password rules:
<ul>
<li>Must be between 8 and 1024 characters</li>
</ul>
</div>
<form method="post" action="{{ url('signup:index') }}">
{{ csrf_input }}
<input type="text" placeholder="Username" name="username" maxlength="20" required/><br />
<input type="text" placeholder="Email" name="email" maxlength="20" required/><br />
<input type="password" placeholder="Password" name="password" maxlength="1024" required/><br />
<input type="password" placeholder="Verify password" name="password_verify" maxlength="1024" required/><br />
<input type="submit" value="Sign up" name="submit"/>
</form>
{% endblock %}

View File

3
signup/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
signup/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

12
signup/urls.py Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env python3
"""
signup app URL configuration.
"""
from django.urls import path
from . import views
app_name = 'signup'
urlpatterns = [
path('', views.index, name='index'),
]

13
signup/views.py Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env python3
"""
/signup app views.
"""
from django.shortcuts import render
def index(request):
"""
The signup page.
"""
if request.method == "GET":
context = {}
return render(request, 'signup/index.html', context)