diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..26ee535 --- /dev/null +++ b/Pipfile @@ -0,0 +1,12 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +django = "*" + +[dev-packages] + +[requires] +python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..6667c55 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,75 @@ +{ + "_meta": { + "hash": { + "sha256": "99c4b9ec1b8891ff787677276760beb6d6d4919c55660da1c713682156a6086c" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.8" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "asgiref": { + "hashes": [ + "sha256:71e68008da809b957b7ee4b43dbccff33d1b23519fb8344e33f049897077afac", + "sha256:9567dfe7bd8d3c8c892227827c41cce860b368104c3431da67a0c5a65a949506" + ], + "markers": "python_version >= '3.7'", + "version": "==3.6.0" + }, + "backports.zoneinfo": { + "hashes": [ + "sha256:17746bd546106fa389c51dbea67c8b7c8f0d14b5526a579ca6ccf5ed72c526cf", + "sha256:1b13e654a55cd45672cb54ed12148cd33628f672548f373963b0bff67b217328", + "sha256:1c5742112073a563c81f786e77514969acb58649bcdf6cdf0b4ed31a348d4546", + "sha256:4a0f800587060bf8880f954dbef70de6c11bbe59c673c3d818921f042f9954a6", + "sha256:5c144945a7752ca544b4b78c8c41544cdfaf9786f25fe5ffb10e838e19a27570", + "sha256:7b0a64cda4145548fed9efc10322770f929b944ce5cee6c0dfe0c87bf4c0c8c9", + "sha256:8439c030a11780786a2002261569bdf362264f605dfa4d65090b64b05c9f79a7", + "sha256:8961c0f32cd0336fb8e8ead11a1f8cd99ec07145ec2931122faaac1c8f7fd987", + "sha256:89a48c0d158a3cc3f654da4c2de1ceba85263fafb861b98b59040a5086259722", + "sha256:a76b38c52400b762e48131494ba26be363491ac4f9a04c1b7e92483d169f6582", + "sha256:da6013fd84a690242c310d77ddb8441a559e9cb3d3d59ebac9aca1a57b2e18bc", + "sha256:e55b384612d93be96506932a786bbcde5a2db7a9e6a4bb4bffe8b733f5b9036b", + "sha256:e81b76cace8eda1fca50e345242ba977f9be6ae3945af8d46326d776b4cf78d1", + "sha256:e8236383a20872c0cdf5a62b554b27538db7fa1bbec52429d8d106effbaeca08", + "sha256:f04e857b59d9d1ccc39ce2da1021d196e47234873820cbeaad210724b1ee28ac", + "sha256:fadbfe37f74051d024037f223b8e001611eac868b5c5b06144ef4d8b799862f2" + ], + "markers": "python_version < '3.9'", + "version": "==0.2.1" + }, + "django": { + "hashes": [ + "sha256:4b214a05fe4c99476e99e2445c8b978c8369c18d4dea8e22ec412862715ad763", + "sha256:ff56ebd7ead0fd5dbe06fe157b0024a7aaea2e0593bb3785fb594cf94dad58ef" + ], + "index": "pypi", + "version": "==4.1.5" + }, + "sqlparse": { + "hashes": [ + "sha256:0323c0ec29cd52bceabc1b4d9d579e311f3e4961b98d174201d5622a23b85e34", + "sha256:69ca804846bb114d2ec380e4360a8a340db83f0ccf3afceeb1404df028f57268" + ], + "markers": "python_version >= '3.5'", + "version": "==0.4.3" + }, + "tzdata": { + "hashes": [ + "sha256:2b88858b0e3120792a3c0635c23daf36a7d7eeeca657c323da299d2094402a0d", + "sha256:fe5f866eddd8b96e9fcba978f8e503c909b19ea7efda11e52e39494bad3a7bfa" + ], + "markers": "sys_platform == 'win32'", + "version": "==2022.7" + } + }, + "develop": {} +} diff --git a/iaso/__init__.py b/iaso/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iaso/apps/auth/__init__.py b/iaso/apps/auth/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iaso/apps/auth/admin.py b/iaso/apps/auth/admin.py new file mode 100644 index 0000000..ea5d68b --- /dev/null +++ b/iaso/apps/auth/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/iaso/apps/auth/apps.py b/iaso/apps/auth/apps.py new file mode 100644 index 0000000..4daf216 --- /dev/null +++ b/iaso/apps/auth/apps.py @@ -0,0 +1,6 @@ +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/migrations/__init__.py b/iaso/apps/auth/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iaso/apps/auth/models.py b/iaso/apps/auth/models.py new file mode 100644 index 0000000..fd18c6e --- /dev/null +++ b/iaso/apps/auth/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/iaso/apps/auth/tests.py b/iaso/apps/auth/tests.py new file mode 100644 index 0000000..de8bdc0 --- /dev/null +++ b/iaso/apps/auth/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/iaso/apps/auth/views.py b/iaso/apps/auth/views.py new file mode 100644 index 0000000..abcda1c --- /dev/null +++ b/iaso/apps/auth/views.py @@ -0,0 +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 + } + + return render(request, 'auth/login.html', context=context) \ No newline at end of file diff --git a/iaso/apps/dashboard/__init__.py b/iaso/apps/dashboard/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iaso/apps/dashboard/admin.py b/iaso/apps/dashboard/admin.py new file mode 100644 index 0000000..ea5d68b --- /dev/null +++ b/iaso/apps/dashboard/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/iaso/apps/dashboard/apps.py b/iaso/apps/dashboard/apps.py new file mode 100644 index 0000000..f7691e5 --- /dev/null +++ b/iaso/apps/dashboard/apps.py @@ -0,0 +1,6 @@ +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/migrations/__init__.py b/iaso/apps/dashboard/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iaso/apps/dashboard/models.py b/iaso/apps/dashboard/models.py new file mode 100644 index 0000000..fd18c6e --- /dev/null +++ b/iaso/apps/dashboard/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/iaso/apps/dashboard/tests.py b/iaso/apps/dashboard/tests.py new file mode 100644 index 0000000..de8bdc0 --- /dev/null +++ b/iaso/apps/dashboard/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/iaso/apps/dashboard/views.py b/iaso/apps/dashboard/views.py new file mode 100644 index 0000000..5f50972 --- /dev/null +++ b/iaso/apps/dashboard/views.py @@ -0,0 +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') + \ No newline at end of file diff --git a/iaso/apps/users/__init__.py b/iaso/apps/users/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iaso/apps/users/admin.py b/iaso/apps/users/admin.py new file mode 100644 index 0000000..ea5d68b --- /dev/null +++ b/iaso/apps/users/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/iaso/apps/users/apps.py b/iaso/apps/users/apps.py new file mode 100644 index 0000000..8b6fdb6 --- /dev/null +++ b/iaso/apps/users/apps.py @@ -0,0 +1,6 @@ +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/migrations/__init__.py b/iaso/apps/users/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/iaso/apps/users/models.py b/iaso/apps/users/models.py new file mode 100644 index 0000000..fd18c6e --- /dev/null +++ b/iaso/apps/users/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/iaso/apps/users/tests.py b/iaso/apps/users/tests.py new file mode 100644 index 0000000..de8bdc0 --- /dev/null +++ b/iaso/apps/users/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/iaso/apps/users/views.py b/iaso/apps/users/views.py new file mode 100644 index 0000000..c60c790 --- /dev/null +++ b/iaso/apps/users/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/iaso/asgi.py b/iaso/asgi.py new file mode 100644 index 0000000..d098c06 --- /dev/null +++ b/iaso/asgi.py @@ -0,0 +1,7 @@ +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/.gitignore b/iaso/settings/.gitignore new file mode 100644 index 0000000..b47515c --- /dev/null +++ b/iaso/settings/.gitignore @@ -0,0 +1 @@ +secret.py \ No newline at end of file diff --git a/iaso/settings/__init__.py b/iaso/settings/__init__.py new file mode 100644 index 0000000..02f90a3 --- /dev/null +++ b/iaso/settings/__init__.py @@ -0,0 +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 .secret import * \ No newline at end of file diff --git a/iaso/settings/secret.sample b/iaso/settings/secret.sample new file mode 100644 index 0000000..702672b --- /dev/null +++ b/iaso/settings/secret.sample @@ -0,0 +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": '', + } + } \ No newline at end of file diff --git a/iaso/static/css/base.css b/iaso/static/css/base.css new file mode 100644 index 0000000..44b5059 --- /dev/null +++ b/iaso/static/css/base.css @@ -0,0 +1 @@ +/* base.css */ \ No newline at end of file diff --git a/iaso/static/js/main.js b/iaso/static/js/main.js new file mode 100644 index 0000000..02b7f81 --- /dev/null +++ b/iaso/static/js/main.js @@ -0,0 +1 @@ +// main.js \ No newline at end of file diff --git a/iaso/templates/base_page.html b/iaso/templates/base_page.html new file mode 100644 index 0000000..2e3d61c --- /dev/null +++ b/iaso/templates/base_page.html @@ -0,0 +1,19 @@ +{% 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/dashboard/dashboard.html b/iaso/templates/dashboard/dashboard.html new file mode 100644 index 0000000..f896785 --- /dev/null +++ b/iaso/templates/dashboard/dashboard.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/iaso/templates/meta.html b/iaso/templates/meta.html new file mode 100644 index 0000000..598e4ce --- /dev/null +++ b/iaso/templates/meta.html @@ -0,0 +1,5 @@ +{% load static %} + + + + \ No newline at end of file diff --git a/iaso/templates/users/login.html b/iaso/templates/users/login.html new file mode 100644 index 0000000..e69de29 diff --git a/iaso/urls.py b/iaso/urls.py new file mode 100644 index 0000000..79299d4 --- /dev/null +++ b/iaso/urls.py @@ -0,0 +1,6 @@ +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 new file mode 100644 index 0000000..689078f --- /dev/null +++ b/iaso/wsgi.py @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000..2820896 --- /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", "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()