diff --git a/.gitignore b/.gitignore index 49dd6b4..348d535 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ *.swp *.pyc -settings.py -dev.db +local_settings.py +db.sqlite3 static/.sass-cache uploads/[^.]* venv diff --git a/__init__.py b/bbssite/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from __init__.py rename to bbssite/__init__.py diff --git a/settings-sample.py b/bbssite/settings.py similarity index 87% rename from settings-sample.py rename to bbssite/settings.py index 23d17c1..ae01f39 100755 --- a/settings-sample.py +++ b/bbssite/settings.py @@ -1,10 +1,7 @@ # Django settings for bbs project. -from os.path import dirname, join - -def map_path(target_name): - # Enables path names to be decided at runtime. - return join(dirname(__file__), target_name).replace('\\', '/') +import os +BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -17,8 +14,8 @@ MANAGERS = ADMINS DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': 'dev.db', # Or path to database file if using sqlite3. + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': 'db.sqlite3', # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. @@ -78,7 +75,7 @@ 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. - map_path('static'), + os.path.join(BASE_DIR, 'static'), ) # List of finder classes that know how to find static files in @@ -87,7 +84,7 @@ STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'compressor.finders.CompressorFinder', - # 'django.contrib.staticfiles.finders.DefaultStorageFinder', +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) # Make this unique, and don't share it with anybody. @@ -97,7 +94,7 @@ SECRET_KEY = 'osv$uy-ea$*%lc)+xiwt5@2b7au%u*c!pa6hmh#vl)*+tp%fss' TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', - # 'django.template.loaders.eggs.Loader', +# 'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( @@ -108,13 +105,13 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', ) -ROOT_URLCONF = 'urls' +ROOT_URLCONF = 'bbssite.urls' TEMPLATE_DIRS = ( # 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. - map_path('templates'), + os.path.join(BASE_DIR, 'templates'), ) INSTALLED_APPS = ( @@ -130,6 +127,7 @@ INSTALLED_APPS = ( 'south', 'bootstrapform', 'compressor', +# 'django_extensions', ) # A sample logging configuration. The only tangible logging @@ -160,10 +158,16 @@ AUTH_PROFILE_MODULE = 'main.UserProfile' LOGIN_REDIRECT_URL = '/' -SESSION_COOKIE_AGE = 900 # 15 minutes +SESSION_COOKIE_AGE = 1209600 # 15 minutes SESSION_EXPIRE_AT_BROWSER_CLOSE = True BBS_SALDO_MAX = 600 BBS_LIMIT_DEPOSITS = False -COMPRESS_ENABLED = True \ No newline at end of file +if not DEBUG: + COMPRESS_ENABLED = True + +try: + from local_settings import * +except ImportError: + pass \ No newline at end of file diff --git a/urls.py b/bbssite/urls.py similarity index 100% rename from urls.py rename to bbssite/urls.py diff --git a/bbssite/wsgi.py b/bbssite/wsgi.py new file mode 100644 index 0000000..dcea718 --- /dev/null +++ b/bbssite/wsgi.py @@ -0,0 +1,6 @@ +import os +import django.core.handlers.wsgi + +os.environ['DJANGO_SETTINGS_MODULE'] = 'bbssite.settings' + +application = django.core.handlers.wsgi.WSGIHandler() diff --git a/django.wsgi b/django.wsgi deleted file mode 100644 index 65ad352..0000000 --- a/django.wsgi +++ /dev/null @@ -1,15 +0,0 @@ -import os -import sys -from os.path import dirname, join - -def map_path(target_name=''): - '''Enables path names to be decided at runtime.''' - return join(dirname(__file__), target_name).replace('\\', '/') - -os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' - -path = map_path(".") -if path not in sys.path: - sys.path.append(path) -import django.core.handlers.wsgi -application = django.core.handlers.wsgi.WSGIHandler() diff --git a/manage.py b/manage.py index f9726f9..327c2d9 100755 --- a/manage.py +++ b/manage.py @@ -3,7 +3,7 @@ import os import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bbssite.settings") from django.core.management import execute_from_command_line