added signup page
This commit is contained in:
parent
0cfb4eb697
commit
53bb7c4d75
0
signup/__init__.py
Normal file
0
signup/__init__.py
Normal file
3
signup/admin.py
Normal file
3
signup/admin.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
5
signup/apps.py
Normal file
5
signup/apps.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class SignupConfig(AppConfig):
|
||||
name = 'signup'
|
24
signup/jinja2/signup/index.html
Normal file
24
signup/jinja2/signup/index.html
Normal 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 %}
|
0
signup/migrations/__init__.py
Normal file
0
signup/migrations/__init__.py
Normal file
3
signup/models.py
Normal file
3
signup/models.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
3
signup/tests.py
Normal file
3
signup/tests.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
12
signup/urls.py
Normal file
12
signup/urls.py
Normal 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
13
signup/views.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user