New organisation of settings files #526

Merged
mpepin merged 0 commits from Kerl/settings into master 2017-04-15 14:25:52 +02:00
mpepin commented 2017-04-11 00:51:13 +02:00 (Migrated from git.eleves.ens.fr)

We reproduce what has been done here:
https://github.com/dissemin/dissemin

The following files can be found under cof/settings/

  • common.py: the settings that are shared by all the environments we
    have + the secrets (see below).
  • dev.py: the settings used by the vagrant VM for local development.
  • prod.py: the production settings (for both www.cof.ens.fr and
    dev.cof.ens.fr)

There is also a notion of "secrets". Some settings like the SECRET_KEY
or the database's credentials are loaded from an untracked file called
secret.py in the same directory. This secrets are loaded by the common
settings file.


Note: to apply this patch on your Vagrant VM, you have to change the environment variable DJANGO_SETTINGS_MODULE to cof.settings.dev. By default in the current installation, it is loaded from ~/.bashrc, you should edit this file and reload it (source ~/.bashrc)

We reproduce what has been done here: https://github.com/dissemin/dissemin The following files can be found under `cof/settings/` - `common.py`: the settings that are shared by all the environments we have + the secrets (see below). - `dev.py`: the settings used by the vagrant VM for local development. - `prod.py`: the production settings (for both www.cof.ens.fr and dev.cof.ens.fr) There is also a notion of "secrets". Some settings like the `SECRET_KEY` or the database's credentials are loaded from an untracked file called `secret.py` in the same directory. This secrets are loaded by the common settings file. --- **Note**: to apply this patch on your Vagrant VM, you have to change the environment variable `DJANGO_SETTINGS_MODULE` to `cof.settings.dev`. By default in the current installation, it is loaded from `~/.bashrc`, you should edit this file and reload it (`source ~/.bashrc`)
delobell commented 2017-04-11 13:56:24 +02:00 (Migrated from git.eleves.ens.fr)

De la doc de django-debug-toolbar:

The order of MIDDLEWARE and MIDDLEWARE_CLASSES is important. You should include the Debug Toolbar middleware as early as possible in the list. However, it must come after any other middleware that encodes the response’s content, such as GZipMiddleware.

Là le middleware arrive à la fin donc la toolbar "rate" ce qui se passe dans les autres middlewares.

De la doc de `django-debug-toolbar`: > The order of MIDDLEWARE and MIDDLEWARE_CLASSES is important. You should include the Debug Toolbar middleware as early as possible in the list. However, it must come after any other middleware that encodes the response’s content, such as GZipMiddleware. > Là le middleware arrive à la fin donc la toolbar "rate" ce qui se passe dans les autres middlewares.
delobell commented 2017-04-11 14:16:32 +02:00 (Migrated from git.eleves.ens.fr)

C'est marrant je m'attendais à me faire insulter par python parce qu'il n'y a pas de __init__.py dans cof/settings/ et ça m'a permis de découvrir que ce fichier n'est plus requis depuis Py 3.3 pour rendre un répertoire importable. Du coup merci Martin ;-)

C'est marrant je m'attendais à me faire insulter par python parce qu'il n'y a pas de `__init__.py` dans `cof/settings/` et ça m'a permis de découvrir que ce fichier n'est plus requis depuis Py 3.3 pour rendre un répertoire importable. Du coup merci Martin ;-)
mpepin commented 2017-04-11 14:18:21 +02:00 (Migrated from git.eleves.ens.fr)

Mais de rien ;-) je l'ai appris récemment de façon assez similaire d'ailleurs ^^

Mais de rien ;-) je l'ai appris récemment de façon assez similaire d'ailleurs \^\^
delobell commented 2017-04-11 14:29:51 +02:00 (Migrated from git.eleves.ens.fr)

Tu peux peut-être le laisser où il était. D'après la doc:

If this processor is enabled, every RequestContext will contain these two variables – but only if your DEBUG setting is set to True and the request’s IP address (request.META['REMOTE_ADDR']) is in the INTERNAL_IPS setting:

Je trouve pas ça très joli

Tu peux peut-être le laisser où il était. D'après la [doc](https://docs.djangoproject.com/en/1.8/ref/templates/api/#django-template-context-processors-debug): > If this processor is enabled, every RequestContext will contain these two variables – but only if your DEBUG setting is set to True and the request’s IP address (request.META['REMOTE_ADDR']) is in the INTERNAL_IPS setting: > Je trouve pas ça très joli
delobell commented 2017-04-11 14:31:28 +02:00 (Migrated from git.eleves.ens.fr)

Ils peuvent sauter

Ils peuvent sauter
delobell commented 2017-04-11 14:32:01 +02:00 (Migrated from git.eleves.ens.fr)

the serveur of bien sûr :-P

the serveur of bien sûr :-P
mpepin commented 2017-04-15 12:08:47 +02:00 (Migrated from git.eleves.ens.fr)

Oui bon ça va hein :P

Oui bon ça va hein :P
mpepin commented 2017-04-15 12:39:56 +02:00 (Migrated from git.eleves.ens.fr)

added 1 commit

Compare with previous version

added 1 commit * ff73a635 - Minor fixes in settings/ [Compare with previous version](https://git.eleves.ens.fr/cof-geek/gestioCOF/merge_requests/222/diffs?diff_id=439&start_sha=40abe81402649b326a4c8334290ae5177e079f5b)
delobell commented 2017-04-15 13:09:31 +02:00 (Migrated from git.eleves.ens.fr)

resolved all discussions

resolved all discussions
delobell commented 2017-04-15 14:25:52 +02:00 (Migrated from git.eleves.ens.fr)

mentioned in commit a0fe94e2f4

mentioned in commit a0fe94e2f47b0f0df9c774104e5ffcee68f73951
delobell commented 2017-04-15 14:25:53 +02:00 (Migrated from git.eleves.ens.fr)

merged

merged
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DGNum/gestioCOF#526
No description provided.