From fa5334a741f141b8f9cdd200b71cb5211da3560c Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Fri, 20 Mar 2020 20:40:26 +0100 Subject: [PATCH 1/5] use the OPTIONALS_APPS from secrets.py --- note_kfet/settings/__init__.py | 2 ++ note_kfet/settings/base.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/note_kfet/settings/__init__.py b/note_kfet/settings/__init__.py index 28935deb..0a8ce64d 100644 --- a/note_kfet/settings/__init__.py +++ b/note_kfet/settings/__init__.py @@ -41,6 +41,8 @@ else: try: #in secrets.py defines everything you want from .secrets import * + INSTALLED_APPS += OPTIONAL_APPS + except ImportError: pass diff --git a/note_kfet/settings/base.py b/note_kfet/settings/base.py index 0694390d..566ca295 100644 --- a/note_kfet/settings/base.py +++ b/note_kfet/settings/base.py @@ -39,8 +39,6 @@ INSTALLED_APPS = [ 'polymorphic', 'crispy_forms', 'django_tables2', - 'cas_server', - 'cas', # Django contrib 'django.contrib.admin', 'django.contrib.admindocs', From e5cc16569d94ca82a866f24e4b5dd3fc2bd72115 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Fri, 20 Mar 2020 20:44:34 +0100 Subject: [PATCH 2/5] api is a base requirement --- requirements/api.txt | 3 --- requirements/base.txt | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 requirements/api.txt diff --git a/requirements/api.txt b/requirements/api.txt deleted file mode 100644 index 8dd9f5f2..00000000 --- a/requirements/api.txt +++ /dev/null @@ -1,3 +0,0 @@ -djangorestframework==3.9.0 -django-rest-polymorphic==0.1.8 - diff --git a/requirements/base.txt b/requirements/base.txt index e9dc7635..6c5fbc4c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -19,4 +19,6 @@ requests==2.22.0 requests-oauthlib==1.2.0 six==1.12.0 sqlparse==0.3.0 +djangorestframework==3.9.0 +django-rest-polymorphic==0.1.8 urllib3==1.25.3 From 9786a2250ee768ffee4f1d88699ae6dcabe8df98 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Fri, 20 Mar 2020 20:46:44 +0100 Subject: [PATCH 3/5] config requirements --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 91f2f17d..1ffe8793 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ On supposera pour la suite que vous utiliser debian/ubuntu sur un serveur tout n $ python3 -m venv env $ source env/bin/activate (env)$ pip3 install -r requirements/base.txt + (env)$ pip3 install -r requirements/prod.txt # uniquement en prod, nécessite un base postgres (env)$ deactivate 4. uwsgi et Nginx @@ -101,18 +102,18 @@ On supposera pour la suite que vous utiliser debian/ubuntu sur un serveur tout n On copie le fichier `.env_example` vers le fichier `.env` à la racine du projet et on renseigne des secrets et des paramètres : - DJANGO_APP_STAGE="dev" - DJANGO_DEV_STORE_METHOD="sqllite" + DJANGO_APP_STAGE="dev" # ou "prod" + DJANGO_DEV_STORE_METHOD="sqllite" # ou "postgres" DJANGO_DB_HOST="localhost" DJANGO_DB_NAME="note_db" DJANGO_DB_USER="note" - DJANGO_DB_PASSWORD="CHANGE_ME" + DJANGO_DB_PASSWORD="CHANGE_ME" DJANGO_DB_PORT="" DJANGO_SECRET_KEY="CHANGE_ME" DJANGO_SETTINGS_MODULE="note_kfet.settings" - DOMAIN="localhost" + DOMAIN="localhost" # note.example.com CONTACT_EMAIL="tresorerie.bde@localhost" - NOTE_URL="localhost" + NOTE_URL="localhost" # serveur cas note.example.com si auto-hébergé. Ensuite on (re)bascule dans l'environement virtuel et on lance les migrations @@ -167,7 +168,7 @@ un serveur de développement par exemple sur son ordinateur. $ python3 -m venv venv $ source venv/bin/activate - (env)$ pip install -r requirements.txt + (env)$ pip install -r requirements/base.txt 3. Copier le fichier `.env_example` vers `.env` à la racine du projet et mettre à jour ce qu'il faut From 93c583f5c622cd67c9c4914fd07004bf44c985bb Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Fri, 20 Mar 2020 20:51:15 +0100 Subject: [PATCH 4/5] remove api deps, moved to base --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 2217b6bf..245163c1 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,6 @@ setenv = PYTHONWARNINGS = all deps = -r{toxinidir}/requirements/base.txt - -r{toxinidir}/requirements/api.txt -r{toxinidir}/requirements/cas.txt -r{toxinidir}/requirements/production.txt coverage From 8023e2f48ccaa70a7720c7ce438a1f4c3d412e1d Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Fri, 20 Mar 2020 21:01:33 +0100 Subject: [PATCH 5/5] fix CI --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 245163c1..0b5c20c9 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,6 @@ commands = [testenv:linters] deps = -r{toxinidir}/requirements/base.txt - -r{toxinidir}/requirements/api.txt -r{toxinidir}/requirements/cas.txt -r{toxinidir}/requirements/production.txt flake8