From 74a25aa8e6edec548fad2ba8d5659177baa1bce7 Mon Sep 17 00:00:00 2001 From: zecollokaris Date: Wed, 17 Mar 2021 16:41:09 +0300 Subject: [PATCH 1/9] initial commit --- LICENSE | 7 -- Login/__init__.py | 0 Login/asgi.py | 16 +++ Login/settings.py | 120 +++++++++++++++++++++ Login/urls.py | 21 ++++ Login/wsgi.py | 16 +++ Procfile | 1 + README.md | 144 ++----------------------- Success/__init__.py | 0 Success/admin.py | 3 + Success/apps.py | 5 + Success/migrations/__init__.py | 0 Success/models.py | 3 + Success/templates/Success/base.html | 22 ++++ Success/templates/Success/index.html | 2 + Success/tests.py | 3 + Success/urls.py | 10 ++ Success/views.py | 3 + manage.py | 22 ++++ newDjango.sh | 156 --------------------------- requirements.txt | 92 ++++++++++++++++ static/css/Success.css | 0 virtual/bin/python | 1 + virtual/bin/python3 | 1 + virtual/bin/python3.8 | 1 + virtual/lib64 | 1 + virtual/pyvenv.cfg | 3 + 27 files changed, 356 insertions(+), 297 deletions(-) delete mode 100644 LICENSE create mode 100644 Login/__init__.py create mode 100644 Login/asgi.py create mode 100644 Login/settings.py create mode 100644 Login/urls.py create mode 100644 Login/wsgi.py create mode 100644 Procfile create mode 100644 Success/__init__.py create mode 100644 Success/admin.py create mode 100644 Success/apps.py create mode 100644 Success/migrations/__init__.py create mode 100644 Success/models.py create mode 100644 Success/templates/Success/base.html create mode 100644 Success/templates/Success/index.html create mode 100644 Success/tests.py create mode 100644 Success/urls.py create mode 100644 Success/views.py create mode 100755 manage.py delete mode 100755 newDjango.sh create mode 100644 requirements.txt create mode 100644 static/css/Success.css create mode 120000 virtual/bin/python create mode 120000 virtual/bin/python3 create mode 120000 virtual/bin/python3.8 create mode 120000 virtual/lib64 create mode 100644 virtual/pyvenv.cfg diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 7437cc8..0000000 --- a/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ - Copyright (c) [2018-2020] - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/Login/__init__.py b/Login/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Login/asgi.py b/Login/asgi.py new file mode 100644 index 0000000..3ff2fb7 --- /dev/null +++ b/Login/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for Login project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Login.settings') + +application = get_asgi_application() diff --git a/Login/settings.py b/Login/settings.py new file mode 100644 index 0000000..df477f7 --- /dev/null +++ b/Login/settings.py @@ -0,0 +1,120 @@ +""" +Django settings for Login project. + +Generated by 'django-admin startproject' using Django 3.1.7. + +For more information on this file, see +https://docs.djangoproject.com/en/3.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.1/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '&z9yaki6^*-kmxxw)q@%&5s8(b=&=e04%-pb7vs8ne&bwh9#m0' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'Login.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'Login.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/3.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.1/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/Login/urls.py b/Login/urls.py new file mode 100644 index 0000000..2ff98ad --- /dev/null +++ b/Login/urls.py @@ -0,0 +1,21 @@ +"""Login URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path + +urlpatterns = [ + path('admin/', admin.site.urls), +] diff --git a/Login/wsgi.py b/Login/wsgi.py new file mode 100644 index 0000000..6922179 --- /dev/null +++ b/Login/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for Login project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Login.settings') + +application = get_wsgi_application() diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..f5c3286 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn Login.wsgi diff --git a/README.md b/README.md index d46469d..3f88483 100644 --- a/README.md +++ b/README.md @@ -1,151 +1,27 @@ -# DESCRIPTION +# Login -This is a **shell script** that that allows **execution of Django** a python based framework. +# Description -A shell script is a **computer program** designed to be run by the Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts ***include file manipulation, program execution, and printing text.*** A script which sets up the environment, runs the program, and does any necessary cleanup, logging, etc. is called a wrapper. - -Django is a **high-level Python Web framework** that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. - -# **WHAT THIS DJANGO-SHELL-SCRIPT DOES FOR YOU.** - -**{Please go through what this shell-script does for you. It will help you avoid bugs in your code. In case you use a technology that might cause failure of your code to run}** - -1. Creates a **folder** for you. - -2. Initializes Empty **Git Repository**. - -3. Installs **Django 2.0.7** (Can be updated to latest version). - -4. Installs **Django-bootstrap4.** - -5. Installs **pillow** for Image Integration. - -6. Installs **dj-database-url.** - -7. Installs **gunicorn.** - -8. Installs **psycopg2.** - -9. Installs **whitenoise.** - -10. Installs **python-decouple.** - -11. Installs **wheel** - - -**CREATED FILES** -The script also **helps in creating some files** and this making it easy for you to code as you no longer hav to create them on your own. - -It simply creates files and adds the preset standard code thats will not change in any given file structure. - - -1. Creates **static** file together with **css files.** - -2. Creates **templates** - -3. Creates **base.html** and **adds it to** the templates folder. - -4. Creates **index.html**, **links it to base.html using {% extends ' '%}** then **adds it to** templates folder. - -5. Creates **virtual environment**. - -6. Creates **.env** file and **sets DEBUG = True** - -7. Creates **.gitignore** and adds **(virtual/ | *.pyc | .env | migrations/ )** to .gitignore. - -8. Creates **Procfile** - -9. Creates **README.md** - -10. Creates **requirements.txt** - -* You are now ready to code. - - - -# Prerequisites. - -* You need to have nano text editor installed. you can find out whether you have it installed by typing nano --version in your terminal. For most linux distributions, it is installed by default. - -* To work with the script you have to clone Django-shell-script on my github repo. - -Link:-> ```https://github.com/zecollokaris/Django-shell-script``` - -**Installing Nano Text Editor.** - --However, if you don't have it installed, you can quicky do that by typing: - - -``` - sudo apt-get install nano -``` - -* You need to have (python3.6) installed in your machine. - --To check if you already have python3.6 before installing type: - - - -``` -python3.6 -V -``` - -**Installing Python3.6** - -To install python3.6 you can quicky do that by typing: - - - -``` -sudo apt-get install python3.6 -``` +# Prerequisites # Setup/Installation Reqiurements. - **{follow the below instructions for set up.}** -1. You will need **Internet connection.** - -2. You will also need a Webpage URL to load in URL's: - -3. To **get to use Django-shell-script** fist you need to get to the **Django-shell-script repository.** - -Link:-> ```https://github.com/zecollokaris/Django-shell-script``` - -4. From there you can access Django-shell-script. - -5. **Clone** the project. - -6. **Once you done with cloning** and project is on your device. +# Technologies Used -7. **get into project folder** (cd into project). +# Support and Contact +-Mobile number: (+254) 798731203 +-Email Address: collo.kariss@gmail.com -# **HOW TO USE.** - -**To work With this Django-shell-script** - -1. **Make sure your inside folder containing script.** - -2. Create **Django folder structure** - - ``` - source newDjango.sh (PROJECTNAME) (APPNAME) - ``` - -3. From there the it will **prompt you to create a PostgreSQL Database** an object-relational database management system. - -4. You Django is ready **HAPPY CODING :-)** - ---- +-github-username: zecollokaris ## License The app is licensed by MIT. -MIT (c) 2018 - 2020 +Collins Kariuki - MIT (c)2018 LICENSE + -Feel FREE to contribute to make the **script** better for others. ---- diff --git a/Success/__init__.py b/Success/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Success/admin.py b/Success/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/Success/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/Success/apps.py b/Success/apps.py new file mode 100644 index 0000000..b3dd825 --- /dev/null +++ b/Success/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class SuccessConfig(AppConfig): + name = 'Success' diff --git a/Success/migrations/__init__.py b/Success/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Success/models.py b/Success/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/Success/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/Success/templates/Success/base.html b/Success/templates/Success/base.html new file mode 100644 index 0000000..54e1c3e --- /dev/null +++ b/Success/templates/Success/base.html @@ -0,0 +1,22 @@ +{%load bootstrap4 %} +{% load static %} + + + + Login +{%block styles%} +{%bootstrap_css%} + +{% endblock %} + + + +{%block content%} +{% endblock %} +{% block scripts %} + + + {% bootstrap_javascript %} {% endblock %} + + + diff --git a/Success/templates/Success/index.html b/Success/templates/Success/index.html new file mode 100644 index 0000000..f01cffd --- /dev/null +++ b/Success/templates/Success/index.html @@ -0,0 +1,2 @@ +{%extends 'Success/base.html'%} +{%block content%} diff --git a/Success/tests.py b/Success/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/Success/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/Success/urls.py b/Success/urls.py new file mode 100644 index 0000000..981b634 --- /dev/null +++ b/Success/urls.py @@ -0,0 +1,10 @@ +from django.conf.urls import url,include +from . import views +from django.contrib import admin +from django.conf.urls.static import static +from django.conf import settings + +urlpatterns = [ + url(r'^$', views.index, name= 'index'), +] + diff --git a/Success/views.py b/Success/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/Success/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..be2c763 --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Login.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/newDjango.sh b/newDjango.sh deleted file mode 100755 index 9e86be5..0000000 --- a/newDjango.sh +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/sh - -# Creating new app -mkdir ${1} -cd ${1} -# Creating virtual folder -chmod a+x newDjango.sh - -python3.6 -m venv virtual - -source virtual/bin/activate -Initializing git -git init -touch .gitignore -touch README.md -cat >> README.md << EOF -# ${1} - -# Description - -# Prerequisites - -# Setup/Installation Reqiurements. -**{follow the below instructions for set up.}** - -# Technologies Used - -# Support and Contact - --Mobile number: (+254) 798731203 - --Email Address: collo.kariss@gmail.com - --github-username: zecollokaris - -## License - -The app is licensed by MIT. - -Collins Kariuki - MIT (c)2018 LICENSE - - - -EOF -mkdir static -cd static -mkdir css -cd css -touch ${2}.css -cd ../../ - -cat >> .gitignore << EOF - -virtual/ -*.pyc -.env -migrations/ - -EOF - -# Installing dependencies -pip install Django==2.0.7 -pip install django-bootstrap4 pillow -pip install dj-database-url gunicorn psycopg2 whitenoise python-decouple -pip install wheel - -django-admin startproject ${1} . -django-admin startapp ${2} - -# Creating Folder -cd ${2} -# defining the app urls -touch urls.py - -cat >> urls.py<< EOF -from django.conf.urls import url,include -from . import views -from django.contrib import admin -from django.conf.urls.static import static -from django.conf import settings - -urlpatterns = [ - url(r'^$', views.index, name= 'index'), -] - -EOF - -mkdir templates templates/${2}/ -cd templates/${2}/ - -# creating the templates -touch base.html index.html - -# Filling the base.html file -cat >> base.html<< EOF -{%load bootstrap4 %} -{% load static %} - - - - ${1} -{%block styles%} -{%bootstrap_css%} - -{% endblock %} - - - -{%block content%} -{% endblock %} -{% block scripts %} - - - {% bootstrap_javascript %} {% endblock %} - - - -EOF -cat >> index.html << EOF -{%extends '${2}/base.html'%} -{%block content%} -EOF -cd ../../../ - -# Getting requirements -pip freeze > requirements.txt - -# Creating procfile -touch Procfile - -# Configuring procfile -cat >> Procfile << EOF -web: gunicorn ${1}.wsgi -EOF -# creating env file -touch .env - -cat>> .env << EOF -DEBUG = True - -EOF - - -# Creating initial commit -git add . - -git commit -m "Initial Commit" - -# enter psql -psql - -# Open code -code . - -# Delete Shell Script -rm -f newDjango.sh \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..14787e2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,92 @@ +appdirs==1.4.4 +apturl==0.5.2 +asgiref==3.3.1 +bcrypt==3.1.7 +beautifulsoup4==4.9.3 +blinker==1.4 +Brlapi==0.7.0 +certifi==2019.11.28 +chardet==3.0.4 +Click==7.0 +colorama==0.4.3 +command-not-found==0.3 +cryptography==2.8 +cupshelpers==1.0 +dbus-python==1.2.16 +defer==1.0.6 +distlib==0.3.1 +distro==1.4.0 +distro-info===0.23ubuntu1 +dj-database-url==0.5.0 +Django==3.1.7 +django-bootstrap==0.2.4 +django-bootstrap3==14.2.0 +django-bootstrap4==2.3.1 +django-registration-redux==2.9 +duplicity==0.8.12.0 +entrypoints==0.3 +fasteners==0.14.1 +filelock==3.0.12 +future==0.18.2 +gunicorn==20.0.4 +httplib2==0.14.0 +idna==2.8 +importlib-metadata==1.5.0 +keyring==18.0.1 +keyrings.alt==3.4.0 +language-selector==0.1 +launchpadlib==1.10.13 +lazr.restfulclient==0.14.2 +lazr.uri==1.0.3 +lockfile==0.12.2 +louis==3.12.0 +macaroonbakery==1.3.1 +Mako==1.1.0 +MarkupSafe==1.1.0 +monotonic==1.5 +more-itertools==4.2.0 +netifaces==0.10.4 +oauthlib==3.1.0 +olefile==0.46 +paramiko==2.6.0 +pexpect==4.6.0 +Pillow==7.0.0 +protobuf==3.6.1 +psycopg2==2.8.6 +pycairo==1.16.2 +pycrypto==2.6.1 +pycups==1.9.73 +PyGObject==3.36.0 +PyJWT==1.7.1 +pymacaroons==0.13.0 +PyNaCl==1.3.0 +pyRFC3339==1.1 +python-apt==2.0.0+ubuntu0.20.4.1 +python-dateutil==2.7.3 +python-debian===0.1.36ubuntu1 +python-decouple==3.4 +pytz==2019.3 +pyxdg==0.26 +PyYAML==5.3.1 +reportlab==3.5.34 +requests==2.22.0 +requests-unixsocket==0.2.0 +SecretStorage==2.3.1 +simplejson==3.16.0 +six==1.14.0 +soupsieve==2.2 +sqlparse==0.4.1 +system-service==0.3 +systemd-python==234 +ubuntu-advantage-tools==20.3 +ubuntu-drivers-common==0.0.0 +ufw==0.36 +unattended-upgrades==0.1 +urllib3==1.25.8 +usb-creator==0.3.7 +virtualenv==20.4.2 +wadllib==1.3.3 +whitenoise==5.2.0 +xkit==0.0.0 +zipp==1.0.0 +zope.interface==4.7.1 diff --git a/static/css/Success.css b/static/css/Success.css new file mode 100644 index 0000000..e69de29 diff --git a/virtual/bin/python b/virtual/bin/python new file mode 120000 index 0000000..4e58b60 --- /dev/null +++ b/virtual/bin/python @@ -0,0 +1 @@ +python3.8 \ No newline at end of file diff --git a/virtual/bin/python3 b/virtual/bin/python3 new file mode 120000 index 0000000..4e58b60 --- /dev/null +++ b/virtual/bin/python3 @@ -0,0 +1 @@ +python3.8 \ No newline at end of file diff --git a/virtual/bin/python3.8 b/virtual/bin/python3.8 new file mode 120000 index 0000000..02a1389 --- /dev/null +++ b/virtual/bin/python3.8 @@ -0,0 +1 @@ +/usr/bin/python3.8 \ No newline at end of file diff --git a/virtual/lib64 b/virtual/lib64 new file mode 120000 index 0000000..7951405 --- /dev/null +++ b/virtual/lib64 @@ -0,0 +1 @@ +lib \ No newline at end of file diff --git a/virtual/pyvenv.cfg b/virtual/pyvenv.cfg new file mode 100644 index 0000000..8dbc2ba --- /dev/null +++ b/virtual/pyvenv.cfg @@ -0,0 +1,3 @@ +home = /usr/bin +include-system-site-packages = false +version = 3.8.5 From 0b436369c6e20cf7742555ad93bb88af6b402e44 Mon Sep 17 00:00:00 2001 From: zecollokaris Date: Wed, 17 Mar 2021 16:48:06 +0300 Subject: [PATCH 2/9] set up database setting in django setting.py to configure database to collect login data --- Login/settings.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Login/settings.py b/Login/settings.py index df477f7..defb6e7 100644 --- a/Login/settings.py +++ b/Login/settings.py @@ -37,6 +37,8 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'bootstrap4', + 'Management', ] MIDDLEWARE = [ @@ -75,8 +77,10 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': 'djangologin', + 'USER': 'karis', + 'PASSWORD': 'K@r!s##!', } } @@ -105,7 +109,7 @@ LANGUAGE_CODE = 'en-us' -TIME_ZONE = 'UTC' +TIME_ZONE = 'Africa/Nairobi' USE_I18N = True From 10b00ddd4498d5e1e59cb2a60a39bc2bf71325b2 Mon Sep 17 00:00:00 2001 From: zecollokaris Date: Wed, 17 Mar 2021 16:51:48 +0300 Subject: [PATCH 3/9] initial migrate --- Login/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 133 bytes Login/__pycache__/__init__.cpython-38.pyc | Bin 0 -> 141 bytes Login/__pycache__/settings.cpython-36.pyc | Bin 0 -> 2307 bytes Login/__pycache__/settings.cpython-38.pyc | Bin 0 -> 2344 bytes Login/__pycache__/urls.cpython-38.pyc | Bin 0 -> 916 bytes Login/settings.py | 2 +- 6 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 Login/__pycache__/__init__.cpython-36.pyc create mode 100644 Login/__pycache__/__init__.cpython-38.pyc create mode 100644 Login/__pycache__/settings.cpython-36.pyc create mode 100644 Login/__pycache__/settings.cpython-38.pyc create mode 100644 Login/__pycache__/urls.cpython-38.pyc diff --git a/Login/__pycache__/__init__.cpython-36.pyc b/Login/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f12bd0cfcc34f4e2f9360fbd64f029dd27067232 GIT binary patch literal 133 zcmXr!<>lJM6qLXK1dl-k3@`#24nSPY0whuxf*CX!{Z=v*frJsnFC+bo{M=Oi?8KtX zVttp?;_Q2KczG$)edAg`kf=x_82_X70h(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6vAKO;XkRX;ni zD6?4KCAB!aB)>r4B`Yy6Jzv)+KRq)~A40~*XXa&=#K-FuRNmsS$<0qG%}KQbne`cn F832heA07Yz literal 0 HcmV?d00001 diff --git a/Login/__pycache__/settings.cpython-36.pyc b/Login/__pycache__/settings.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d35fbdfe48490e5b1bef36d79f3ed3bf89d2cced GIT binary patch literal 2307 zcmb7F+ji4N6tx}2c0>}wokD3vQvwb|;#MwQKqG7syzp&V3TgFFRrVPxljw$KOo(3j z4St}1(eKb}pZW`Z>XB>{*I})uQ8XUSIeVYWoHO%aX-Rxm?*3*h=5l}LrvAz}-^7>w zfdk~s9OR+k=DmVh$md9b%ze!72_JKN^Lz7V5$4Pi2xi&InF}xvMJPcT7C?kku;`Rc z5td*XPQwbEfwOSVDVe9>ytxP$oE!*n5iY@H_zJE#0?otKPlA&-m*8u28Lq)M@GVGi z9lra7GV?U7!uP1N3OBNGEgNsryd#(^aLYUc74t0maSq?}_+Ef@^CH~VbCo;xdOnvE zYkRiu1QH{hQ{Q3IAc&+!;80%*qhOEpxh#rX#3zx>2}r#|=_X`|4I4aEV%(1SSo5Yd zWXK_nDIdu9_p@2|yA5AA*W=-2g)eec7EgUY+j8*4wXC%1af*PfHR4{vOQy~pp_6Q8X0 z4tAfedUuWZ{3tBBANV|?JvmEZd~SAii2PS)7E=iEIX?^ui!aRx8DR{QdR*Y4z;+OE zWfsA48~SPTnJM;yfHNN1;X_kw+CBn2G!<`*F&+hQ$$=danUVf5qWnz&dV~Dh$72_0e zHi$_Ar@_rpQm0Ulz7T{<`}=!#e;*q{{`pm8d!!wvmCvSdV%BK#FmhR}j5#>*LKk~Y z?je}?FzE%kmbINR7Bll~RuUh$g>&QTQLnmH8fo4SBVaM?J_E`6G z*{0e20&|+>_`!_w=L~)UFp*V+r1Vm)zR_AWQ>fLudQw(99V?ra+8v|bZt3yGQL+x0 zLuES*F~8a7B_$vOd+74`+SoGmj&c_Uj5`rw?_4}zvjn>7*=Ek~+Yx1P`ORi@ovp53 zM-PfxYpdSU5}~CwaopCmZc^^3y1vuy)}r+6k6+KkmX%d#Gj7@8k7j?!y9uaJwl%O^ANJRU` z8Rm(Sy7Utk2%)==-4GVVOI00vj5}dUK5aAr0hYRo#T(m`+flF^hJ7dhk$Hp97 zhEL#Akl+e@_6B9fNmzu>QD+gZrgSN#*J#ETjd{3koPx4(8uM7d=L|k)Vc9qbH*}$V z(^}35Lb1AIdA2Vx!a4P9CT;nlRQGM_NkQoEkRF$d#WmuQ(BcH7?!I&lQi~M}TvTG* z3i(j;n$&0LLmIlgE8mtMp!HMq==vd%sE5v7i&Ni|@W;0)hNBL-iP1@MoAZEusVLz0 zm^_Fv%An`F3h@+lsBk}^J*JG(RR-?)Hj%dajw3mgamn90+>Ye|1|l?+URh3`u>TV) zBwJ&F{=lLO13CMLw=d_N#8IzJ&~gfRs5 zsK7;mWuwK#Nehl;=q2DYquBL*&Uk1A_l#Ux`e{%g^8R_*y%J*e`_|iC# zMfWDX5A%`7?DYX}%&L4e2o~D)J-L$p{f8a4^H6b(K+;~? zhhv75n;2m?Zrm8)Ic9bL1DkMYZ+FM)?cyxR-#!g3m$ZVU>DicFF$G%ghYpLBp$|^n zz`-$-yJ$>27>$8kO((816f@&=+6}L{i38HZl>CrI*C(AE)sca8`*yT^49$?d#9`sl zjiK&A$0lfgz;l9fbaz7e0KpF!jAUgo&OcEr&$VXN5UaJe9v9U0bu)d-x7ItgR#T78 z4ZzxCHkGX)Kz!5U#d#oGR^Q>#^vXo}|e4IB;JjqQn&Ifp2I=D);i{M?YlTv)t+pu#j|R?-rCfv=ChXG z(c`&VQ|}-P8Q3m*Tx`^;)w;H+wzas_ZnZk*M!Q~VHJ`>a9j&omS38;>&u{8$wM4&O ztEfq5#WPj4qb6bX_=398d1j7^ZoW|KH59h6A!qAqb8SOi)67b%s-eSLLor^yaB{F87rt_R=sV)TmLNjcjCO5Kjh*1WL7|lc!d5bE?}g=cluxb6%ud& literal 0 HcmV?d00001 diff --git a/Login/__pycache__/urls.cpython-38.pyc b/Login/__pycache__/urls.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7aa436bd92ec865790f37891cf92a0e6bf186fdb GIT binary patch literal 916 zcma)5L2uJA6i(8#D_IAB!M7|@7c;n3Fo8BECQTd$yY!N}v75S!?Z|e3apl)=<>%ze z3GolOz_Z&*5faiY<;hN-zxRFLd$~P2N&;BlqnpLACiu#X(W_ph|87I!b6~@X2dXL7@H*s z*4o;}%rK^^G&$W6S*b>=4J&P4DuJ2A&+}7kRl`ezT{4F91}ASm69HIemRz>7bnLce zJ?LqUUQ>#QL|imV+ZjSDtppPH1!_v_vFjebBbpn0!OR^D8NTonc;bHmyp0YeZ|=MC3!!LRv$GH& P%osxaWD-sWlRtj}N>dwu literal 0 HcmV?d00001 diff --git a/Login/settings.py b/Login/settings.py index defb6e7..d6dc583 100644 --- a/Login/settings.py +++ b/Login/settings.py @@ -38,7 +38,7 @@ 'django.contrib.messages', 'django.contrib.staticfiles', 'bootstrap4', - 'Management', + 'Login', ] MIDDLEWARE = [ From d6265c8111e7366d1256d4e8b9e243e45f5c79fd Mon Sep 17 00:00:00 2001 From: zecollokaris Date: Wed, 17 Mar 2021 17:09:18 +0300 Subject: [PATCH 4/9] created super user --- Login/__pycache__/wsgi.cpython-38.pyc | Bin 0 -> 540 bytes Success/models.py | 22 ++++++++ virtual/bin/activate | 76 ++++++++++++++++++++++++++ virtual/bin/activate.csh | 37 +++++++++++++ virtual/bin/activate.fish | 75 +++++++++++++++++++++++++ virtual/bin/python | 2 +- virtual/bin/python3 | 2 +- virtual/bin/python3.6 | 1 + virtual/bin/python3.8 | 1 - virtual/pyvenv.cfg | 2 +- 10 files changed, 214 insertions(+), 4 deletions(-) create mode 100644 Login/__pycache__/wsgi.cpython-38.pyc create mode 100644 virtual/bin/activate create mode 100644 virtual/bin/activate.csh create mode 100644 virtual/bin/activate.fish create mode 120000 virtual/bin/python3.6 delete mode 120000 virtual/bin/python3.8 diff --git a/Login/__pycache__/wsgi.cpython-38.pyc b/Login/__pycache__/wsgi.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..100e4afa6ba28d750d4670c800b760c3c7259cd0 GIT binary patch literal 540 zcmYjO!EO^V5cN7~6Bb%=s5tu?iLOE15JDiOje<%lkye#**){9Q#;Mn{TDvLjwLbz! zuKWv^y>j9gI5E3XrC9Q_#$&(tX6EwXAZE0F@h{m!#MqxU*j;@JKG62B2sB$T9cgZ( zMMP)M^0K$+MGT^K|NEZq>%AYGqTT~r>}x(}qy78e@zs1X6*;=4DZ~_snWvx6$Cqa(_lI5W ziH8u3EBt8C4APVgq-n#^H_x{=lAPQpEose3rWt_Sm>OLZ(?<@4. +# Ported to Python 3.3 venv by Andrew Svetlov + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV "/home/karis/Desktop/POS-System/virtual" + +set _OLD_VIRTUAL_PATH="$PATH" +setenv PATH "$VIRTUAL_ENV/bin:$PATH" + + +set _OLD_VIRTUAL_PROMPT="$prompt" + +if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then + if ("virtual" != "") then + set env_name = "virtual" + else + if (`basename "VIRTUAL_ENV"` == "__") then + # special case for Aspen magic directories + # see http://www.zetadev.com/software/aspen/ + set env_name = `basename \`dirname "$VIRTUAL_ENV"\`` + else + set env_name = `basename "$VIRTUAL_ENV"` + endif + endif + set prompt = "[$env_name] $prompt" + unset env_name +endif + +alias pydoc python -m pydoc + +rehash diff --git a/virtual/bin/activate.fish b/virtual/bin/activate.fish new file mode 100644 index 0000000..6369c01 --- /dev/null +++ b/virtual/bin/activate.fish @@ -0,0 +1,75 @@ +# This file must be used with ". bin/activate.fish" *from fish* (http://fishshell.org) +# you cannot run it directly + +function deactivate -d "Exit virtualenv and return to normal shell environment" + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + set -gx PATH $_OLD_VIRTUAL_PATH + set -e _OLD_VIRTUAL_PATH + end + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + functions -e fish_prompt + set -e _OLD_FISH_PROMPT_OVERRIDE + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + end + + set -e VIRTUAL_ENV + if test "$argv[1]" != "nondestructive" + # Self destruct! + functions -e deactivate + end +end + +# unset irrelevant variables +deactivate nondestructive + +set -gx VIRTUAL_ENV "/home/karis/Desktop/POS-System/virtual" + +set -gx _OLD_VIRTUAL_PATH $PATH +set -gx PATH "$VIRTUAL_ENV/bin" $PATH + +# unset PYTHONHOME if set +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # fish uses a function instead of an env var to generate the prompt. + + # save the current fish_prompt function as the function _old_fish_prompt + functions -c fish_prompt _old_fish_prompt + + # with the original prompt function renamed, we can override with our own. + function fish_prompt + # Save the return status of the last command + set -l old_status $status + + # Prompt override? + if test -n "(virtual) " + printf "%s%s" "(virtual) " (set_color normal) + else + # ...Otherwise, prepend env + set -l _checkbase (basename "$VIRTUAL_ENV") + if test $_checkbase = "__" + # special case for Aspen magic directories + # see http://www.zetadev.com/software/aspen/ + printf "%s[%s]%s " (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal) + else + printf "%s(%s)%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal) + end + end + + # Restore the return status of the previous command. + echo "exit $old_status" | . + _old_fish_prompt + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" +end diff --git a/virtual/bin/python b/virtual/bin/python index 4e58b60..039b719 120000 --- a/virtual/bin/python +++ b/virtual/bin/python @@ -1 +1 @@ -python3.8 \ No newline at end of file +python3.6 \ No newline at end of file diff --git a/virtual/bin/python3 b/virtual/bin/python3 index 4e58b60..039b719 120000 --- a/virtual/bin/python3 +++ b/virtual/bin/python3 @@ -1 +1 @@ -python3.8 \ No newline at end of file +python3.6 \ No newline at end of file diff --git a/virtual/bin/python3.6 b/virtual/bin/python3.6 new file mode 120000 index 0000000..6270541 --- /dev/null +++ b/virtual/bin/python3.6 @@ -0,0 +1 @@ +/usr/bin/python3.6 \ No newline at end of file diff --git a/virtual/bin/python3.8 b/virtual/bin/python3.8 deleted file mode 120000 index 02a1389..0000000 --- a/virtual/bin/python3.8 +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/python3.8 \ No newline at end of file diff --git a/virtual/pyvenv.cfg b/virtual/pyvenv.cfg index 8dbc2ba..77a4fd7 100644 --- a/virtual/pyvenv.cfg +++ b/virtual/pyvenv.cfg @@ -1,3 +1,3 @@ home = /usr/bin include-system-site-packages = false -version = 3.8.5 +version = 3.6.13 From 487adbc1de8f5a4193b90b94ba8f5a1c5a2f2d6c Mon Sep 17 00:00:00 2001 From: zecollokaris Date: Wed, 17 Mar 2021 17:16:09 +0300 Subject: [PATCH 5/9] installed django registration redux --- Login/__pycache__/settings.cpython-38.pyc | Bin 2344 -> 2356 bytes Login/settings.py | 1 + 2 files changed, 1 insertion(+) diff --git a/Login/__pycache__/settings.cpython-38.pyc b/Login/__pycache__/settings.cpython-38.pyc index 9556f06d33b79312157807521ff62a48805aa209..75ae9631374965c444a4d02393b43483b1a0a280 100644 GIT binary patch delta 61 zcmZ1>v_*(Fl$V!_0SJ`&gA$T9@@6yf$`_@kXBL+fC6;97=WVWJa$@6WVq%2D?<~BN IPjSQn0J|R!A^-pY delta 53 zcmdlYv_gnCl$V!_0SMALgA)8V@@6wJ3QtyK72Z69NuQ0MkqH5Ru<%U2#t{bq5upkF diff --git a/Login/settings.py b/Login/settings.py index d6dc583..1c73b06 100644 --- a/Login/settings.py +++ b/Login/settings.py @@ -32,6 +32,7 @@ INSTALLED_APPS = [ 'django.contrib.admin', + 'registration' 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', From 61fdd4378ac12854f7c8daa0aa0c141e775b794b Mon Sep 17 00:00:00 2001 From: zecollokaris Date: Wed, 17 Mar 2021 23:52:57 +0300 Subject: [PATCH 6/9] added login and registration view function --- Login/__pycache__/settings.cpython-38.pyc | Bin 2356 -> 2504 bytes Login/__pycache__/urls.cpython-38.pyc | Bin 916 -> 411 bytes Login/settings.py | 10 ++++++- Login/urls.py | 21 +++++-------- Success/__pycache__/__init__.cpython-38.pyc | Bin 0 -> 143 bytes Success/__pycache__/urls.cpython-38.pyc | Bin 0 -> 486 bytes Success/__pycache__/views.cpython-38.pyc | Bin 0 -> 527 bytes Success/models.py | 22 -------------- Success/urls.py | 16 ++++++++-- Success/views.py | 31 +++++++++++++++++++- 10 files changed, 60 insertions(+), 40 deletions(-) create mode 100644 Success/__pycache__/__init__.cpython-38.pyc create mode 100644 Success/__pycache__/urls.cpython-38.pyc create mode 100644 Success/__pycache__/views.cpython-38.pyc diff --git a/Login/__pycache__/settings.cpython-38.pyc b/Login/__pycache__/settings.cpython-38.pyc index 75ae9631374965c444a4d02393b43483b1a0a280..769e346c9c1e287a53f834a7206ea968afecbfb0 100644 GIT binary patch delta 414 zcmZWkJx{_=6z#*OCD=l3l@C!71r$-yU!V=3X<|xJiqSh*Ne*ecXaYMR4h;w87v};B`hO% zCo+m5kAm3AV`ZePBP|BZ=cHkcrcfdsoD9Kf!SoE)DUJY&E3f_QU5D z8}A0acDLUO#WhkoZ9nMtI;~!Ces*E>v*X6&ZRnY616jN?U_!oG*)FCZk7b1&QNpZL z>P_4A%!+Frnyyv1y{dWKpoCM~w;HbVJ2IPY-8-o7TQ%uAxPA`YP5TC!{zdRd`EaSJw{P5m*T!%&j z0YWqpAvP{AqQySiMu5;k7fV>iilIVcbw)WmPTeg#8d+s}P z-z}se4zb5gWE_DwwzMp5?6ccJekQVmisXZg2e>Xqx4rVp6yr%bm=rgo>P3B!bCPwd oC)by?XHh2h_cED&dB^=byOQrap-T=aT2N9c%inyHo(^jlKX_R>xBvhE diff --git a/Login/__pycache__/urls.cpython-38.pyc b/Login/__pycache__/urls.cpython-38.pyc index 7aa436bd92ec865790f37891cf92a0e6bf186fdb..df167dcd4ea42f75c6fb5c31cc830a32c0872aa6 100644 GIT binary patch delta 285 zcmYj~y-ve06ou{BvD=VzKtdT?#wb$Z5fDfWsA6d8k|l)L1V@RD@&i&9hCD$PHr^~N z6AyvJ4PxL(=juD>4(FYJkZ|vL4g#H=Z|`p~LZ4IkFB`%IxV}4t%Qt}qE$os-3?pE> zASI7DMv@CASw73>y#>rA6|)}qR%S(xnD0>FbpFOY<`AR@uWTSu%G*ceo~(#|uD8T%ze z3GolOz_Z&*5faiY<;hN-zxRFLd$~P2N&;BlqnpLACiu#X(W_ph|87I!b6~@X2dXL7@H*s z*4o;}%rK^^G&$W6S*b>=4J&P4DuJ2A&+}7kRl`ezT{4F91}ASm69HIemRz>7bnLce zJ?LqUUQ>#QL|imV+ZjSDtppPH1!_v_vFjebBbpn0!OR^D8NTonc;bHmyp0YeZ|=MC3!!LRv$GH& P%osxaWD-sWlRtj}N>dwu diff --git a/Login/settings.py b/Login/settings.py index 1c73b06..654810c 100644 --- a/Login/settings.py +++ b/Login/settings.py @@ -31,8 +31,9 @@ # Application definition INSTALLED_APPS = [ + 'django.contrib.sites', 'django.contrib.admin', - 'registration' + 'registration', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -123,3 +124,10 @@ # https://docs.djangoproject.com/en/3.1/howto/static-files/ STATIC_URL = '/static/' + + + +ACCOUNT_ACTIVATION_DAYS = 7 # One-Week Activation Expiry +REGISTRATION_AUTO_LOGIN = True # Automatically Log the User In. +SITE_ID = 1 +LOGIN_REDIRECT_URL = '/' \ No newline at end of file diff --git a/Login/urls.py b/Login/urls.py index 2ff98ad..cdeec9b 100644 --- a/Login/urls.py +++ b/Login/urls.py @@ -1,21 +1,14 @@ -"""Login URL Configuration +"""Login URL Configuration""" + +# Imports Views For Success to Render Content. +from Success import views +from django.urls import include -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/3.1/topics/http/urls/ -Examples: -Function views - 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: path('', views.home, name='home') -Class-based views - 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') -Including another URLconf - 1. Import the include() function: from django.urls import include, path - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) -""" from django.contrib import admin from django.urls import path urlpatterns = [ path('admin/', admin.site.urls), + # Includes Success url patterns + path('', include('Success.urls')), ] diff --git a/Success/__pycache__/__init__.cpython-38.pyc b/Success/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..09e318525506059e91d86b470a93fa9ce9276962 GIT binary patch literal 143 zcmWIL<>g`kf=x_82_X70h(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6v6KO;XkRX;ni zD6?4KCAB!aB)>r4B`Yy6Jzv)+KRq)~Ke#kGIkmW0KR!M)FS8^*Uaz3?7Kcr4eoARh MsvXF*&p^xo0MY9p00000 literal 0 HcmV?d00001 diff --git a/Success/__pycache__/urls.cpython-38.pyc b/Success/__pycache__/urls.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e4a24b667d8adb6ec48419567b4220ae2916e60 GIT binary patch literal 486 zcmYjNyHdk25S09motRMZ1r#o@p=TJ1lnezK8dVreag<1MMsj$31RuiJ(5t1Qr=sHI zWG0bDH+!qSyOka%lN7-^zj}E3@(}uV$?*yyxrJjE5GbNpAc+Z<9`UftJ>koM1OxU( zC?gULI1sVZ$b=+A9*U7nNjl(2WO7W#7_o%LELcrwLPsBdi%Cw?IV!Rrn1u?@`dck* z%vB?{loi;9FPyy^2Wl$0Dm?9j&<2~jUjiGMzV3MgC^4+>xoV9?Hsp%3Hy{I5OLkwJ zkSSf&s_n|AQ;QNt7!5B+yI%2p+ceA=9k|ZLd?J17E?oG#td^Z*)w8>$cdgbYf;!0i5AQxg9~P_^0dN7WLs%GMI7bB@VvHDJ^bHLO z^Oz4iWsL!92cIy7mbh*xUNWu{Z1HbV*gfb=XuS^$!*k5Y3=2Fb2F(zoGqRvS13wJm9^Zab)fiD#kEmZ zvknqj8a^>gqyoTSCs77m(I{3zM_sN*MvkNIV_c^4_*$l-jQ*IP1%J_<@oVinjUD(} zyF0@kA&7i?RBgc7zo<60jq9S?VHXcC2!tcO>0Y0w0-VK0$TG^U+?sW);76=%I Date: Wed, 17 Mar 2021 23:59:00 +0300 Subject: [PATCH 7/9] added registration templates --- Success/templates/registration/activate.html | 18 +++++ .../registration/activation_complete.html | 22 ++++++ .../activation_complete_admin_pending.html | 22 ++++++ .../registration/activation_email.html | 72 +++++++++++++++++++ .../registration/activation_email.txt | 52 ++++++++++++++ .../registration/activation_email_subject.txt | 28 ++++++++ .../templates/registration/admin_approve.html | 18 +++++ .../registration/admin_approve_complete.html | 33 +++++++++ .../admin_approve_complete_email.html | 27 +++++++ .../admin_approve_complete_email.txt | 13 ++++ .../admin_approve_complete_email_subject.txt | 21 ++++++ .../registration/admin_approve_email.html | 60 ++++++++++++++++ .../registration/admin_approve_email.txt | 10 +++ .../admin_approve_email_subject.txt | 1 + Success/templates/registration/login.html | 45 ++++++++++++ Success/templates/registration/logout.html | 8 +++ .../registration/password_change_done.html | 11 +++ .../registration/password_change_form.html | 15 ++++ .../registration/password_reset_complete.html | 15 ++++ .../registration/password_reset_confirm.html | 26 +++++++ .../registration/password_reset_done.html | 16 +++++ .../registration/password_reset_email.html | 27 +++++++ .../registration/password_reset_form.html | 20 ++++++ .../registration/registration_base.html | 1 + .../registration/registration_closed.html | 8 +++ .../registration/registration_complete.html | 18 +++++ .../registration/registration_form.html | 25 +++++++ .../resend_activation_complete.html | 22 ++++++ .../registration/resend_activation_form.html | 25 +++++++ 29 files changed, 679 insertions(+) create mode 100755 Success/templates/registration/activate.html create mode 100755 Success/templates/registration/activation_complete.html create mode 100644 Success/templates/registration/activation_complete_admin_pending.html create mode 100644 Success/templates/registration/activation_email.html create mode 100644 Success/templates/registration/activation_email.txt create mode 100644 Success/templates/registration/activation_email_subject.txt create mode 100644 Success/templates/registration/admin_approve.html create mode 100644 Success/templates/registration/admin_approve_complete.html create mode 100644 Success/templates/registration/admin_approve_complete_email.html create mode 100644 Success/templates/registration/admin_approve_complete_email.txt create mode 100644 Success/templates/registration/admin_approve_complete_email_subject.txt create mode 100644 Success/templates/registration/admin_approve_email.html create mode 100644 Success/templates/registration/admin_approve_email.txt create mode 100644 Success/templates/registration/admin_approve_email_subject.txt create mode 100755 Success/templates/registration/login.html create mode 100755 Success/templates/registration/logout.html create mode 100755 Success/templates/registration/password_change_done.html create mode 100755 Success/templates/registration/password_change_form.html create mode 100755 Success/templates/registration/password_reset_complete.html create mode 100755 Success/templates/registration/password_reset_confirm.html create mode 100755 Success/templates/registration/password_reset_done.html create mode 100755 Success/templates/registration/password_reset_email.html create mode 100755 Success/templates/registration/password_reset_form.html create mode 100755 Success/templates/registration/registration_base.html create mode 100755 Success/templates/registration/registration_closed.html create mode 100755 Success/templates/registration/registration_complete.html create mode 100755 Success/templates/registration/registration_form.html create mode 100644 Success/templates/registration/resend_activation_complete.html create mode 100644 Success/templates/registration/resend_activation_form.html diff --git a/Success/templates/registration/activate.html b/Success/templates/registration/activate.html new file mode 100755 index 0000000..3a7a136 --- /dev/null +++ b/Success/templates/registration/activate.html @@ -0,0 +1,18 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Activation Failure" %}{% endblock %} + +{% block content %} +

{% trans "Account activation failed." %}

+{% endblock %} + + +{% comment %} +**registration/activate.html** + +Used if account activation fails. With the default setup, has the following context: + +``activation_key`` + The activation key used during the activation attempt. +{% endcomment %} diff --git a/Success/templates/registration/activation_complete.html b/Success/templates/registration/activation_complete.html new file mode 100755 index 0000000..b66e0d6 --- /dev/null +++ b/Success/templates/registration/activation_complete.html @@ -0,0 +1,22 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Account Activated" %}{% endblock %} + +{% block content %} +

+ {% trans "Your account is now activated." %} + {% if not user.is_authenticated %} + {% trans "You can log in." %} + {% endif %} +

+{% endblock %} + + +{% comment %} +**registration/activation_complete.html** + +Used after successful account activation. This template has no context +variables of its own, and should simply inform the user that their +account is now active. +{% endcomment %} diff --git a/Success/templates/registration/activation_complete_admin_pending.html b/Success/templates/registration/activation_complete_admin_pending.html new file mode 100644 index 0000000..25357ca --- /dev/null +++ b/Success/templates/registration/activation_complete_admin_pending.html @@ -0,0 +1,22 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Account Activated" %}{% endblock %} + +{% block content %} +

+ {% trans "Your account is now activated." %} + {% if not user.is_authenticated %} + {% trans "Once a site administrator activates your account you can login." %} + {% endif %} +

+{% endblock %} + + +{% comment %} +**registration/activation_complete.html** + +Used after successful account activation. This template has no context +variables of its own, and should simply inform the user that their +account is now active. +{% endcomment %} diff --git a/Success/templates/registration/activation_email.html b/Success/templates/registration/activation_email.html new file mode 100644 index 0000000..cee8f9d --- /dev/null +++ b/Success/templates/registration/activation_email.html @@ -0,0 +1,72 @@ +{% load i18n %} + + + + + {{ site.name }} {% trans "registration" %} + + + +

+ {% blocktrans with site_name=site.name %} + You (or someone pretending to be you) have asked to register an account at + {{ site_name }}. If this wasn't you, please ignore this email + and your address will be removed from our records. + {% endblocktrans %} +

+

+ {% blocktrans %} + To activate this account, please click the following link within the next + {{ expiration_days }} days: + {% endblocktrans %} +

+ +

+ + {{site.domain}}{% url 'registration_activate' activation_key %} + +

+

+ {% blocktrans with site_name=site.name %} + Sincerely, + {{ site_name }} Management + {% endblocktrans %} +

+ + + + + +{% comment %} +**registration/activation_email.html** + +Used to generate the html body of the activation email. Should display a +link the user can click to activate the account. This template has the +following context: + +``activation_key`` + The activation key for the new account. + +``expiration_days`` + The number of days remaining during which the account may be + activated. + +``site`` + An object representing the site on which the user registered; + depending on whether ``django.contrib.sites`` is installed, this + may be an instance of either ``django.contrib.sites.models.Site`` + (if the sites application is installed) or + ``django.contrib.sites.requests.RequestSite`` (if not). Consult `the + documentation for the Django sites framework + `_ for + details regarding these objects' interfaces. + +``user`` + The new user account + +``request`` + ``HttpRequest`` instance for better flexibility. + For example it can be used to compute absolute register URL: + + {{ request.scheme }}://{{ request.get_host }}{% url 'registration_activate' activation_key %} +{% endcomment %} diff --git a/Success/templates/registration/activation_email.txt b/Success/templates/registration/activation_email.txt new file mode 100644 index 0000000..303d7ed --- /dev/null +++ b/Success/templates/registration/activation_email.txt @@ -0,0 +1,52 @@ +{% load i18n %} +{% blocktrans with site_name=site.name %} +You (or someone pretending to be you) have asked to register an account at +{{ site_name }}. If this wasn't you, please ignore this email +and your address will be removed from our records. +{% endblocktrans %} +{% blocktrans %} +To activate this account, please click the following link within the next +{{ expiration_days }} days: +{% endblocktrans %} + +http://{{site.domain}}{% url 'registration_activate' activation_key %} + +{% blocktrans with site_name=site.name %} +Sincerely, +{{ site_name }} Management +{% endblocktrans %} + + +{% comment %} +**registration/activation_email.txt** + +Used to generate the text body of the activation email. Should display a +link the user can click to activate the account. This template has the +following context: + +``activation_key`` + The activation key for the new account. + +``expiration_days`` + The number of days remaining during which the account may be + activated. + +``site`` + An object representing the site on which the user registered; + depending on whether ``django.contrib.sites`` is installed, this + may be an instance of either ``django.contrib.sites.models.Site`` + (if the sites application is installed) or + ``django.contrib.sites.requests.RequestSite`` (if not). Consult `the + documentation for the Django sites framework + `_ for + details regarding these objects' interfaces. + +``user`` + The new user account + +``request`` + ``HttpRequest`` instance for better flexibility. + For example it can be used to compute absolute register URL: + + {{ request.scheme }}://{{ request.get_host }}{% url 'registration_activate' activation_key %} +{% endcomment %} diff --git a/Success/templates/registration/activation_email_subject.txt b/Success/templates/registration/activation_email_subject.txt new file mode 100644 index 0000000..da0ddeb --- /dev/null +++ b/Success/templates/registration/activation_email_subject.txt @@ -0,0 +1,28 @@ +{% load i18n %}{% trans "Account activation on" %} {{ site.name }} + + +{% comment %} +**registration/activation_email_subject.txt** + +Used to generate the subject line of the activation email. Because the +subject line of an email must be a single line of text, any output +from this template will be forcibly condensed to a single line before +being used. This template has the following context: + +``activation_key`` + The activation key for the new account. + +``expiration_days`` + The number of days remaining during which the account may be + activated. + +``site`` + An object representing the site on which the user registered; + depending on whether ``django.contrib.sites`` is installed, this + may be an instance of either ``django.contrib.sites.models.Site`` + (if the sites application is installed) or + ``django.contrib.sites.requests.RequestSite`` (if not). Consult `the + documentation for the Django sites framework + `_ for + details regarding these objects' interfaces. +{% endcomment %} diff --git a/Success/templates/registration/admin_approve.html b/Success/templates/registration/admin_approve.html new file mode 100644 index 0000000..487c1fb --- /dev/null +++ b/Success/templates/registration/admin_approve.html @@ -0,0 +1,18 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Approval Failure" %}{% endblock %} + +{% block content %} +

{% trans "Account Approval failed." %}

+{% endblock %} + + +{% comment %} +**registration/admin_approve.html** + +Used if account activation fails. With the default setup, has the following context: + +``activation_key`` + The activation key used during the activation attempt. +{% endcomment %} diff --git a/Success/templates/registration/admin_approve_complete.html b/Success/templates/registration/admin_approve_complete.html new file mode 100644 index 0000000..f4ad870 --- /dev/null +++ b/Success/templates/registration/admin_approve_complete.html @@ -0,0 +1,33 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Account Approved" %}{% endblock %} + +{% block content %} +

+ {% trans "The user's account is now approved." %} +

+{% endblock %} + + +{% comment %} +**registration/admin_approve_complete.html** + +Used to generate the html body of the admin activation email. Should display a +link for an admin to approve activation of the account. This template has the +following context: + +``site`` + An object representing the site on which the user registered; + depending on whether ``django.contrib.sites`` is installed, this + may be an instance of either ``django.contrib.sites.models.Site`` + (if the sites application is installed) or + ``django.contrib.sites.requests.RequestSite`` (if not). Consult `the + documentation for the Django sites framework + `_ for + details regarding these objects' interfaces. + +``user`` + The new user account + +{% endcomment %} diff --git a/Success/templates/registration/admin_approve_complete_email.html b/Success/templates/registration/admin_approve_complete_email.html new file mode 100644 index 0000000..55368af --- /dev/null +++ b/Success/templates/registration/admin_approve_complete_email.html @@ -0,0 +1,27 @@ +{% load i18n %} + + + + + {{ site.name }} {% trans "admin approval" %} + + + +

+ {% blocktrans %} + Your account is now approved. You can + {% endblocktrans %} + {% trans "log in." %} +

+ + + + + +{% comment %} +**registration/admin_approve_complete_email.html** + +Used after successful account activation. This template has no context +variables of its own, and should simply inform the user that their +account is now active. +{% endcomment %} diff --git a/Success/templates/registration/admin_approve_complete_email.txt b/Success/templates/registration/admin_approve_complete_email.txt new file mode 100644 index 0000000..f0fada3 --- /dev/null +++ b/Success/templates/registration/admin_approve_complete_email.txt @@ -0,0 +1,13 @@ +{% load i18n %} +{% blocktrans %} +Your account is now approved. You can log in using the following link +{% endblocktrans %} +http://{{site.domain}}{% url 'auth_login' %} + +{% comment %} +**registration/admin_approve_complete_email.txt** + +Used after successful account activation. This template has no context +variables of its own, and should simply inform the user that their +account is now active. +{% endcomment %} diff --git a/Success/templates/registration/admin_approve_complete_email_subject.txt b/Success/templates/registration/admin_approve_complete_email_subject.txt new file mode 100644 index 0000000..6dac1db --- /dev/null +++ b/Success/templates/registration/admin_approve_complete_email_subject.txt @@ -0,0 +1,21 @@ +{% load i18n %}{% trans "Account activation on" %} {{ site.name }} + + +{% comment %} +**registration/admin_approve_complete_email_subject.txt** + +Used to generate the subject line of the admin approval complete email. Because +the subject line of an email must be a single line of text, any output +from this template will be forcibly condensed to a single line before +being used. This template has the following context: + +``site`` + An object representing the site on which the user registered; + depending on whether ``django.contrib.sites`` is installed, this + may be an instance of either ``django.contrib.sites.models.Site`` + (if the sites application is installed) or + ``django.contrib.sites.requests.RequestSite`` (if not). Consult `the + documentation for the Django sites framework + `_ for + details regarding these objects' interfaces. +{% endcomment %} diff --git a/Success/templates/registration/admin_approve_email.html b/Success/templates/registration/admin_approve_email.html new file mode 100644 index 0000000..5a4e36b --- /dev/null +++ b/Success/templates/registration/admin_approve_email.html @@ -0,0 +1,60 @@ +{% load i18n %} + + + + + {{ site.name }} {% trans "registration" %} + + + +

+ {% blocktrans with site_name=site.name %} + The following user ({{ user }}) has asked to register an account at + {{ site_name }}. + {% endblocktrans %} +

+

+ {% blocktrans %} + To approve this, please + {% endblocktrans %} + {% trans "click here" %}. +

+

+ {% blocktrans with site_name=site.name %} + Sincerely, + {{ site_name }} Management + {% endblocktrans %} +

+ + + + +{% comment %} +**registration/admin_approve_email.html** + +Used to generate the html body of the admin activation email. Should display a +link for an admin to approve activation of the account. This template has the +following context: + +``profile_id`` + The id of the registration profile requesting approval + +``site`` + An object representing the site on which the user registered; + depending on whether ``django.contrib.sites`` is installed, this + may be an instance of either ``django.contrib.sites.models.Site`` + (if the sites application is installed) or + ``django.contrib.sites.requests.RequestSite`` (if not). Consult `the + documentation for the Django sites framework + `_ for + details regarding these objects' interfaces. + +``user`` + The new user account + +``request`` + ``HttpRequest`` instance for better flexibility. + For example it can be used to compute absolute approval URL: + + {{ request.scheme }}://{{ request.get_host }}{% url 'registration_admin_approve' profile_id %} +{% endcomment %} diff --git a/Success/templates/registration/admin_approve_email.txt b/Success/templates/registration/admin_approve_email.txt new file mode 100644 index 0000000..19ac274 --- /dev/null +++ b/Success/templates/registration/admin_approve_email.txt @@ -0,0 +1,10 @@ +{% load i18n %} +{% blocktrans with site_name=site.name %} +The following user ({{ user }}) has asked to register an account at +{{ site_name }}. +{% endblocktrans %} +{% blocktrans %} +To approve this, please click the following link. +{% endblocktrans %} + +http://{{site.domain}}{% url 'registration_admin_approve' profile_id %} diff --git a/Success/templates/registration/admin_approve_email_subject.txt b/Success/templates/registration/admin_approve_email_subject.txt new file mode 100644 index 0000000..3cd2bd9 --- /dev/null +++ b/Success/templates/registration/admin_approve_email_subject.txt @@ -0,0 +1 @@ +{% load i18n %}{% trans "Account approval on" %} {{ site.name }} diff --git a/Success/templates/registration/login.html b/Success/templates/registration/login.html new file mode 100755 index 0000000..2e029ba --- /dev/null +++ b/Success/templates/registration/login.html @@ -0,0 +1,45 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Log in" %}{% endblock %} + +{% block content %} +
+ {% csrf_token %} + {{ form.as_p }} + + +
+ +

{% trans "Forgot your password?" %} {% trans "Reset it" %}.

+

{% trans "Not a member?" %} {% trans "Register" %}.

+{% endblock %} + + +{% comment %} +**registration/login.html** + +It's your responsibility to provide the login form in a template called +registration/login.html by default. This template gets passed four +template context variables: + +``form`` + A Form object representing the login form. See the forms + documentation for more on Form objects. + +``next`` + The URL to redirect to after successful login. This may contain a + query string, too. + +``site`` + The current Site, according to the SITE_ID setting. If you don't + have the site framework installed, this will be set to an instance + of RequestSite, which derives the site name and domain from the + current HttpRequest. + +``site_name`` + An alias for site.name. If you don't have the site framework + installed, this will be set to the value of + request.META['SERVER_NAME']. For more on sites, see The + "sites" framework. +{% endcomment %} diff --git a/Success/templates/registration/logout.html b/Success/templates/registration/logout.html new file mode 100755 index 0000000..e93d840 --- /dev/null +++ b/Success/templates/registration/logout.html @@ -0,0 +1,8 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Logged out" %}{% endblock %} + +{% block content %} +

{% trans "Successfully logged out" %}.

+{% endblock %} diff --git a/Success/templates/registration/password_change_done.html b/Success/templates/registration/password_change_done.html new file mode 100755 index 0000000..f886aa4 --- /dev/null +++ b/Success/templates/registration/password_change_done.html @@ -0,0 +1,11 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Password changed" %}{% endblock %} + +{% block content %} +

{% trans "Password successfully changed!" %}

+{% endblock %} + + +{# This is used by django.contrib.auth #} diff --git a/Success/templates/registration/password_change_form.html b/Success/templates/registration/password_change_form.html new file mode 100755 index 0000000..6be761f --- /dev/null +++ b/Success/templates/registration/password_change_form.html @@ -0,0 +1,15 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Change password" %}{% endblock %} + +{% block content %} +
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock %} + + +{# This is used by django.contrib.auth #} diff --git a/Success/templates/registration/password_reset_complete.html b/Success/templates/registration/password_reset_complete.html new file mode 100755 index 0000000..00b755a --- /dev/null +++ b/Success/templates/registration/password_reset_complete.html @@ -0,0 +1,15 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Password reset complete" %}{% endblock %} + +{% block content %} +

+ {% trans "Your password has been reset!" %} + {% blocktrans %}You may now log in{% endblocktrans %}. + +

+{% endblock %} + + +{# This is used by django.contrib.auth #} diff --git a/Success/templates/registration/password_reset_confirm.html b/Success/templates/registration/password_reset_confirm.html new file mode 100755 index 0000000..aeafc50 --- /dev/null +++ b/Success/templates/registration/password_reset_confirm.html @@ -0,0 +1,26 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block meta %} + + +{% endblock %} + +{% block title %}{% trans "Confirm password reset" %}{% endblock %} + +{% block content %} +{% if validlink %} +

{% trans "Enter your new password below to reset your password:" %}

+
+ {% csrf_token %} + {{ form.as_p }} + +
+{% else %} + Password reset unsuccessful. Please try again. +{% endif %} +{% endblock %} + + +{# This is used by django.contrib.auth #} diff --git a/Success/templates/registration/password_reset_done.html b/Success/templates/registration/password_reset_done.html new file mode 100755 index 0000000..8624a51 --- /dev/null +++ b/Success/templates/registration/password_reset_done.html @@ -0,0 +1,16 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Password reset" %}{% endblock %} + +{% block content %} +

+ {% blocktrans %} + We have sent you an email with a link to reset your password. Please check + your email and click the link to continue. + {% endblocktrans %} +

+{% endblock %} + + +{# This is used by django.contrib.auth #} diff --git a/Success/templates/registration/password_reset_email.html b/Success/templates/registration/password_reset_email.html new file mode 100755 index 0000000..8653551 --- /dev/null +++ b/Success/templates/registration/password_reset_email.html @@ -0,0 +1,27 @@ +{% load i18n %} + +{% blocktrans %}Greetings{% endblocktrans %} {% if user.get_full_name %}{{ user.get_full_name }}{% else %}{{ user }}{% endif %}, + +{% blocktrans %} +You are receiving this email because you (or someone pretending to be you) +requested that your password be reset on the {{ domain }} site. If you do not +wish to reset your password, please ignore this message. +{% endblocktrans %} + +{% blocktrans %} +To reset your password, please click the following link, or copy and paste it +into your web browser: +{% endblocktrans %} + + + {{ protocol }}://{{ domain }}{% url 'auth_password_reset_confirm' uid token %} + + +{% blocktrans %}Your username, in case you've forgotten:{% endblocktrans %} {{ user.get_username }} + + +{% blocktrans %}Best regards{% endblocktrans %}, +{{ site_name }} {% blocktrans %}Management{% endblocktrans %} + + +{# This is used by django.contrib.auth #} diff --git a/Success/templates/registration/password_reset_form.html b/Success/templates/registration/password_reset_form.html new file mode 100755 index 0000000..27ed5c4 --- /dev/null +++ b/Success/templates/registration/password_reset_form.html @@ -0,0 +1,20 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Reset password" %}{% endblock %} + +{% block content %} +

+ {% blocktrans %} + Forgot your password? Enter your email in the form below and we'll send you instructions for creating a new one. + {% endblocktrans %} +

+
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock %} + + +{# This is used by django.contrib.auth #} diff --git a/Success/templates/registration/registration_base.html b/Success/templates/registration/registration_base.html new file mode 100755 index 0000000..94d9808 --- /dev/null +++ b/Success/templates/registration/registration_base.html @@ -0,0 +1 @@ +{% extends "base.html" %} diff --git a/Success/templates/registration/registration_closed.html b/Success/templates/registration/registration_closed.html new file mode 100755 index 0000000..94daff1 --- /dev/null +++ b/Success/templates/registration/registration_closed.html @@ -0,0 +1,8 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Registration is closed" %}{% endblock %} + +{% block content %} +

{% trans "Sorry, but registration is closed at this moment. Come back later." %}

+{% endblock %} diff --git a/Success/templates/registration/registration_complete.html b/Success/templates/registration/registration_complete.html new file mode 100755 index 0000000..f0d0596 --- /dev/null +++ b/Success/templates/registration/registration_complete.html @@ -0,0 +1,18 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Activation email sent" %}{% endblock %} + +{% block content %} +

{% trans "Please check your email to complete the registration process." %}

+{% endblock %} + + +{% comment %} +**registration/registration_complete.html** + +Used after successful completion of the registration form. This +template has no context variables of its own, and should simply inform +the user that an email containing account-activation information has +been sent. +{% endcomment %} diff --git a/Success/templates/registration/registration_form.html b/Success/templates/registration/registration_form.html new file mode 100755 index 0000000..42b4051 --- /dev/null +++ b/Success/templates/registration/registration_form.html @@ -0,0 +1,25 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Register for an account" %}{% endblock %} + +{% block content %} +
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock %} + + +{% comment %} +**registration/registration_form.html** +Used to show the form users will fill out to register. By default, has +the following context: + +``form`` + The registration form. This will be an instance of some subclass + of ``django.forms.Form``; consult `Django's forms documentation + `_ for + information on how to display this in a template. +{% endcomment %} diff --git a/Success/templates/registration/resend_activation_complete.html b/Success/templates/registration/resend_activation_complete.html new file mode 100644 index 0000000..800e75e --- /dev/null +++ b/Success/templates/registration/resend_activation_complete.html @@ -0,0 +1,22 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Account Activation Resent" %}{% endblock %} + +{% block content %} +

+ {% blocktrans %} + We have sent an email to {{ email }} with further instructions. + {% endblocktrans %} +

+{% endblock %} + + +{% comment %} +**registration/resend_activation_complete.html** +Used after form for resending account activation is submitted. By default has +the following context: + +``email`` + The email address submitted in the resend activation form. +{% endcomment %} diff --git a/Success/templates/registration/resend_activation_form.html b/Success/templates/registration/resend_activation_form.html new file mode 100644 index 0000000..400384d --- /dev/null +++ b/Success/templates/registration/resend_activation_form.html @@ -0,0 +1,25 @@ +{% extends "registration/registration_base.html" %} +{% load i18n %} + +{% block title %}{% trans "Resend Activation Email" %}{% endblock %} + +{% block content %} +
+ {% csrf_token %} + {{ form.as_p }} + +
+{% endblock %} + + +{% comment %} +**registration/resend_activation_form.html** +Used to show the form users will fill out to resend the activation email. By +default, has the following context: + +``form`` + The registration form. This will be an instance of some subclass + of ``django.forms.Form``; consult `Django's forms documentation + `_ for + information on how to display this in a template. +{% endcomment %} From b6faf16a7b04b907f86032e1935ffa3b7b080ae3 Mon Sep 17 00:00:00 2001 From: zecollokaris Date: Thu, 18 Mar 2021 00:04:11 +0300 Subject: [PATCH 8/9] configured template directory in settings.py for app t locate templates --- Login/__pycache__/settings.cpython-38.pyc | Bin 2504 -> 2510 bytes Login/settings.py | 14 ++------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Login/__pycache__/settings.cpython-38.pyc b/Login/__pycache__/settings.cpython-38.pyc index 769e346c9c1e287a53f834a7206ea968afecbfb0..b14092f065d8843297b1d5cdbeb3001310b0eea3 100644 GIT binary patch delta 157 zcmX>hd`_4*l$V!_0SF%F1|=v?m?D3v#zF@+^XB1JMqDn&X)CY>ddF-3L` zOFCl|Uy585e~NsHLW*LFQi^hl${e6vl)%JY(wc%PT2VqN+EKzOEKwprEDFS8DLPT& zDY{V-K(=IxUX)adew6gaf0Nl5WhPHz?__4mFP<#Lag9wC=!PQI$=^5{7+EHla|Qwc DUsov; delta 132 zcmX>nd_tHvl$V!_0SNqrf)eB>^2#z^nW!Dll+G}*Ph6ZgMJ|djMLtC#MKMJwML9)f z4ofCu6#v9M(wYJ(T2X>2+EGF&EK$NhECR%$DLPSNDY{YOK(<7RUX)~tew5TE#>s4q e(vzpKcTQI1xXPviw5mvD@*j={MyAQNoPhvc1R+xZ diff --git a/Login/settings.py b/Login/settings.py index 654810c..cee56f8 100644 --- a/Login/settings.py +++ b/Login/settings.py @@ -1,15 +1,5 @@ -""" -Django settings for Login project. - -Generated by 'django-admin startproject' using Django 3.1.7. - -For more information on this file, see -https://docs.djangoproject.com/en/3.1/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/3.1/ref/settings/ -""" +import os from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. @@ -58,7 +48,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ From 72328c8ee8f68cf1d1fbbb1ea400b8378ef6dcc9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Mar 2021 13:40:27 +0000 Subject: [PATCH 9/9] Bump pillow from 7.0.0 to 7.1.0 Bumps [pillow](https://github.com/python-pillow/Pillow) from 7.0.0 to 7.1.0. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/7.0.0...7.1.0) Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 14787e2..92fdd87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -50,7 +50,7 @@ oauthlib==3.1.0 olefile==0.46 paramiko==2.6.0 pexpect==4.6.0 -Pillow==7.0.0 +Pillow==7.1.0 protobuf==3.6.1 psycopg2==2.8.6 pycairo==1.16.2