aboutsummaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'accounts')
-rw-r--r--accounts/__init__.py0
-rw-r--r--accounts/admin.py3
-rw-r--r--accounts/apps.py5
-rw-r--r--accounts/migrations/__init__.py0
-rw-r--r--accounts/models.py3
-rw-r--r--accounts/templates/accounts/signup.html12
-rw-r--r--accounts/tests.py3
-rw-r--r--accounts/urls.py7
-rw-r--r--accounts/views.py10
9 files changed, 43 insertions, 0 deletions
diff --git a/accounts/__init__.py b/accounts/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/accounts/__init__.py
diff --git a/accounts/admin.py b/accounts/admin.py
new file mode 100644
index 0000000..8c38f3f
--- /dev/null
+++ b/accounts/admin.py
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/accounts/apps.py b/accounts/apps.py
new file mode 100644
index 0000000..9b3fc5a
--- /dev/null
+++ b/accounts/apps.py
@@ -0,0 +1,5 @@
+from django.apps import AppConfig
+
+
+class AccountsConfig(AppConfig):
+ name = 'accounts'
diff --git a/accounts/migrations/__init__.py b/accounts/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/accounts/migrations/__init__.py
diff --git a/accounts/models.py b/accounts/models.py
new file mode 100644
index 0000000..71a8362
--- /dev/null
+++ b/accounts/models.py
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
diff --git a/accounts/templates/accounts/signup.html b/accounts/templates/accounts/signup.html
new file mode 100644
index 0000000..e1591aa
--- /dev/null
+++ b/accounts/templates/accounts/signup.html
@@ -0,0 +1,12 @@
+{% extends 'registration/base.html' %}
+
+{% block title %}Iscriviti{% endblock %}
+
+{% block content %}
+ <h2>Iscriviti</h2>
+ <form method="post">
+ {% csrf_token %}
+ {{ form.as_p }}
+ <button class="btn waves-effect waves-light" type="submit">Invia</button>
+ </form>
+{% endblock %} \ No newline at end of file
diff --git a/accounts/tests.py b/accounts/tests.py
new file mode 100644
index 0000000..7ce503c
--- /dev/null
+++ b/accounts/tests.py
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/accounts/urls.py b/accounts/urls.py
new file mode 100644
index 0000000..d89128b
--- /dev/null
+++ b/accounts/urls.py
@@ -0,0 +1,7 @@
+from django.urls import path
+
+from . import views
+
+urlpatterns = [
+ path('signup/', views.SignUp.as_view(), name='signup'),
+]
diff --git a/accounts/views.py b/accounts/views.py
new file mode 100644
index 0000000..0483fad
--- /dev/null
+++ b/accounts/views.py
@@ -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 import generic
+
+
+class SignUp(generic.CreateView):
+ form_class = UserCreationForm
+ success_url = reverse_lazy('login')
+ template_name = 'accounts/signup.html'