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

Modify project directory to match Two Scoops 1.5

parent cd9b2d3c
......@@ -2,8 +2,8 @@
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.settings")
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "whats-open.settings.settings")
from django.core.management import execute_from_command_line
......
# Django settings for whats_open project.
import os
from os.path import abspath, basename, dirname, join, normpath
from sys import path
DEBUG = True
TEMPLATE_DEBUG = DEBUG
......@@ -9,12 +11,26 @@ ADMINS = ('Your Name', 'youremail@example.com')
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 = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': PROJECT_PATH + '/database.db'
'NAME': normpath(join(DJANGO_ROOT, 'database.db'))
}
}
......@@ -54,25 +70,20 @@ MEDIA_ROOT = ''
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(PROJECT_PATH, '..', 'website', 'static')
# STATIC FILE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
STATIC_ROOT = normpath(join(SITE_ROOT, 'assets'))
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'
# Additional locations of static files
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
normpath(join(SITE_ROOT, 'static')),
)
ADMIN_MEDIA_PREFIX = '/static/admin/'
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
......@@ -107,10 +118,10 @@ MIDDLEWARE_CLASSES = (
# '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.
WSGI_APPLICATION = 'settings.wsgi.application'
WSGI_APPLICATION = '%s.wsgi.application' % SITE_NAME
TEMPLATE_DIRS = (
# 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