├── .autogit ├── autogit.json └── logs │ ├── log-1-7-2020-23-39-45.txt │ ├── log-2-7-2020-0-40-5.txt │ └── log-2-7-2020-0-9-55.txt ├── .gitignore ├── README.md ├── accounts ├── __init__.py ├── admin.py ├── apps.py ├── backends.py ├── forms.py ├── migrations │ ├── 0001_initial.py │ └── __init__.py ├── models.py ├── templates │ ├── profile │ │ ├── profile.html │ │ └── profile_edit.html │ └── registration │ │ ├── logged_out.html │ │ ├── login.html │ │ ├── password_change_form.html │ │ ├── password_reset_complete.html │ │ ├── password_reset_confirm.html │ │ ├── password_reset_done.html │ │ ├── password_reset_email.html │ │ ├── password_reset_form.html │ │ └── signup.html ├── tests.py ├── urls.py └── views.py ├── manage.py ├── project ├── __init__.py ├── settings.py ├── urls.py └── wsgi.py └── templates └── base_generic.html /.autogit/autogit.json: -------------------------------------------------------------------------------- 1 | { 2 | "updateInterval": 1800, 3 | "logging": true, 4 | "silent": true 5 | } -------------------------------------------------------------------------------- /.autogit/logs/log-1-7-2020-23-39-45.txt: -------------------------------------------------------------------------------- 1 | -------------------- Auto-Git Log -------------------- 2 | Sat Aug 01 2020 23:39:45 GMT+0200 (Eastern European Standard Time) 3 | ------------------------------------------------------ 4 | 5 | Modified files: 6 | * accounts/views.py 7 | * project/urls.py 8 | 9 | 10 | Created files: 11 | * accounts/forms.py 12 | * accounts/urls.py 13 | 14 | 15 | Deleted files: 16 | 17 | 18 | Renamed files: 19 | -------------------------------------------------------------------------------- /.autogit/logs/log-2-7-2020-0-40-5.txt: -------------------------------------------------------------------------------- 1 | -------------------- Auto-Git Log -------------------- 2 | Sun Aug 02 2020 00:40:05 GMT+0200 (Eastern European Standard Time) 3 | ------------------------------------------------------ 4 | 5 | Modified files: 6 | 7 | 8 | Created files: 9 | * accounts/backends.py 10 | 11 | 12 | Deleted files: 13 | 14 | 15 | Renamed files: 16 | -------------------------------------------------------------------------------- /.autogit/logs/log-2-7-2020-0-9-55.txt: -------------------------------------------------------------------------------- 1 | -------------------- Auto-Git Log -------------------- 2 | Sun Aug 02 2020 00:09:55 GMT+0200 (Eastern European Standard Time) 3 | ------------------------------------------------------ 4 | 5 | Modified files: 6 | * accounts/forms.py 7 | * accounts/urls.py 8 | * accounts/views.py 9 | 10 | 11 | Created files: 12 | * .autogit/logs/log-1-7-2020-23-39-45.txt 13 | * accounts/templates/profile/profile.html 14 | * accounts/templates/profile/profile_edit.html 15 | * accounts/templates/registration/signup.html 16 | 17 | 18 | Deleted files: 19 | 20 | 21 | Renamed files: 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # django-accounts 2 | a simple Django Project for dealing with user auth 3 | -------------------------------------------------------------------------------- /accounts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/django-accounts/703dd0a1fb4e391586ff2901d2a68e34b2442056/accounts/__init__.py -------------------------------------------------------------------------------- /accounts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | from .models import Profile 5 | 6 | 7 | admin.site.register(Profile) -------------------------------------------------------------------------------- /accounts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountsConfig(AppConfig): 5 | name = 'accounts' 6 | -------------------------------------------------------------------------------- /accounts/backends.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.backends import ModelBackend 2 | from django.contrib.auth.models import User 3 | from django.db.models import Q 4 | 5 | 6 | class EmailBackend(ModelBackend): 7 | def authenticate(self,request,username=None,password=None,**kwargs): 8 | ''' check username or email & password is a valid user''' 9 | try: 10 | user = User.objects.get( 11 | Q(username__iexact=username) | 12 | Q(email__iexact=username) 13 | ) 14 | except User.DoesNotExist: 15 | return None 16 | 17 | except MultipleObjectsReturned: 18 | return User.objects.filter(email=username).order_by('id').first() 19 | 20 | else: 21 | if user.check_password(password) and self.user_can_authenticate(user): 22 | return user 23 | 24 | 25 | def get_user(self,user_id): 26 | try : 27 | user = User.objects.get(pk=user_id) 28 | 29 | except User.DoesNotExist: 30 | return None 31 | 32 | return user if self.user_can_authenticate(user) else None 33 | 34 | -------------------------------------------------------------------------------- /accounts/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from django.contrib.auth.forms import UserCreationForm 3 | from django.contrib.auth.models import User 4 | from .models import Profile 5 | 6 | class SignupForm(UserCreationForm): 7 | class Meta: 8 | model = User 9 | fields = ['username','email','password1','password2'] 10 | 11 | 12 | 13 | class UserForm(forms.ModelForm): 14 | class Meta: 15 | model = User 16 | fields = ['username' , 'email','first_name','last_name'] 17 | 18 | 19 | class ProfileForm(forms.ModelForm): 20 | class Meta: 21 | model = Profile 22 | fields = ['phone_number' , 'addres'] -------------------------------------------------------------------------------- /accounts/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.8 on 2020-08-01 21:06 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Profile', 19 | fields=[ 20 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('phone_number', models.CharField(blank=True, max_length=15, null=True)), 22 | ('addres', models.CharField(blank=True, max_length=50, null=True)), 23 | ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 24 | ], 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /accounts/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/django-accounts/703dd0a1fb4e391586ff2901d2a68e34b2442056/accounts/migrations/__init__.py -------------------------------------------------------------------------------- /accounts/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | from django.db.models.signals import post_save 4 | from django.dispatch import receiver 5 | # Create your models here. 6 | ''' 7 | username 8 | password 9 | first_name 10 | last_name 11 | email 12 | ''' 13 | 14 | class Profile(models.Model): 15 | user = models.OneToOneField(User , on_delete=models.CASCADE) 16 | phone_number = models.CharField(max_length=15,null=True , blank=True) 17 | addres = models.CharField(max_length=50 , blank=True, null=True) 18 | # image 19 | # age 20 | # Job 21 | 22 | def __str__(self): 23 | return str(self.user) 24 | 25 | 26 | @receiver(post_save , sender=User) 27 | def create_user_profile(sender,instance,created , **kwargs): 28 | if created: 29 | Profile.objects.create( 30 | user = instance 31 | ) 32 | -------------------------------------------------------------------------------- /accounts/templates/profile/profile.html: -------------------------------------------------------------------------------- 1 |

{{profile.user}}

2 | 3 |

{{profile.user.email}}

4 | 5 | 6 |
{{profile.phone_number}}
-------------------------------------------------------------------------------- /accounts/templates/profile/profile_edit.html: -------------------------------------------------------------------------------- 1 |

Profile Edit

2 | 3 | 4 |
5 | {% csrf_token %} 6 | {{userform}} 7 | {{profileform}} 8 | 9 |
-------------------------------------------------------------------------------- /accounts/templates/registration/logged_out.html: -------------------------------------------------------------------------------- 1 | {% extends "base_generic.html" %} 2 | 3 | {% block content %} 4 |

Logged out!

5 | Click here to login again. 6 | {% endblock %} -------------------------------------------------------------------------------- /accounts/templates/registration/login.html: -------------------------------------------------------------------------------- 1 | {% extends "base_generic.html" %} 2 | 3 | {% block content %} 4 | 5 | {% if form.errors %} 6 |

Your username and password didn't match. Please try again.

7 | {% endif %} 8 | 9 | {% if next %} 10 | {% if user.is_authenticated %} 11 |

Your account doesn't have access to this page. To proceed, 12 | please login with an account that has access.

13 | {% else %} 14 |

Please login to see this page.

15 | {% endif %} 16 | {% endif %} 17 | 18 |
19 | {% csrf_token %} 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
{{ form.username.label_tag }}{{ form.username }}
{{ form.password.label_tag }}{{ form.password }}
30 | 31 | 32 |
33 | 34 | {# Assumes you setup the password_reset view in your URLconf #} 35 |

Lost password?

36 | 37 | {% endblock %} -------------------------------------------------------------------------------- /accounts/templates/registration/password_change_form.html: -------------------------------------------------------------------------------- 1 | {% extends "base_generic.html" %} 2 | 3 | {% block content %} 4 |
5 | {% csrf_token %} 6 | {{form}} 7 | 8 |
9 | {% endblock %} -------------------------------------------------------------------------------- /accounts/templates/registration/password_reset_complete.html: -------------------------------------------------------------------------------- 1 | {% extends "base_generic.html" %} 2 | 3 | {% block content %} 4 |

The password has been changed!

5 |

log in again?

6 | {% endblock %} -------------------------------------------------------------------------------- /accounts/templates/registration/password_reset_confirm.html: -------------------------------------------------------------------------------- 1 | {% extends "base_generic.html" %} 2 | 3 | {% block content %} 4 | {% if validlink %} 5 |

Please enter (and confirm) your new password.

6 |
7 | {% csrf_token %} 8 | 9 | 10 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
{{ form.new_password1.errors }} 11 | {{ form.new_password1 }}
{{ form.new_password2.errors }} 16 | {{ form.new_password2 }}
24 |
25 | {% else %} 26 |

Password reset failed

27 |

The password reset link was invalid, possibly because it has already been used. Please request a new password reset.

28 | {% endif %} 29 | {% endblock %} -------------------------------------------------------------------------------- /accounts/templates/registration/password_reset_done.html: -------------------------------------------------------------------------------- 1 | {% extends "base_generic.html" %} 2 | 3 | {% block content %} 4 |

We've emailed you instructions for setting your password. If they haven't arrived in a few minutes, check your spam folder.

5 | {% endblock %} -------------------------------------------------------------------------------- /accounts/templates/registration/password_reset_email.html: -------------------------------------------------------------------------------- 1 | Someone asked for password reset for email {{ email }}. Follow the link below: 2 | {{ protocol}}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %} -------------------------------------------------------------------------------- /accounts/templates/registration/password_reset_form.html: -------------------------------------------------------------------------------- 1 | {% extends "base_generic.html" %} 2 | 3 | {% block content %} 4 |
5 | {% csrf_token %} 6 | {% if form.email.errors %} 7 | {{ form.email.errors }} 8 | {% endif %} 9 |

{{ form.email }}

10 | 11 |
12 | {% endblock %} -------------------------------------------------------------------------------- /accounts/templates/registration/signup.html: -------------------------------------------------------------------------------- 1 |

SIgnup Form

2 | 3 | 4 |
5 | {% csrf_token %} 6 | {{form}} 7 | 8 |
-------------------------------------------------------------------------------- /accounts/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /accounts/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | 5 | app_name='accounts' 6 | 7 | urlpatterns = [ 8 | path('signup',views.signup , name='signup'), 9 | path('profile',views.profile , name='profile'), 10 | path('profile/edit',views.profile_edit , name='profile_edit'), 11 | ] 12 | -------------------------------------------------------------------------------- /accounts/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render , redirect 2 | from .models import Profile 3 | from .forms import SignupForm , UserForm , ProfileForm 4 | from django.contrib.auth import authenticate , login 5 | # Create your views here. 6 | 7 | 8 | 9 | def signup(request): 10 | if request.method == 'POST': ## save 11 | form = SignupForm(request.POST) 12 | if form.is_valid(): 13 | form.save() 14 | username = form.cleaned_data['username'] 15 | password = form.cleaned_data['password1'] 16 | user = authenticate(username=username, password=password) 17 | login(request,user) 18 | return redirect('/accounts/profile') 19 | 20 | else: ## show form 21 | form = SignupForm() 22 | 23 | return render(request,'registration/signup.html',{'form':form}) 24 | 25 | 26 | def profile(request): 27 | profile = Profile.objects.get(user=request.user) 28 | return render(request,'profile/profile.html',{'profile':profile}) 29 | 30 | 31 | 32 | 33 | def profile_edit(request): 34 | profile = Profile.objects.get(user=request.user) 35 | if request.method == 'POST': 36 | userform = UserForm(request.POST , instance=request.user) 37 | profile_form = ProfileForm(request.POST , instance=profile) 38 | if userform.is_valid() and profile_form.is_valid(): 39 | userform.save() 40 | myform = profile_form.save(commit=False) 41 | myform.user = request.user 42 | myform.save() 43 | return redirect('/accounts/profile') 44 | 45 | else: ## show 46 | userform = UserForm(instance=request.user) 47 | profile_form = ProfileForm(instance=profile) 48 | 49 | return render(request,'profile/profile_edit.html',{ 50 | 'userform' : userform , 51 | 'profileform' : profile_form , 52 | }) 53 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError: 10 | # The above import may fail for some other reason. Ensure that the 11 | # issue is really that Django is missing to avoid masking other 12 | # exceptions on Python 2. 13 | try: 14 | import django 15 | except ImportError: 16 | raise ImportError( 17 | "Couldn't import Django. Are you sure it's installed and " 18 | "available on your PYTHONPATH environment variable? Did you " 19 | "forget to activate a virtual environment?" 20 | ) 21 | raise 22 | execute_from_command_line(sys.argv) 23 | -------------------------------------------------------------------------------- /project/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pythondeveloper6/django-accounts/703dd0a1fb4e391586ff2901d2a68e34b2442056/project/__init__.py -------------------------------------------------------------------------------- /project/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for project project. 3 | 4 | Generated by 'django-admin startproject' using Django 1.11.6. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/1.11/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '07&7l$m0v8wrla6x@dlc_ljh-q=nd2##b21lnnhgtsz-#u+bh8' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'accounts', 35 | 'django.contrib.admin', 36 | 'django.contrib.auth', 37 | 'django.contrib.contenttypes', 38 | 'django.contrib.sessions', 39 | 'django.contrib.messages', 40 | 'django.contrib.staticfiles', 41 | 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'project.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': ['templates'], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'project.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.sqlite3', 81 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 82 | } 83 | } 84 | 85 | 86 | # Password validation 87 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators 88 | 89 | AUTH_PASSWORD_VALIDATORS = [ 90 | { 91 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 92 | }, 93 | { 94 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 95 | }, 96 | { 97 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 98 | }, 99 | { 100 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 101 | }, 102 | ] 103 | 104 | 105 | # Internationalization 106 | # https://docs.djangoproject.com/en/1.11/topics/i18n/ 107 | 108 | LANGUAGE_CODE = 'en-us' 109 | 110 | TIME_ZONE = 'UTC' 111 | 112 | USE_I18N = True 113 | 114 | USE_L10N = True 115 | 116 | USE_TZ = True 117 | 118 | 119 | # Static files (CSS, JavaScript, Images) 120 | # https://docs.djangoproject.com/en/1.11/howto/static-files/ 121 | 122 | STATIC_URL = '/static/' 123 | 124 | LOGIN_REDIRECT_URL = '/accounts/profile' 125 | 126 | AUTHENTICATION_BACKENDS = ['accounts.backends.EmailBackend'] -------------------------------------------------------------------------------- /project/urls.py: -------------------------------------------------------------------------------- 1 | """project URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/1.11/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.conf.urls import url, include 14 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 15 | """ 16 | from django.urls import path , include 17 | from django.contrib import admin 18 | 19 | urlpatterns = [ 20 | path('accounts/', include('django.contrib.auth.urls')), 21 | path('admin/', admin.site.urls), 22 | path('accounts/', include('accounts.urls',namespace='accounts')), 23 | 24 | ] 25 | -------------------------------------------------------------------------------- /project/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for project project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /templates/base_generic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | {% block content %} 5 | {% endblock %} 6 |
--------------------------------------------------------------------------------