Add protocols module, and add a way to change the config ini file path
authorymh <ymh.work@gmail.com>
Tue, 27 Nov 2018 15:45:45 +0100
changeset 179 e7c7e6e0a8bc
parent 178 89d8432aad9f
child 180 62bffc051e1c
Add protocols module, and add a way to change the config ini file path
src/.env.tmpl
src/irinotes/settings.py
src/setup.py
--- 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: <path to irinotes repository clone>/run/web/static
+# default: <path to irinotes repository clone>/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: <path to irinotes repository clone>/run/web/media
 # MEDIA_ROOT=
--- 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'))
--- 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: