diff --git a/iaso/apps/auth/admin.py b/iaso/apps/auth/admin.py index ea5d68b..8c38f3f 100644 --- a/iaso/apps/auth/admin.py +++ b/iaso/apps/auth/admin.py @@ -1,3 +1,3 @@ -from django.contrib import admin - -# Register your models here. +from django.contrib import admin + +# Register your models here. diff --git a/iaso/apps/auth/apps.py b/iaso/apps/auth/apps.py index 4daf216..ca3cc8d 100644 --- a/iaso/apps/auth/apps.py +++ b/iaso/apps/auth/apps.py @@ -1,6 +1,6 @@ -from django.apps import AppConfig - - -class AuthConfig(AppConfig): - default_auto_field = "django.db.models.BigAutoField" - name = "iaso.apps.auth" +from django.apps import AppConfig + + +class AuthConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "iaso.apps.auth" diff --git a/iaso/apps/auth/models.py b/iaso/apps/auth/models.py index fd18c6e..71a8362 100644 --- a/iaso/apps/auth/models.py +++ b/iaso/apps/auth/models.py @@ -1,3 +1,3 @@ -from django.db import models - -# Create your models here. +from django.db import models + +# Create your models here. diff --git a/iaso/apps/auth/tests.py b/iaso/apps/auth/tests.py index de8bdc0..7ce503c 100644 --- a/iaso/apps/auth/tests.py +++ b/iaso/apps/auth/tests.py @@ -1,3 +1,3 @@ -from django.test import TestCase - -# Create your tests here. +from django.test import TestCase + +# Create your tests here. diff --git a/iaso/apps/auth/views.py b/iaso/apps/auth/views.py index abcda1c..30a6414 100644 --- a/iaso/apps/auth/views.py +++ b/iaso/apps/auth/views.py @@ -1,15 +1,15 @@ -from django.shortcuts import render -from ..dashboard.views import dashboard - -# Create your views here. -def index(request): - if request.user.is_authenticated: - return dashboard(request) - - form = None - - context = { - "form": form - } - +from django.shortcuts import render +from ..dashboard.views import dashboard + +# Create your views here. +def index(request): + if request.user.is_authenticated: + return dashboard(request) + + form = None + + context = { + "form": form + } + return render(request, 'auth/login.html', context=context) \ No newline at end of file diff --git a/iaso/apps/dashboard/admin.py b/iaso/apps/dashboard/admin.py index ea5d68b..8c38f3f 100644 --- a/iaso/apps/dashboard/admin.py +++ b/iaso/apps/dashboard/admin.py @@ -1,3 +1,3 @@ -from django.contrib import admin - -# Register your models here. +from django.contrib import admin + +# Register your models here. diff --git a/iaso/apps/dashboard/apps.py b/iaso/apps/dashboard/apps.py index f7691e5..66f8736 100644 --- a/iaso/apps/dashboard/apps.py +++ b/iaso/apps/dashboard/apps.py @@ -1,6 +1,6 @@ -from django.apps import AppConfig - - -class DashboardConfig(AppConfig): - default_auto_field = "django.db.models.BigAutoField" - name = "iaso.apps.dashboard" +from django.apps import AppConfig + + +class DashboardConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "iaso.apps.dashboard" diff --git a/iaso/apps/dashboard/models.py b/iaso/apps/dashboard/models.py index fd18c6e..71a8362 100644 --- a/iaso/apps/dashboard/models.py +++ b/iaso/apps/dashboard/models.py @@ -1,3 +1,3 @@ -from django.db import models - -# Create your models here. +from django.db import models + +# Create your models here. diff --git a/iaso/apps/dashboard/tests.py b/iaso/apps/dashboard/tests.py index de8bdc0..7ce503c 100644 --- a/iaso/apps/dashboard/tests.py +++ b/iaso/apps/dashboard/tests.py @@ -1,3 +1,3 @@ -from django.test import TestCase - -# Create your tests here. +from django.test import TestCase + +# Create your tests here. diff --git a/iaso/apps/dashboard/views.py b/iaso/apps/dashboard/views.py index 5f50972..386ebeb 100644 --- a/iaso/apps/dashboard/views.py +++ b/iaso/apps/dashboard/views.py @@ -1,9 +1,9 @@ -from django.shortcuts import render - -from django.contrib.auth.decorators import login_required - -# Create your views here. -@login_required -def dashboard(request): - return render(request, 'dashboard/dashboard.html') +from django.shortcuts import render + +from django.contrib.auth.decorators import login_required + +# Create your views here. +@login_required +def dashboard(request): + return render(request, 'dashboard/dashboard.html') \ No newline at end of file diff --git a/iaso/apps/users/admin.py b/iaso/apps/users/admin.py index ea5d68b..8c38f3f 100644 --- a/iaso/apps/users/admin.py +++ b/iaso/apps/users/admin.py @@ -1,3 +1,3 @@ -from django.contrib import admin - -# Register your models here. +from django.contrib import admin + +# Register your models here. diff --git a/iaso/apps/users/apps.py b/iaso/apps/users/apps.py index 8b6fdb6..b4a16be 100644 --- a/iaso/apps/users/apps.py +++ b/iaso/apps/users/apps.py @@ -1,6 +1,6 @@ -from django.apps import AppConfig - - -class UsersConfig(AppConfig): - default_auto_field = "django.db.models.BigAutoField" - name = "iaso.apps.users" +from django.apps import AppConfig + + +class UsersConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "iaso.apps.users" diff --git a/iaso/apps/users/models.py b/iaso/apps/users/models.py index fd18c6e..71a8362 100644 --- a/iaso/apps/users/models.py +++ b/iaso/apps/users/models.py @@ -1,3 +1,3 @@ -from django.db import models - -# Create your models here. +from django.db import models + +# Create your models here. diff --git a/iaso/apps/users/tests.py b/iaso/apps/users/tests.py index de8bdc0..7ce503c 100644 --- a/iaso/apps/users/tests.py +++ b/iaso/apps/users/tests.py @@ -1,3 +1,3 @@ -from django.test import TestCase - -# Create your tests here. +from django.test import TestCase + +# Create your tests here. diff --git a/iaso/apps/users/views.py b/iaso/apps/users/views.py index c60c790..91ea44a 100644 --- a/iaso/apps/users/views.py +++ b/iaso/apps/users/views.py @@ -1,3 +1,3 @@ -from django.shortcuts import render - -# Create your views here. +from django.shortcuts import render + +# Create your views here. diff --git a/iaso/asgi.py b/iaso/asgi.py index d098c06..f5b059c 100644 --- a/iaso/asgi.py +++ b/iaso/asgi.py @@ -1,7 +1,7 @@ -import os - -from django.core.asgi import get_asgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "iaso.settings") - -application = get_asgi_application() +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "iaso.settings") + +application = get_asgi_application() diff --git a/iaso/settings/__init__.py b/iaso/settings/__init__.py index 02f90a3..70291ac 100644 --- a/iaso/settings/__init__.py +++ b/iaso/settings/__init__.py @@ -1,104 +1,104 @@ -from pathlib import Path -from django.urls import reverse_lazy - -BASE_DIR = Path(__file__).resolve().parent.parent - - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ - -# Application definition - -INSTALLED_APPS = [ - "iaso.apps.users", - - "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 = "iaso.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 = "iaso.wsgi.application" - -# Password validation -# https://docs.djangoproject.com/en/4.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/4.1/topics/i18n/ - -LANGUAGE_CODE = "en-us" - -TIME_ZONE = "UTC" - -USE_I18N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/4.1/howto/static-files/ - -STATIC_ROOT = BASE_DIR / 'serve/' - -STATIC_URL = '/static/' - -STATICFILES_DIRS = ( - BASE_DIR / 'static/', -) - -MEDIA_ROOT = BASE_DIR / 'media/' - -MEDIA_URL = '/media/' - -# Default primary key field type -# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field - -DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" - +from pathlib import Path +from django.urls import reverse_lazy + +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/ + +# Application definition + +INSTALLED_APPS = [ + "iaso.apps.users", + + "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 = "iaso.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 = "iaso.wsgi.application" + +# Password validation +# https://docs.djangoproject.com/en/4.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/4.1/topics/i18n/ + +LANGUAGE_CODE = "en-us" + +TIME_ZONE = "UTC" + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.1/howto/static-files/ + +STATIC_ROOT = BASE_DIR / 'serve/' + +STATIC_URL = '/static/' + +STATICFILES_DIRS = ( + BASE_DIR / 'static/', +) + +MEDIA_ROOT = BASE_DIR / 'media/' + +MEDIA_URL = '/media/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" + from .secret import * \ No newline at end of file diff --git a/iaso/settings/secret.sample b/iaso/settings/secret.sample index 702672b..1160c67 100644 --- a/iaso/settings/secret.sample +++ b/iaso/settings/secret.sample @@ -1,30 +1,30 @@ -from . import BASE_DIR - -DEBUG=True -SECRET_KEY='insecure_secret_key' - -if DEBUG: - ALLOWED_HOSTS = ['localhost', '127.0.0.1'] -else: - ALLOWED_HOSTS = [''] - -# Database - -if DEBUG: - DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', - } - } -else: - DATABASES = { - "default": { - "ENGINE": 'django.db.backends.postgresql_psycopg2', - "NAME": '', - "USER": '', - "PASSWORD": '', - "HOST": '', - "PORT": '', - } +from . import BASE_DIR + +DEBUG=True +SECRET_KEY='insecure_secret_key' + +if DEBUG: + ALLOWED_HOSTS = ['localhost', '127.0.0.1'] +else: + ALLOWED_HOSTS = [''] + +# Database + +if DEBUG: + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } + } +else: + DATABASES = { + "default": { + "ENGINE": 'django.db.backends.postgresql_psycopg2', + "NAME": '', + "USER": '', + "PASSWORD": '', + "HOST": '', + "PORT": '', + } } \ No newline at end of file diff --git a/iaso/templates/base_page.html b/iaso/templates/base_page.html index 2e3d61c..da5e0a3 100644 --- a/iaso/templates/base_page.html +++ b/iaso/templates/base_page.html @@ -1,19 +1,19 @@ -{% load static %} - - -
-