Commit 7de2c6fa by David Ormsbee

update settings to remove server split between askbot and courseware

parent 4bc58c56
settings_old_askbot.py settings_new_askbot.py
\ No newline at end of file \ No newline at end of file
CSRF_COOKIE_DOMAIN = '127.0.0.1' import os
import sys
import djcelery
if 'COURSEWARE_ENABLED' not in locals(): import askbot
COURSEWARE_ENABLED = True import site
if 'ASKBOT_ENABLED' not in locals():
ASKBOT_ENABLED = True COURSEWARE_ENABLED = True
if not COURSEWARE_ENABLED: ASKBOT_ENABLED = True
ASKBOT_ENABLED = False
CSRF_COOKIE_DOMAIN = '127.0.0.1'
# Defaults to be overridden # Defaults to be overridden
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
...@@ -30,7 +34,7 @@ DEBUG = True ...@@ -30,7 +34,7 @@ DEBUG = True
TEMPLATE_DEBUG = DEBUG TEMPLATE_DEBUG = DEBUG
ADMINS = ( ADMINS = (
('Piotr Mitros', 'pmitros@csail.mit.edu'), ('Piotr Mitros', 'pmitros@csail.mit.edu'),
) )
MANAGERS = ADMINS MANAGERS = ADMINS
...@@ -59,7 +63,6 @@ STATIC_URL = '/static/' ...@@ -59,7 +63,6 @@ STATIC_URL = '/static/'
# Examples: "http://foo.com/static/admin/", "/static/admin/". # Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/' 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 = (
...@@ -76,14 +79,14 @@ TEMPLATE_LOADERS = ( ...@@ -76,14 +79,14 @@ TEMPLATE_LOADERS = (
) )
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'track.middleware.TrackMiddleware', 'track.middleware.TrackMiddleware',
'djangomako.middleware.MakoMiddleware', 'djangomako.middleware.MakoMiddleware',
#'debug_toolbar.middleware.DebugToolbarMiddleware', #'debug_toolbar.middleware.DebugToolbarMiddleware',
) )
ROOT_URLCONF = 'mitx.urls' ROOT_URLCONF = 'mitx.urls'
...@@ -140,118 +143,113 @@ TRACK_MAX_EVENT = 1000 ...@@ -140,118 +143,113 @@ TRACK_MAX_EVENT = 1000
# Maximum length of log file before starting a new one. # Maximum length of log file before starting a new one.
MAXLOG = 500 MAXLOG = 500
execfile("../settings.py") # Our parent dir (mitx_all) is the BASE_DIR
BASE_DIR = os.path.abspath(os.path.join(__file__, "..", ".."))
# Make sure we execute correctly regardless of where we're called from
execfile(os.path.join(BASE_DIR, "settings.py"))
if PERFSTATS : if PERFSTATS :
MIDDLEWARE_CLASSES = ( 'perfstats.middleware.ProfileMiddleware',) + MIDDLEWARE_CLASSES MIDDLEWARE_CLASSES = ( 'perfstats.middleware.ProfileMiddleware',) + MIDDLEWARE_CLASSES
if 'TRACK_DIR' not in locals(): if 'TRACK_DIR' not in locals():
TRACK_DIR = BASE_DIR+'/track_dir/' TRACK_DIR = BASE_DIR+'/track_dir/'
if 'STATIC_ROOT' not in locals(): if 'STATIC_ROOT' not in locals():
STATIC_ROOT = BASE_DIR+'/staticroot/' STATIC_ROOT = BASE_DIR+'/staticroot/'
if 'DATA_DIR' not in locals(): if 'DATA_DIR' not in locals():
DATA_DIR = BASE_DIR+'/data/' DATA_DIR = BASE_DIR+'/data/'
if 'TEXTBOOK_DIR' not in locals(): if 'TEXTBOOK_DIR' not in locals():
TEXTBOOK_DIR = BASE_DIR+'/textbook/' TEXTBOOK_DIR = BASE_DIR+'/textbook/'
if 'TEMPLATE_DIRS' not in locals(): if 'TEMPLATE_DIRS' not in locals():
TEMPLATE_DIRS = ( TEMPLATE_DIRS = (
BASE_DIR+'/templates/', BASE_DIR+'/templates/',
DATA_DIR+'/templates', DATA_DIR+'/templates',
TEXTBOOK_DIR, TEXTBOOK_DIR,
) )
if 'STATICFILES_DIRS' not in locals(): if 'STATICFILES_DIRS' not in locals():
STATICFILES_DIRS = ( STATICFILES_DIRS = (
BASE_DIR+'/3rdParty/static', BASE_DIR+'/3rdParty/static',
BASE_DIR+'/static', BASE_DIR+'/static',
) )
if ASKBOT_ENABLED: if 'ASKBOT_EXTRA_SKINS_DIR' not in locals():
import sys ASKBOT_EXTRA_SKINS_DIR = BASE_DIR+'/askbot-devel/askbot/skins'
if 'ASKBOT_DIR' not in locals():
if 'ASKBOT_EXTRA_SKINS_DIR' not in locals(): ASKBOT_DIR = BASE_DIR+'/askbot-devel'
ASKBOT_EXTRA_SKINS_DIR = BASE_DIR+'/askbot-devel/askbot/skins'
if 'ASKBOT_DIR' not in locals(): STATICFILES_DIRS = STATICFILES_DIRS + ( ASKBOT_DIR+'/askbot/skins',)
ASKBOT_DIR = BASE_DIR+'/askbot-devel'
# Needed for Askbot
STATICFILES_DIRS = STATICFILES_DIRS + ( ASKBOT_DIR+'/askbot/skins',) # Critical TODO: Move to S3
MEDIA_URL = '/discussion/upfiles/'
# Needed for Askbot MEDIA_ROOT = ASKBOT_DIR+'/askbot/upfiles'
# Critical TODO: Move to S3
MEDIA_URL = '/discussion/upfiles/' ASKBOT_ROOT = os.path.dirname(askbot.__file__)
MEDIA_ROOT = ASKBOT_DIR+'/askbot/upfiles'
site.addsitedir(os.path.join(os.path.dirname(askbot.__file__), 'deps'))
print "!!!", ASKBOT_DIR TEMPLATE_LOADERS = TEMPLATE_LOADERS + ('askbot.skins.loaders.filesystem_load_template_source',)
sys.path.append(ASKBOT_DIR)
import os MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
import askbot 'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
ASKBOT_ROOT = os.path.dirname(askbot.__file__)
import site
site.addsitedir(os.path.join(os.path.dirname(askbot.__file__), 'deps'))
TEMPLATE_LOADERS = TEMPLATE_LOADERS + ('askbot.skins.loaders.filesystem_load_template_source',)
MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
'askbot.middleware.forum_mode.ForumModeMiddleware', 'askbot.middleware.forum_mode.ForumModeMiddleware',
'askbot.middleware.cancel.CancelActionMiddleware', 'askbot.middleware.cancel.CancelActionMiddleware',
'django.middleware.transaction.TransactionMiddleware', 'django.middleware.transaction.TransactionMiddleware',
#'debug_toolbar.middleware.DebugToolbarMiddleware', #'debug_toolbar.middleware.DebugToolbarMiddleware',
'askbot.middleware.view_log.ViewLogMiddleware', 'askbot.middleware.view_log.ViewLogMiddleware',
'askbot.middleware.spaceless.SpacelessMiddleware', 'askbot.middleware.spaceless.SpacelessMiddleware',
) 'askbot.middleware.pagesize.QuestionsPageSizeMiddleware',
)
FILE_UPLOAD_TEMP_DIR = os.path.join(
os.path.dirname(__file__), FILE_UPLOAD_TEMP_DIR = os.path.join(os.path.dirname(__file__), 'tmp').replace('\\','/')
'tmp' FILE_UPLOAD_HANDLERS = (
).replace('\\','/') 'django.core.files.uploadhandler.MemoryFileUploadHandler',
FILE_UPLOAD_HANDLERS = ( 'django.core.files.uploadhandler.TemporaryFileUploadHandler',
'django.core.files.uploadhandler.MemoryFileUploadHandler', )
'django.core.files.uploadhandler.TemporaryFileUploadHandler', ASKBOT_ALLOWED_UPLOAD_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
) ASKBOT_MAX_UPLOAD_FILE_SIZE = 1024 * 1024 #result in bytes
ASKBOT_ALLOWED_UPLOAD_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
ASKBOT_MAX_UPLOAD_FILE_SIZE = 1024 * 1024 #result in bytes
# ASKBOT_FILE_UPLOAD_DIR = os.path.join(os.path.dirname(__file__), 'askbot', 'upfiles') # ASKBOT_FILE_UPLOAD_DIR = os.path.join(os.path.dirname(__file__), 'askbot', 'upfiles')
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
PROJECT_ROOT = os.path.dirname(__file__) PROJECT_ROOT = os.path.dirname(__file__)
TEMPLATE_CONTEXT_PROCESSORS = ( TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request', 'django.core.context_processors.request',
'askbot.context.application_settings', 'askbot.context.application_settings',
#'django.core.context_processors.i18n', #'django.core.context_processors.i18n',
'askbot.user_messages.context_processors.user_messages',#must be before auth 'askbot.user_messages.context_processors.user_messages',#must be before auth
'django.core.context_processors.auth', #this is required for admin 'django.core.context_processors.auth', #this is required for admin
'django.core.context_processors.csrf', #necessary for csrf protection 'django.core.context_processors.csrf', #necessary for csrf protection
) )
INSTALLED_APPS = INSTALLED_APPS + ( INSTALLED_APPS = INSTALLED_APPS + (
'django.contrib.sitemaps', 'django.contrib.sitemaps',
'django.contrib.admin', 'django.contrib.admin',
'south', 'south',
'askbot.deps.livesettings', 'askbot.deps.livesettings',
'askbot', 'askbot',
#'keyedcache', # TODO: Main askbot tree has this installed, but we get intermittent errors if we include it. #'keyedcache', # TODO: Main askbot tree has this installed, but we get intermittent errors if we include it.
'robots', 'robots',
'django_countries', 'django_countries',
'djcelery', 'djcelery',
'djkombu', 'djkombu',
'followit', 'followit',
) )
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
ASKBOT_URL = 'discussion/' ASKBOT_URL = 'discussion/'
LOGIN_REDIRECT_URL = '/' LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/' LOGIN_URL = '/'
# ASKBOT_UPLOADED_FILES_URL = '%s%s' % (ASKBOT_URL, 'upfiles/') # ASKBOT_UPLOADED_FILES_URL = '%s%s' % (ASKBOT_URL, 'upfiles/')
ALLOW_UNICODE_SLUGS = False ALLOW_UNICODE_SLUGS = False
ASKBOT_USE_STACKEXCHANGE_URLS = False #mimic url scheme of stackexchange ASKBOT_USE_STACKEXCHANGE_URLS = False #mimic url scheme of stackexchange
ASKBOT_CSS_DEVEL = True ASKBOT_CSS_DEVEL = True
#Celery Settings # Celery Settings
BROKER_TRANSPORT = "djkombu.transport.DatabaseTransport" BROKER_TRANSPORT = "djkombu.transport.DatabaseTransport"
CELERY_ALWAYS_EAGER = True CELERY_ALWAYS_EAGER = True
import djcelery djcelery.setup_loader()
djcelery.setup_loader()
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