Commits

Guilherme Gondim committed 8769d46

Minor improvements on settings

Comments (0)

Files changed (2)

etc/project-template/settings_production.py

 # Django settings for production deploys
 
-import os
-
+from os.path import join, abspath, dirname
 from planeta.settings import *
 
 
-BASE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+PROJECT_ROOT = abspath(dirname(dirname(dirname(__file__))))
 
 DEBUG = False
 TEMPLATE_DEBUG = DEBUG
 
 TEMPLATE_DIRS = []
 STATICFILES_DIRS = []
-MEDIA_ROOT = os.path.join(BASE_ROOT, 'media', 'user')
+MEDIA_ROOT = join(PROJECT_ROOT, 'media', 'user')
 MEDIA_URL = '/media/'
-STATIC_ROOT = os.path.join(BASE_ROOT, 'media', 'static')
+STATIC_ROOT = join(PROJECT_ROOT, 'media', 'static')
 STATIC_URL = '/static/'
 
 ROOT_URLCONF = 'planeta.urls'
 WSGI_APPLICATION = 'planeta.wsgi.application'
 
-HAYSTACK_WHOOSH_PATH = os.path.join(BASE_ROOT, '.whoosh-index')
+HAYSTACK_WHOOSH_PATH = join(PROJECT_ROOT, '.whoosh-index')
 
 # DATABASES = {
 #     'default': {

planeta/settings.py

 # Default planeta settings.
 
-import os
-
 
 DEBUG = True
 TEMPLATE_DEBUG = DEBUG
     'django.template.loaders.app_directories.Loader',
 ]
 
-MEDIA_ROOT = os.path.join('media', 'user')
+MEDIA_ROOT = None            # You must define it in your own settings
 MEDIA_URL = '/media/'
 
-STATIC_ROOT = os.path.join('media', 'static')
+STATIC_ROOT = None           # You must define it in your own settings
 STATIC_URL = '/static/'
 
 STATICFILES_DIRS = []
 # django-haystack < 2.0
 HAYSTACK_SITECONF = 'planeta.search_indexes'
 HAYSTACK_SEARCH_ENGINE = 'whoosh'
-HAYSTACK_WHOOSH_PATH = '.whoosh-index'
+HAYSTACK_WHOOSH_PATH = None  # You must define it in your own settings
 
 # django-haystack 2.0 beta
 # HAYSTACK_CONNECTIONS = {
 #     'default': {
 #         'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
-#         'PATH': '.whoosh-index',
+#         'PATH': None  # You must define it in your own settings
 #     },
 # }