Version 1.0
This commit is contained in:
0
GestionaleITS/accounts/__init__.py
Normal file
0
GestionaleITS/accounts/__init__.py
Normal file
3
GestionaleITS/accounts/admin.py
Normal file
3
GestionaleITS/accounts/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
GestionaleITS/accounts/apps.py
Normal file
6
GestionaleITS/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
GestionaleITS/accounts/migrations/__init__.py
Normal file
0
GestionaleITS/accounts/migrations/__init__.py
Normal file
3
GestionaleITS/accounts/models.py
Normal file
3
GestionaleITS/accounts/models.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
15
GestionaleITS/accounts/templates/accounts/base.html
Normal file
15
GestionaleITS/accounts/templates/accounts/base.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Index</title>
|
||||
<link rel="stylesheet" href="{% static 'css/style.css' %}">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/purecss@3.0.0/build/pure-min.css" integrity="sha384-X38yfunGUhNzHpBaEBsWLO+A0HDYOQi8ufWDkZ0k9e0eXz/tH3II7uKZ9msv++Ls" crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
{% extends "accounts/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<form method="post" class="pure-form">
|
||||
{% csrf_token %}
|
||||
{{ form }}<br/>
|
||||
<button type="submit" class="pure-button pure-button-primary">Register</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
3
GestionaleITS/accounts/tests.py
Normal file
3
GestionaleITS/accounts/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
7
GestionaleITS/accounts/urls.py
Normal file
7
GestionaleITS/accounts/urls.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from django.urls import path
|
||||
|
||||
from .views import RegistrationView
|
||||
|
||||
urlpatterns = [
|
||||
path("registration", RegistrationView.as_view(), name="registration" )
|
||||
]
|
||||
12
GestionaleITS/accounts/views.py
Normal file
12
GestionaleITS/accounts/views.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from django.contrib.auth.forms import UserCreationForm
|
||||
from django.shortcuts import render
|
||||
from django.urls import reverse_lazy
|
||||
from django.views.generic import CreateView
|
||||
|
||||
|
||||
# Create your views here.
|
||||
|
||||
class RegistrationView(CreateView):
|
||||
form_class = UserCreationForm
|
||||
success_url = reverse_lazy("login")
|
||||
template_name = "accounts/registration.html"
|
||||
Reference in New Issue
Block a user