From fbb4637a77dc5982b4e694dd31a0aa7d11cec17c Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Thu, 18 Jun 2020 23:17:08 +0200 Subject: initial commit --- accounts/__init__.py | 0 accounts/admin.py | 3 +++ accounts/apps.py | 5 +++++ accounts/migrations/__init__.py | 0 accounts/models.py | 3 +++ accounts/templates/accounts/signup.html | 12 ++++++++++++ accounts/tests.py | 3 +++ accounts/urls.py | 7 +++++++ accounts/views.py | 10 ++++++++++ 9 files changed, 43 insertions(+) create mode 100644 accounts/__init__.py create mode 100644 accounts/admin.py create mode 100644 accounts/apps.py create mode 100644 accounts/migrations/__init__.py create mode 100644 accounts/models.py create mode 100644 accounts/templates/accounts/signup.html create mode 100644 accounts/tests.py create mode 100644 accounts/urls.py create mode 100644 accounts/views.py (limited to 'accounts') diff --git a/accounts/__init__.py b/accounts/__init__.py new file mode 100644 index 0000000..e69de29 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 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 %} +

Iscriviti

+
+ {% csrf_token %} + {{ form.as_p }} + +
+{% 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' -- cgit v1.2.1