readme : add example development settings
PATCH 1/1 readme : add example development settings
Configuring a development environment for the project can be non-obvious. This WIP patch updates the readme and includes example dev settings in "dev_settings.py" which can be used (hopefully) in a general case to get new contributors into a development environment quickly.
Signed-off-by Diana Thayer <[email protected]>
--- README | 11 +++++++++++ dev_settings.py | 22 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 dev_settings.py
README +11 -0
@@ -199,6 +199,17 @@ doesn't have the same name, so the update_classic_status.py script wouldn't be able to pick it up. +Using Custom Settings +--------------------- + +You will need to modify settings.py to run layerindex-web in either development or production. As an example of development settings, you can use dev_settings.py. It uses SQLite3 as a database and a console backend for email, so that sent emails show up in your terminal rather than being sent anywhere. + +Then, to use these settings in with `manage.py`, do this: + +```bash +python3 manage.py runserver --settings=dev_settings +``` + Maintenance -----------
dev_settings.py new file +22 -0
@@ -0,0 +1,22 @@ +import os +import hashlib +import random +from settings import * + +WORKDIR = os.path.dirname(os.path.realpath(__file__)) + +SECRET_KEY = hashlib.md5(str(random.random()).format(10).encode('utf-8')).hexdigest() + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + ('admin', '[email protected]'), +) + +DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3' +DATABASES['default']['NAME'] = os.sep.join([WORKDIR, 'layerindex-sql']) + +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + +LAYER_FETCH_DIR = os.sep.join([WORKDIR, "layers"])
Signature · 1 line
2.7.4