From 2741a10a356e4fd66441af005e142dbf5dbfc9bc Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 23 Dec 2015 12:22:23 +0100 Subject: Fix default ROOT_PATH --- example_project/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index 6a0bf4079..3a001bf2b 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -17,7 +17,10 @@ CACHE_SMALLTIMEOUT = 120 CACHE_TIMEOUT = 3600 CACHE_BACKEND = 'memcached://127.0.0.1:11211/' -ROOT_PATH = os.path.abspath(os.path.curdir) + os.path.sep +ROOT_PATH = (os.path.abspath(os.path.curdir) + os.path.sep).replace( + os.path.sep * 2, os.path.sep) +if ROOT_PATH == os.path.sep: + ROOT_PATH = "." + os.path.sep STATIC_URL = '/static/' STATIC_ROOT = ROOT_PATH + 'static/' BASE_URL = "/" -- cgit v1.2.3 From fb7e82c30f77d5d57fdf9ab74f53cb0834bd7a13 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 23 Dec 2015 12:27:22 +0100 Subject: Really fix ROOT_PATH --- example_project/settings.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index 3a001bf2b..ea6defcaf 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -17,10 +17,8 @@ CACHE_SMALLTIMEOUT = 120 CACHE_TIMEOUT = 3600 CACHE_BACKEND = 'memcached://127.0.0.1:11211/' -ROOT_PATH = (os.path.abspath(os.path.curdir) + os.path.sep).replace( - os.path.sep * 2, os.path.sep) -if ROOT_PATH == os.path.sep: - ROOT_PATH = "." + os.path.sep +ROOT_PATH = os.path.sep.join( + os.path.abspath(__file__).split(os.path.sep)[:-2]) STATIC_URL = '/static/' STATIC_ROOT = ROOT_PATH + 'static/' BASE_URL = "/" -- cgit v1.2.3 From 839ce377ef357b8b203ef9aab77cfc874dfe0f6a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 23 Dec 2015 12:29:31 +0100 Subject: ROOT_PATH, ko? Really OK now I hope --- example_project/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index ea6defcaf..d9337c4b6 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -18,7 +18,7 @@ CACHE_TIMEOUT = 3600 CACHE_BACKEND = 'memcached://127.0.0.1:11211/' ROOT_PATH = os.path.sep.join( - os.path.abspath(__file__).split(os.path.sep)[:-2]) + os.path.abspath(__file__).split(os.path.sep)[:-1]) STATIC_URL = '/static/' STATIC_ROOT = ROOT_PATH + 'static/' BASE_URL = "/" -- cgit v1.2.3 From 0ab691e538654f5b8b39c848b122eba97fdc90aa Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 23 Dec 2015 12:32:01 +0100 Subject: One missing separator and where done with the ROOT_PATH --- example_project/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index d9337c4b6..3df329228 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -17,12 +17,12 @@ CACHE_SMALLTIMEOUT = 120 CACHE_TIMEOUT = 3600 CACHE_BACKEND = 'memcached://127.0.0.1:11211/' -ROOT_PATH = os.path.sep.join( - os.path.abspath(__file__).split(os.path.sep)[:-1]) +SEP = os.path.sep +ROOT_PATH = SEP.join( + os.path.abspath(__file__).split(SEP)[:-1]) + SEP STATIC_URL = '/static/' STATIC_ROOT = ROOT_PATH + 'static/' BASE_URL = "/" - URL_PATH = "" ODT_TEMPLATE = ROOT_PATH + "../ishtar_common/static/template.odt" -- cgit v1.2.3 From 6585859a8bb2743db222a0195751755fe5f10745 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 27 Dec 2015 11:37:48 +0100 Subject: Add default archaeological file prefix in settings --- example_project/settings.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index 3df329228..a5db9ecc3 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -25,6 +25,9 @@ STATIC_ROOT = ROOT_PATH + 'static/' BASE_URL = "/" URL_PATH = "" +# prefix for archaeological files code +FILE_PREFIX = "SRA" + ODT_TEMPLATE = ROOT_PATH + "../ishtar_common/static/template.odt" LOGIN_REDIRECT_URL = "/" + URL_PATH -- cgit v1.2.3 From 7325b77b736ff722d4bdc539f5896352bde375a1 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 27 Dec 2015 11:50:35 +0100 Subject: Add explicitly parent directory to the sys path when running tests --- example_project/settings.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'example_project/settings.py') diff --git a/example_project/settings.py b/example_project/settings.py index a5db9ecc3..e124198aa 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -10,6 +10,9 @@ DEBUG_TOOLBAR = False TEMPLATE_DEBUG = DEBUG SQL_DEBUG = False +if "test" in sys.argv: + sys.path.insert(0, '..') + IMAGE_MAX_SIZE = (1024, 768) THUMB_MAX_SIZE = (300, 300) -- cgit v1.2.3