diff options
| author | 0livd <0livd@users.noreply.github.com> | 2017-04-23 17:32:37 +0100 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2017-04-23 18:32:37 +0200 |
| commit | e3da3b3b7f18fe80f3ecfaa278859db7a9bfdc45 (patch) | |
| tree | 4e43ef013b0800cebbb164cddd5c9bcafe33edb1 /README.rst | |
| parent | fb84135fe5892f4321977a48abacf233d3ee0d9c (diff) | |
| download | ihatemoney-mirror-e3da3b3b7f18fe80f3ecfaa278859db7a9bfdc45.zip ihatemoney-mirror-e3da3b3b7f18fe80f3ecfaa278859db7a9bfdc45.tar.gz ihatemoney-mirror-e3da3b3b7f18fe80f3ecfaa278859db7a9bfdc45.tar.bz2 | |
Externalize the settings (#193)
Default settings from app's root path are loaded first
Settings are then overriden by /etc/ihatemoney/ihatemoney.cfg
or by another file which path is set in an env var
Fixes #187
Diffstat (limited to 'README.rst')
| -rw-r--r-- | README.rst | 48 |
1 files changed, 34 insertions, 14 deletions
@@ -25,16 +25,6 @@ you just have to run the following command:: This will run a Flask app available at `http://localhost:5000`. -It is also better to actually turn the debugging mode on when you're -developing. You can create a `settings.py` file in the `budget` directory, with -the following content:: - - DEBUG = True - SQLACHEMY_ECHO = DEBUG - -You can also set the `TESTING` flag to `True` so no mails are sent -(and no exception is raised) while you're on development mode. - Deploy it ========= @@ -62,13 +52,43 @@ With Nginx, Gunicorn and Supervisord Don't forget to set the right permission for your files ! -Also, create a `settings.py` file with the appropriate values if you need to -use a different database for instance. You can also set `APPLICATION_ROOT` if -you want to prefix your URLs to serve ihatemonney in the *folder* of a domain, -e.g: +Configure it +============ + +In a production environment +--------------------------- + +Make a copy of ``budget/default_settings.py`` and name it ``ihatemoney.cfg``. +Then adjust the settings to your needs and move this file to +``/etc/ihatemoney/ihatemoney.cfg``. +This is the default path of the settings but you can also place it +elsewhere and pass the configuration file path to the application using +the IHATEMONEY_SETTINGS_FILE_PATH environment variable. +e.g.:: + + $ export IHATEMONEY_SETTINGS_FILE_PATH="/path/to/your/conf/file.cfg" + +Note that you can also pass additional flask parameters with this file. +e.g. If you want to prefix your URLs to serve ihatemonney in the *folder* +of a domain, use the following: :: APPLICATION_ROOT='/budget' +In a dev environment +-------------------- + +It is better to actually turn the debugging mode on when you're developing. +You can create a ``settings.cfg`` file, with the following content:: + + DEBUG = True + SQLACHEMY_ECHO = DEBUG + +You can also set the `TESTING` flag to `True` so no mails are sent +(and no exception is raised) while you're on development mode. +Then before running the application, declare its path with :: + + $ export IHATEMONEY_SETTINGS_FILE_PATH="$(pwd)/settings.cfg" + The REST API? ============= |
