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 %} - - - - {% block title %}iaso emr{% endblock %} - - {% block meta %} - {% include "meta.html" %} - {% endblock %} - - {% block css %} - - {% endblock %} - - - - {% block body %}{% endblock %} - +{% load static %} + + + + {% block title %}iaso emr{% endblock %} + + {% block meta %} + {% include "meta.html" %} + {% endblock %} + + {% block css %} + + {% endblock %} + + + + {% block body %}{% endblock %} + \ No newline at end of file diff --git a/iaso/templates/meta.html b/iaso/templates/meta.html index 598e4ce..75b4ceb 100644 --- a/iaso/templates/meta.html +++ b/iaso/templates/meta.html @@ -1,5 +1,5 @@ -{% load static %} - - - +{% load static %} + + + \ No newline at end of file diff --git a/iaso/urls.py b/iaso/urls.py index 79299d4..083932c 100644 --- a/iaso/urls.py +++ b/iaso/urls.py @@ -1,6 +1,6 @@ -from django.contrib import admin -from django.urls import path - -urlpatterns = [ - path("admin/", admin.site.urls), -] +from django.contrib import admin +from django.urls import path + +urlpatterns = [ + path("admin/", admin.site.urls), +] diff --git a/iaso/wsgi.py b/iaso/wsgi.py index 689078f..2c53933 100644 --- a/iaso/wsgi.py +++ b/iaso/wsgi.py @@ -1,7 +1,7 @@ -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "iaso.settings") - -application = get_wsgi_application() +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "iaso.settings") + +application = get_wsgi_application() diff --git a/manage.py b/manage.py index 2820896..426f5bd 100755 --- a/manage.py +++ b/manage.py @@ -1,22 +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", "iaso.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() +#!/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", "iaso.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()