Skip to content

Instantly share code, notes, and snippets.

@gourneau
Created October 16, 2012 20:49
Show Gist options
  • Select an option

  • Save gourneau/3901910 to your computer and use it in GitHub Desktop.

Select an option

Save gourneau/3901910 to your computer and use it in GitHub Desktop.
local_settings.py
# Local settings for dev work
import os.path as path
TEST_INSTALL = True
DEBUG = True
## NOTE: Without this, uses system installed postgres database, shared between instances.
#DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
# 'NAME': 'rundb-dev.db', # 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.
# 'PORT': '', # Set to empty string for default. Not used with sqlite3.
# }
#}
MEDIA_ROOT = "/results/svn/TS/dbReports/iondb/media"
LOCALPATH = path.dirname(__file__)
TEMPLATE_DIRS = (
"/results/svn/TS/dbReports/iondb/templates",
)
# Override logging in local view
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'root': {
'level': 'DEBUG',
'handlers': ['default'],
},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
},
## NOTE: Handlers overridden with StreamHandler (console)
'handlers': {
'default': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
},
},
'loggers': {
# The logger name '' indicates the root of all loggers in Django, so
# logs from any application in this project will go here.
'': {
'handlers': ['default'],
'level': 'DEBUG',
'propagate': True
},
# When DEBUG is True, django.db will log every SQL query. That is too
# much stuff that we don't normally need, so it's logged elsewhere.
'django.db': {
'handlers': ['default'],
'level': 'INFO',
'propagate': False
},
}
}
TEST_INSTALL = True
DEBUG = True
TEMPLATE_DEBUG=True
TASTYPIE_FULL_DEBUG=True
# Add httpproxy to list of INSTALLED_APPS from settings.py
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.admindocs',
'django.contrib.sites',
'django.contrib.staticfiles',
'django.contrib.humanize',
'django.contrib.messages',
'iondb.rundb',
'tastypie',
'djcelery',
'south',
'endless_pagination',
## (NOTE: grab current list from settings.py and refresh above list of apps.')
############ ADD http proxy for test server ##############
'httpproxy',
'devserver',
'django_extensions',
)
# Configure http_proxy
# http proxy module for serving output from static server
PROXY_DOMAIN='localhost'
#PROXY_PORT=80
ROOT_URLCONF='iondb.local_urls'
# Serve static files in /output via httpproxy
# You might need this. Needs updating for django 1.4
#STATIC_URL = '/output/'
#STATICFILES_DIRS = (
# ('output', '/results/analysis/output/'),
#)
STATIC_ROOT = '/static/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment