From e916cac054ff917b6cd2eb7c1a0dba2375f08909 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Mon, 27 Jul 2015 20:05:47 -0300 Subject: [PATCH] Adjust static files settings --- .gitignore | 2 +- sapl/settings.py | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 8e00d439c..8eaaf94a4 100644 --- a/.gitignore +++ b/.gitignore @@ -77,6 +77,6 @@ target/ *.sublime-workspace # specific to this project -static +collected_static bower bower_components diff --git a/sapl/settings.py b/sapl/settings.py index 2c3d0efb6..176b4ee2e 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -10,10 +10,10 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os +from unipath import Path -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +BASE_DIR = Path(__file__).ancestor(2) # Quick-start development settings - unsuitable for production @@ -117,26 +117,25 @@ LOCALE_PATHS = ( # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.8/howto/static-files/ - STATIC_URL = '/static/' +STATIC_ROOT = BASE_DIR.child("collected_static") STATICFILES_DIRS = ( - os.path.join(BASE_DIR, "static"), + BASE_DIR.child("static"), ) - -DAB_FIELD_RENDERER = \ - 'django_admin_bootstrapped.renderers.BootstrapFieldRenderer' - -CRISPY_TEMPLATE_PACK = 'foundation-5' -CRISPY_FAIL_SILENTLY = not DEBUG - -BOWER_COMPONENTS_ROOT = os.path.join(BASE_DIR, "bower") - STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'djangobower.finders.BowerFinder', ) +MEDIA_ROOT = BASE_DIR.child("media") + +DAB_FIELD_RENDERER = \ + 'django_admin_bootstrapped.renderers.BootstrapFieldRenderer' +CRISPY_TEMPLATE_PACK = 'foundation-5' +CRISPY_FAIL_SILENTLY = not DEBUG + +BOWER_COMPONENTS_ROOT = BASE_DIR.child("bower") BOWER_INSTALLED_APPS = ( 'foundation', 'foundation-datepicker',