diff --git a/app/limetime/conf/base.py b/app/limetime/conf/base.py index a1fa924..0dff4ea 100644 --- a/app/limetime/conf/base.py +++ b/app/limetime/conf/base.py @@ -1,100 +1,49 @@ -# Django settings for limetime project. +import os -DEBUG = True +DEBUG = False TEMPLATE_DEBUG = DEBUG -ADMINS = ( - # ('Your Name', 'your_email@example.com'), -) - -MANAGERS = ADMINS - -# Hosts/domain names that are valid for this site; required if DEBUG is False -# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts ALLOWED_HOSTS = [] -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# In a Windows environment this must be set to your system time zone. TIME_ZONE = 'UTC' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'en-us' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. USE_I18N = True - -# If you set this to False, Django will not format dates, numbers and -# calendars according to the current locale. USE_L10N = True - -# If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True -# Absolute filesystem path to the directory that will hold user-uploaded files. -# Example: "/var/www/example.com/media/" -MEDIA_ROOT = '' +MEDIA_ROOT = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'media') +MEDIA_URL = '/media/' -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash. -# Examples: "http://example.com/media/", "http://media.example.com/" -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: "/var/www/example.com/static/" -STATIC_ROOT = '' - -# URL prefix for static files. -# Example: "http://example.com/static/", "http://static.example.com/" +STATIC_ROOT = os.path.join(os.path.dirname(__file__), '..', '..', '..', 'static') STATIC_URL = '/static/' -# Additional locations of static files -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. -) +STATICFILES_DIRS = [ + os.path.join(os.path.dirname(__file__), '..', 'static'), + ] -# List of finder classes that know how to find static files in -# various locations. STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', ) -# Make this unique, and don't share it with anybody. -SECRET_KEY = '$+y3w%y3286wetd#tqhvqch$^ed)x=#s$we1c2)d1&lf9quktl' - -# List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', ) -MIDDLEWARE_CLASSES = ( +TEMPLATE_DIRS = [ + os.path.join(os.path.dirname(__file__), '..', 'templates'), +] + +MIDDLEWARE_CLASSES = [ 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', -) +] -ROOT_URLCONF = 'limetime.urls' - -# Python dotted path to the WSGI application used by Django's runserver. -WSGI_APPLICATION = 'limetime.wsgi.application' - -import os -TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), '../templates').replace('\\','/'),) - -INSTALLED_APPS = ( +INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -104,7 +53,13 @@ INSTALLED_APPS = ( 'django.contrib.admin', 'gunicorn', 'timer', -) +] + +SITE_ID = 1 +ROOT_URLCONF = 'limetime.urls' +WSGI_APPLICATION = 'limetime.wsgi.application' +SECRET_KEY = '$+y3w%y3286wetd#tqhvqch$^ed)x=#s$we1c2)d1&lf9quktl' +SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') LOGGING = { 'version': 1, diff --git a/app/limetime/conf/development.py b/app/limetime/conf/development.py index 9421b4b..f43de23 100644 --- a/app/limetime/conf/development.py +++ b/app/limetime/conf/development.py @@ -2,5 +2,24 @@ import os import dj_database_url from .base import * +DEBUG = True +TEMPLATE_DEBUG = DEBUG + default_db_url = 'sqlite:///%s' % os.path.join(os.path.dirname(__file__), '..', '..', '..', 'limetime.db3') DATABASES = {'default': dj_database_url.config(default=default_db_url)} + +INTERNAL_IPS = ('127.0.0.1', '192.168.0.1', '0.0.0.0') +INSTALLED_APPS.append('debug_toolbar') +MIDDLEWARE_CLASSES.append('debug_toolbar.middleware.DebugToolbarMiddleware') + +def custom_show_toolbar(request): + return True + +DEBUG_TOOLBAR_CONFIG = { + 'INTERCEPT_REDIRECTS': False, + 'SHOW_TOOLBAR_CALLBACK': custom_show_toolbar, + 'EXTRA_SIGNALS': [], + 'HIDE_DJANGO_SQL': True, + 'TAG': 'div', + 'ENABLE_STACKTRACES' : True, +} diff --git a/requirements.txt b/requirements.txt index 1491853..f71bdc0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ django>=1.5,<1.6 eveapi dj_database_url -gunicorn \ No newline at end of file +gunicorn +django_tastypie +django-debug-toolbar \ No newline at end of file