New organisation of settings files #526
No reviewers
Labels
No labels
devtype -- backend
devtype -- docs
devtype -- frontend
devtype -- user interface
difficulty -- easy
difficulty -- hard
difficulty -- normal
Doing
domain -- bda
domain -- bds
domain -- cof
domain -- core
domain -- kfet
Good first issue
priority -- high
priority -- low
priority -- medium
priority -- staff-wanted
status -- development
status -- discussion
status -- need review
status -- production
status -- ready to merge
status -- todo
To Do
type -- bug
type -- hygiene
type -- improvement
type -- new feature
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: DGNum/gestioCOF#526
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Kerl/settings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 wehave + 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 anddev.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 commonsettings file.
Note: to apply this patch on your Vagrant VM, you have to change the environment variable
DJANGO_SETTINGS_MODULE
tocof.settings.dev
. By default in the current installation, it is loaded from~/.bashrc
, you should edit this file and reload it (source ~/.bashrc
)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.
C'est marrant je m'attendais à me faire insulter par python parce qu'il n'y a pas de
__init__.py
danscof/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 ;-)Mais de rien ;-) je l'ai appris récemment de façon assez similaire d'ailleurs ^^
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
Ils peuvent sauter
the serveur of bien sûr :-P
Oui bon ça va hein :P
added 1 commit
ff73a635
- Minor fixes in settings/Compare with previous version
resolved all discussions
mentioned in commit
a0fe94e2f4
merged