Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move BASE one level up to simplify settings.

  • Loading branch information...
commit 5b71e973ebcf1c292fd76691caef6c454d79dc37 1 parent c5b01e7
Aymeric Augustin aaugustin authored
Showing with 9 additions and 9 deletions.
  1. +2 −2 django_docs/settings.py
  2. +7 −7 django_www/settings.py
4 django_docs/settings.py
View
@@ -21,7 +21,7 @@
# Where to store the build Sphinx docs.
if PRODUCTION:
- DOCS_BUILD_ROOT = BASE.ancestor(2).child('docbuilds')
+ DOCS_BUILD_ROOT = BASE.parent.child('docbuilds')
else:
DOCS_BUILD_ROOT = '/tmp/djangodocs'
@@ -29,7 +29,7 @@
HAYSTACK_SITECONF = 'docs.search_sites'
if PRODUCTION:
HAYSTACK_SEARCH_ENGINE = 'xapian'
- HAYSTACK_XAPIAN_PATH = BASE.ancestor(2).child('djangodocs.index')
+ HAYSTACK_XAPIAN_PATH = BASE.parent.child('djangodocs.index')
else:
HAYSTACK_SEARCH_ENGINE = 'whoosh'
HAYSTACK_WHOOSH_PATH = '/tmp/djangodocs.index'
14 django_www/settings.py
View
@@ -5,14 +5,14 @@
import platform
from unipath import FSPath as Path
-# The full path to the django_website directory.
-BASE = Path(__file__).absolute().ancestor(2).child('django_website')
+# The full path to the repository root.
+BASE = Path(__file__).absolute().ancestor(2)
# Far too clever trick to know if we're running on the deployment server.
PRODUCTION = ('DJANGOPROJECT_DEBUG' not in os.environ) and ("djangoproject" in platform.node())
# It's a secret to everybody
-SECRETS = json.load(open(BASE.ancestor(2).child('secrets.json')))
+SECRETS = json.load(open(BASE.parent.child('secrets.json')))
SECRET_KEY = str(SECRETS['secret_key'])
# SUPERFEEDR_CREDS is a 2 element list in the form of [email,secretkey]
SUPERFEEDR_CREDS = SECRETS.get('superfeedr_creds')
@@ -40,11 +40,11 @@
USE_I18N = False
USE_L10N = False
-MEDIA_ROOT = BASE.parent.child('media')
+MEDIA_ROOT = BASE.child('media')
MEDIA_URL = '/m/'
-TEMPLATE_DIRS = [BASE.parent.child('templates')]
-STATICFILES_DIRS = [BASE.parent.child('static')]
-STATIC_ROOT = BASE.parent.child('static_root')
+TEMPLATE_DIRS = [BASE.child('templates')]
+STATICFILES_DIRS = [BASE.child('static')]
+STATIC_ROOT = BASE.child('static_root')
STATIC_URL = '/s/'
if PRODUCTION:
Please sign in to comment.
Something went wrong with that request. Please try again.