Commit 177deab8 authored by Renfred Harper's avatar Renfred Harper
Browse files

Modify project directory to match Two Scoops 1.5

parent cd9b2d3c
# Django settings for whats_open project. # Django settings for whats_open project.
import os import os
from os.path import abspath, basename, dirname, join, normpath
from sys import path
DEBUG = True DEBUG = True
TEMPLATE_DEBUG = DEBUG TEMPLATE_DEBUG = DEBUG
...@@ -9,12 +11,26 @@ ADMINS = ('Your Name', 'youremail@example.com') ...@@ -9,12 +11,26 @@ ADMINS = ('Your Name', 'youremail@example.com')
MANAGERS = ADMINS MANAGERS = ADMINS
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) # PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
# Absolute filesystem path to the top-level project folder:
PROJECT_PATH = dirname(DJANGO_ROOT)
SITE_ROOT = dirname(DJANGO_ROOT)
# Site name:
SITE_NAME = basename(DJANGO_ROOT)
# Add our project to our pythonpath, this way we don't need to type our project
# name in our dotted import paths:
path.append(DJANGO_ROOT)
# DATABASE SETTINGS
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.sqlite3',
'NAME': PROJECT_PATH + '/database.db' 'NAME': normpath(join(DJANGO_ROOT, 'database.db'))
} }
} }
...@@ -54,25 +70,20 @@ MEDIA_ROOT = '' ...@@ -54,25 +70,20 @@ MEDIA_ROOT = ''
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '' MEDIA_URL = ''
# Absolute path to the directory static files should be collected to. # STATIC FILE CONFIGURATION
# Don't put anything in this directory yourself; store your static files # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
# in apps' "static/" subdirectories and in STATICFILES_DIRS. STATIC_ROOT = normpath(join(SITE_ROOT, 'assets'))
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(PROJECT_PATH, '..', 'website', 'static')
# URL prefix for static files. # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/' STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/' # See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
# Additional locations of static files
STATICFILES_DIRS = ( STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static". normpath(join(SITE_ROOT, 'static')),
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
) )
ADMIN_MEDIA_PREFIX = '/static/admin/'
# List of finder classes that know how to find static files in # List of finder classes that know how to find static files in
# various locations. # various locations.
STATICFILES_FINDERS = ( STATICFILES_FINDERS = (
...@@ -107,10 +118,10 @@ MIDDLEWARE_CLASSES = ( ...@@ -107,10 +118,10 @@ MIDDLEWARE_CLASSES = (
# 'django.middleware.clickjacking.XFrameOptionsMiddleware', # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
) )
ROOT_URLCONF = 'settings.urls' ROOT_URLCONF = '%s.urls' % SITE_NAME
# Python dotted path to the WSGI application used by Django's runserver. # Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'settings.wsgi.application' WSGI_APPLICATION = '%s.wsgi.application' % SITE_NAME
TEMPLATE_DIRS = ( TEMPLATE_DIRS = (
# os.path.join(PROJECT_PATH, 'templates'), # os.path.join(PROJECT_PATH, 'templates'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment