Skip to content
This repository has been archived by the owner on Aug 26, 2023. It is now read-only.

Commit

Permalink
Better paths in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
gdetrez committed Nov 2, 2011
1 parent cc9c2c9 commit 7cb96f9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Django settings for myconf project.

import sys, os
from os.path import join

PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(PROJECT_ROOT, "apps"))
Expand Down Expand Up @@ -56,7 +57,7 @@

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ROOTDIR + '_uploads/'
MEDIA_ROOT = os.path.join(ROOTDIR,'_uploads/')

# URL that handles the static files served from STATIC_ROOT and collected by
# the collectstatic managment command. Make sure to use a
Expand All @@ -66,12 +67,12 @@

# Absolute path to the directory where static files are collected.
# Example: "/home/static/media.lawrence.com/"
STATIC_ROOT = ROOTDIR + "_static/"
STATIC_ROOT = os.path.join(ROOTDIR, "_static/")

# Extra directories where static files needs to be harvested
STATICFILES_DIRS = (
("style", ROOTDIR + "style/"),
("", ROOTDIR + "static/"),
("style", os.path.join(ROOTDIR, "style/")),
("", os.path.join(ROOTDIR, "static/")),
)

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
Expand All @@ -90,7 +91,7 @@
)

TEMPLATE_DIRS = (
ROOTDIR + "templates/"
os.path.join(ROOTDIR, "templates/"),
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
Expand Down

0 comments on commit 7cb96f9

Please sign in to comment.