Add Sign Up page
This commit is contained in:
0
accounts/__init__.py
Normal file
0
accounts/__init__.py
Normal file
3
accounts/admin.py
Normal file
3
accounts/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
accounts/apps.py
Normal file
6
accounts/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class AccountsConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'accounts'
|
||||
0
accounts/migrations/__init__.py
Normal file
0
accounts/migrations/__init__.py
Normal file
3
accounts/models.py
Normal file
3
accounts/models.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
3
accounts/tests.py
Normal file
3
accounts/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
6
accounts/urls.py
Normal file
6
accounts/urls.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.urls import path, include
|
||||
from .views import SignUpView
|
||||
|
||||
urlpatterns = [
|
||||
path("signup/", SignUpView.as_view(), name="signup"),
|
||||
]
|
||||
10
accounts/views.py
Normal file
10
accounts/views.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
from django.contrib.auth.forms import UserCreationForm
|
||||
from django.urls import reverse_lazy
|
||||
from django.views.generic import CreateView
|
||||
|
||||
class SignUpView(CreateView):
|
||||
form_class = UserCreationForm
|
||||
success_url = reverse_lazy("login")
|
||||
template_name = "registration/signup.html"
|
||||
Reference in New Issue
Block a user