Merge branch 'kerl/rename_cof_gestioAsso' into 'master'

Renomme le dossier cof/ en gestioasso/

See merge request klub-dev-ens/gestioCOF!485
This commit is contained in:
Ludovic Stephan 2021-02-08 19:29:07 +01:00
commit 46ef12309a
27 changed files with 51 additions and 35 deletions

View file

@ -21,8 +21,8 @@ variables:
before_script:
- mkdir -p vendor/{pip,apt}
- apt-get update -q && apt-get -o dir::cache::archives="vendor/apt" install -yqq postgresql-client libldap2-dev libsasl2-dev
- sed -E 's/^REDIS_HOST.*/REDIS_HOST = "redis"/' cof/settings/secret_example.py > cof/settings/secret.py
- sed -i.bak -E 's;^REDIS_PASSWD = .*$;REDIS_PASSWD = "";' cof/settings/secret.py
- sed -E 's/^REDIS_HOST.*/REDIS_HOST = "redis"/' gestioasso/settings/secret_example.py > gestioasso/settings/secret.py
- sed -i.bak -E 's;^REDIS_PASSWD = .*$;REDIS_PASSWD = "";' gestioasso/settings/secret.py
# Remove the old test database if it has not been done yet
- psql --username=$POSTGRES_USER --host=$DBHOST -c "DROP DATABASE IF EXISTS test_$POSTGRES_DB"
- pip install --upgrade -r requirements-prod.txt coverage tblib
@ -44,7 +44,7 @@ coftest:
stage: test
extends: .test_template
variables:
DJANGO_SETTINGS_MODULE: "cof.settings.cof_prod"
DJANGO_SETTINGS_MODULE: "gestioasso.settings.cof_prod"
script:
- coverage run manage.py test gestioncof bda kfet petitscours shared --parallel
@ -52,7 +52,7 @@ bdstest:
stage: test
extends: .test_template
variables:
DJANGO_SETTINGS_MODULE: "cof.settings.bds_prod"
DJANGO_SETTINGS_MODULE: "gestioasso.settings.bds_prod"
script:
- coverage run manage.py test bds clubs events --parallel
@ -65,7 +65,7 @@ linters:
- black --check .
- isort --check --diff .
# Print errors only
- flake8 --exit-zero bda bds clubs cof events gestioncof kfet petitscours provisioning shared
- flake8 --exit-zero bda bds clubs gestioasso events gestioncof kfet petitscours provisioning shared
cache:
key: linters
paths:
@ -75,11 +75,11 @@ linters:
migration_checks:
stage: test
variables:
DJANGO_SETTINGS_MODULE: "cof.settings.local"
DJANGO_SETTINGS_MODULE: "gestioasso.settings.local"
before_script:
- mkdir -p vendor/{pip,apt}
- apt-get update -q && apt-get -o dir::cache::archives="vendor/apt" install -yqq postgresql-client libldap2-dev libsasl2-dev
- cp cof/settings/secret_example.py cof/settings/secret.py
- cp gestioasso/settings/secret_example.py gestioasso/settings/secret.py
- pip install --upgrade -r requirements-devel.txt
- python --version
script: python manage.py makemigrations --dry-run --check

View file

@ -1,4 +1,4 @@
# GestioCOF
# GestioCOF / GestioBDS
[![pipeline status](https://git.eleves.ens.fr/cof-geek/gestioCOF/badges/master/pipeline.svg)](https://git.eleves.ens.fr/cof-geek/gestioCOF/commits/master)
[![coverage report](https://git.eleves.ens.fr/cof-geek/gestioCOF/badges/master/coverage.svg)](https://git.eleves.ens.fr/cof-geek/gestioCOF/commits/master)
@ -38,11 +38,11 @@ Vous pouvez maintenant installer les dépendances Python depuis le fichier
pip install -U pip # parfois nécessaire la première fois
pip install -r requirements-devel.txt
Pour terminer, copier le fichier `cof/settings/secret_example.py` vers
`cof/settings/secret.py`. Sous Linux ou Mac, préférez plutôt un lien symbolique
Pour terminer, copier le fichier `gestioasso/settings/secret_example.py` vers
`gestioasso/settings/secret.py`. Sous Linux ou Mac, préférez plutôt un lien symbolique
pour profiter de façon transparente des mises à jour du fichier:
ln -s secret_example.py cof/settings/secret.py
ln -s secret_example.py gestioasso/settings/secret.py
Nous avons un git hook de pre-commit pour formatter et vérifier que votre code
vérifie nos conventions. Pour bénéficier des mises à jour du hook, préférez

View file

@ -3,6 +3,6 @@ import os
from channels.asgi import get_channel_layer
if "DJANGO_SETTINGS_MODULE" not in os.environ:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cof.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gestioasso.settings")
channel_layer = get_channel_layer()

View file

@ -1,7 +1,9 @@
"""
Django development settings for the cof project.
The settings that are not listed here are imported from .common
Settings de production de GestioBDS.
Surcharge les settings définis dans common.py
"""
from .common import * # NOQA
from .common import INSTALLED_APPS

View file

@ -1,7 +1,9 @@
"""
Django development settings for the cof project.
The settings that are not listed here are imported from .common
Settings de production de GestioCOF.
Surcharge les settings définis dans common.py
"""
import os
from .common import * # NOQA
@ -149,7 +151,7 @@ CHANNEL_LAYERS = {
)
]
},
"ROUTING": "cof.routing.routing",
"ROUTING": "gestioasso.routing.routing",
}
}

View file

@ -1,8 +1,5 @@
"""
Django common settings for cof project.
Everything which is supposed to be identical between the production server and
the local development server should be here.
Settings par défaut et settings communs à GestioCOF et GestioBDS.
"""
import os
@ -65,7 +62,7 @@ INSTALLED_APPS = [
"django.contrib.messages",
"django.contrib.admin",
"django.contrib.admindocs",
"cof.apps.IgnoreSrcStaticFilesConfig",
"gestioasso.apps.IgnoreSrcStaticFilesConfig",
"django_cas_ng",
"bootstrapform",
"widget_tweaks",
@ -82,7 +79,7 @@ MIDDLEWARE = [
"django.middleware.locale.LocaleMiddleware",
]
ROOT_URLCONF = "cof.urls"
ROOT_URLCONF = "gestioasso.urls"
TEMPLATES = [
{
@ -126,7 +123,7 @@ USE_I18N = True
USE_L10N = True
USE_TZ = True
LANGUAGES = (("fr", "Français"), ("en", "English"))
FORMAT_MODULE_PATH = "cof.locale"
FORMAT_MODULE_PATH = "gestioasso.locale"
# ---

View file

@ -1,4 +1,10 @@
"""Django local development settings."""
"""
Settings utilisés dans la VM Vagrant.
Active toutes les applications (de GestioCOF et de GestioBDS).
Surcharge les settings définis dans common.py
"""
import os
from . import bds_prod

View file

@ -1,4 +1,9 @@
"""Django local development settings."""
"""
Settings utilisés lors d'un développement en local (dans un virtualenv).
Active toutes les applications (de GestioCOF et de GestioBDS).
Surcharge les settings définis dans common.py
"""
import os
from . import bds_prod
@ -43,7 +48,7 @@ CACHES = {"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"
CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgiref.inmemory.ChannelLayer",
"ROUTING": "cof.routing.routing",
"ROUTING": "gestioasso.routing.routing",
}
}

View file

@ -1,3 +1,7 @@
"""
Secrets à re-définir en production.
"""
SECRET_KEY = "q()(zn4m63i%5cp4)f+ww4-28_w+ly3q9=6imw2ciu&_(5_4ah"
ADMINS = None
SERVER_EMAIL = "root@vagrant"

View file

@ -2,5 +2,5 @@ import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cof.settings.bds_prod")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gestioasso.settings.bds_prod")
application = get_wsgi_application()

View file

@ -3,7 +3,7 @@ import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cof.settings.local")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gestioasso.settings.local")
from django.core.management import execute_from_command_line

View file

@ -14,7 +14,7 @@ readonly DBUSER="cof_gestion"
readonly DBNAME="cof_gestion"
readonly DBPASSWD="4KZt3nGPLVeWSvtBZPSM3fSzXpzEU4"
readonly REDIS_PASSWD="dummy"
readonly DJANGO_SETTINGS_MODULE="cof.settings.dev"
readonly DJANGO_SETTINGS_MODULE="gestioasso.settings.dev"
# ---
@ -83,7 +83,7 @@ sudo -H -u vagrant ~vagrant/venv/bin/pip install \
# Préparation de Django
cd /vagrant
ln -s -f secret_example.py cof/settings/secret.py
ln -s -f secret_example.py gestioasso/settings/secret.py
sudo -H -u vagrant \
DJANGO_SETTINGS_MODULE="$DJANGO_SETTINGS_MODULE"\
/bin/sh -c ". ~vagrant/venv/bin/activate && /bin/sh provisioning/prepare_django.sh"

View file

@ -8,7 +8,7 @@ User=vagrant
Group=vagrant
TimeoutSec=300
WorkingDirectory=/vagrant
Environment="DJANGO_SETTINGS_MODULE=cof.settings.dev"
Environment="DJANGO_SETTINGS_MODULE=gestioasso.settings.dev"
ExecStart=/home/vagrant/venv/bin/daphne \
-u /srv/gestiocof/gestiocof.sock \
cof.asgi:channel_layer

View file

@ -4,5 +4,5 @@ Description=Envoi des mails de rappel des spectales BdA
[Service]
Type=oneshot
User=vagrant
Environment="DJANGO_SETTINGS_MODULE=cof.settings.dev"
Environment="DJANGO_SETTINGS_MODULE=gestioasso.settings.dev"
ExecStart=/home/vagrant/venv/bin/python /vagrant/manage.py sendrappels

View file

@ -4,5 +4,5 @@ Description=Envoi des mails de BdA-Revente
[Service]
Type=oneshot
User=vagrant
Environment="DJANGO_SETTINGS_MODULE=cof.settings.dev"
Environment="DJANGO_SETTINGS_MODULE=gestioasso.settings.dev"
ExecStart=/home/vagrant/venv/bin/python /vagrant/manage.py manage_reventes

View file

@ -9,7 +9,7 @@ User=vagrant
Group=vagrant
TimeoutSec=300
WorkingDirectory=/vagrant
Environment="DJANGO_SETTINGS_MODULE=cof.settings.dev"
Environment="DJANGO_SETTINGS_MODULE=gestioasso.settings.dev"
ExecStart=/home/vagrant/venv/bin/python manage.py runworker
[Install]