15 changed files with 82 additions and 13 deletions
@ -0,0 +1,3 @@ |
|||||
|
from django.contrib import admin |
||||
|
|
||||
|
# Register your models here. |
||||
@ -0,0 +1,6 @@ |
|||||
|
from django.apps import AppConfig |
||||
|
|
||||
|
|
||||
|
class AccountsConfig(AppConfig): |
||||
|
default_auto_field = 'django.db.models.BigAutoField' |
||||
|
name = 'accounts' |
||||
@ -0,0 +1,3 @@ |
|||||
|
from django.db import models |
||||
|
|
||||
|
# Create your models here. |
||||
@ -0,0 +1,3 @@ |
|||||
|
from django.test import TestCase |
||||
|
|
||||
|
# Create your tests here. |
||||
@ -0,0 +1,7 @@ |
|||||
|
from django.urls import path |
||||
|
|
||||
|
from .views import regView |
||||
|
|
||||
|
urlpatterns = [ |
||||
|
path("reg/", regView.as_view(),name="reg") |
||||
|
] |
||||
@ -0,0 +1,9 @@ |
|||||
|
from django.shortcuts import render |
||||
|
from django.contrib.auth.forms import UserCreationForm |
||||
|
from django.urls import reverse_lazy |
||||
|
from django.views import generic |
||||
|
|
||||
|
class regView(generic.CreateView): |
||||
|
form_class = UserCreationForm |
||||
|
success_url = reverse_lazy("login") |
||||
|
template_name = "registration/reg.html" |
||||
@ -0,0 +1,15 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en"> |
||||
|
<head> |
||||
|
<meta charset="UTF-8"> |
||||
|
<title>PW reset</title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<h1>PW reset - form</h1> |
||||
|
<form method="post"> |
||||
|
{% csrf_token %} |
||||
|
{{ form.as_p }} |
||||
|
<input type="submit" value="RESET PASSWORD"> |
||||
|
</form> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,16 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en"> |
||||
|
<head> |
||||
|
<meta charset="UTF-8"> |
||||
|
<title>Registration</title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<h1>Registration</h1> |
||||
|
<form method="post"> |
||||
|
{% csrf_token %} |
||||
|
{{ form.as_p }} |
||||
|
<button type="submit">Registration</button> |
||||
|
</form> |
||||
|
<a href="/">Home</a> |
||||
|
</body> |
||||
|
</html> |
||||
Loading…
Reference in new issue