# HG changeset patch # User ymh # Date 1543329945 -3600 # Node ID e7c7e6e0a8bc01a2a3b4f832dbf603c93148808e # Parent 89d8432aad9fd8fee6d3e0e1d874bc358758cbc9 Add protocols module, and add a way to change the config ini file path diff -r 89d8432aad9f -r e7c7e6e0a8bc src/.env.tmpl --- a/src/.env.tmpl Mon Nov 26 13:57:30 2018 +0100 +++ b/src/.env.tmpl Tue Nov 27 15:45:45 2018 +0100 @@ -6,9 +6,13 @@ # STATIC_URL=/static/ # The absolute path to the directory where collectstatic will collect static files for deployment. (https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-STATIC_ROOT) -# default: /run/web/static +# default: /run/web/static/ # STATIC_ROOT= +# base url for media resources (ends with "/") +# default : /media/ +# MEDIA_URL=/media/ + # Absolute filesystem path to the directory that will hold user-uploaded files (https://docs.djangoproject.com/en/1.11/ref/settings/#media-root) # default: /run/web/media # MEDIA_ROOT= diff -r 89d8432aad9f -r e7c7e6e0a8bc src/irinotes/settings.py --- a/src/irinotes/settings.py Mon Nov 26 13:57:30 2018 +0100 +++ b/src/irinotes/settings.py Tue Nov 27 15:45:45 2018 +0100 @@ -15,7 +15,7 @@ import os from corsheaders.defaults import default_headers -from decouple import Csv, AutoConfig +from decouple import AutoConfig, Csv from dj_database_url import parse as db_url from unipath import Path @@ -164,6 +164,12 @@ STATIC_URL = config('STATIC_URL', default=BASE_URL + '/static/') +# URL that handles the media served from MEDIA_ROOT +# https://docs.djangoproject.com/en/2.1/ref/settings/#media-url + +MEDIA_URL = config('MEDIA_URL', default=BASE_URL + '/media/') + + # Logger LOG_FILE = config('LOG_FILE', default=RUN_DIR.child('log').child('log.txt')) diff -r 89d8432aad9f -r e7c7e6e0a8bc src/setup.py --- a/src/setup.py Mon Nov 26 13:57:30 2018 +0100 +++ b/src/setup.py Tue Nov 27 15:45:45 2018 +0100 @@ -115,7 +115,7 @@ root_dir = os.path.dirname(__file__) if root_dir != '': os.chdir(root_dir) - source_dirs = ['irinotes', 'notes'] + source_dirs = ['irinotes', 'notes', 'protocols'] version_variables = {} try: