diff options
author | Vlad Bokov <razum2um@mail.ru> | 2011-11-22 00:20:10 +0700 |
---|---|---|
committer | Vlad Bokov <razum2um@mail.ru> | 2011-11-22 00:20:10 +0700 |
commit | f35aab2070aa5884ac7b82666af81d4375211fe7 (patch) | |
tree | c2f43f585e18385beef653030c9f961c54f8741a /askbot/setup_templates | |
parent | 4c96420696c5e2000676a5801a32e8630ce8487f (diff) | |
parent | 14fc18e71f598bb7548848ed0cb840693ae6b9fd (diff) | |
download | askbot-f35aab2070aa5884ac7b82666af81d4375211fe7.tar.gz askbot-f35aab2070aa5884ac7b82666af81d4375211fe7.tar.bz2 askbot-f35aab2070aa5884ac7b82666af81d4375211fe7.zip |
Merge branch 'master' into R111_closed_forum_mode
Diffstat (limited to 'askbot/setup_templates')
-rw-r--r-- | askbot/setup_templates/settings.py | 12 | ||||
-rw-r--r-- | askbot/setup_templates/settings.py.mustache | 220 |
2 files changed, 227 insertions, 5 deletions
diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py index 20598463..e8adc2ce 100644 --- a/askbot/setup_templates/settings.py +++ b/askbot/setup_templates/settings.py @@ -40,7 +40,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' #go to the site's live settings and enable the feature #"Email settings" -> "allow asking by email" # -# WARNING: command post_emailed_questions DELETES all +# WARNING: command post_emailed_questions DELETES all # emails from the mailbox each time # do not use your personal mail box here!!! # @@ -78,7 +78,7 @@ PROJECT_ROOT = os.path.dirname(__file__) ADMIN_MEDIA_PREFIX = '/admin/media/' # Make up some unique string, and don't share it with anybody. -SECRET_KEY = 'sdljdfjkldsflsdjkhsjkldgjlsdgfs s ' +SECRET_KEY = 'sdljdfjkldsflsdjkhsjkldgjlsdgfs s ' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( @@ -117,7 +117,7 @@ ROOT_URLCONF = os.path.basename(os.path.dirname(__file__)) + '.urls' #UPLOAD SETTINGS FILE_UPLOAD_TEMP_DIR = os.path.join( - os.path.dirname(__file__), + os.path.dirname(__file__), 'tmp' ).replace('\\','/') @@ -177,6 +177,7 @@ CACHE_BACKEND = 'locmem://' #needed for django-keyedcache CACHE_TIMEOUT = 6000 CACHE_PREFIX = 'askbot' #make this unique +CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True #If you use memcache you may want to uncomment the following line to enable memcached based sessions #SESSION_ENGINE = 'django.contrib.sessions.backends.cache_db' @@ -200,6 +201,7 @@ logging.basicConfig( # ASKBOT_URL = 'forum/' # ASKBOT_URL = '' #no leading slash, default = '' empty string +ASKBOT_TRANSLATE_URL = True #translate specific URLs _ = lambda v:v #fake translation function for the login url LOGIN_URL = '/%s%s%s' % (ASKBOT_URL,_('account/'),_('signin/')) #note - it is important that upload dir url is NOT translated!!! @@ -210,11 +212,11 @@ ASKBOT_USE_STACKEXCHANGE_URLS = False #mimic url scheme of stackexchange ASKBOT_CLOSED_FORUM_MODE = False #Celery Settings -BROKER_BACKEND = "djkombu.transport.DatabaseTransport" +BROKER_TRANSPORT = "djkombu.transport.DatabaseTransport" CELERY_ALWAYS_EAGER = True import djcelery djcelery.setup_loader() -CSRF_COOKIE_NAME = 'askbot_scrf' +CSRF_COOKIE_NAME = 'askbot_csrf' CSRF_COOKIE_DOMAIN = ''#enter domain name here - e.g. example.com diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache new file mode 100644 index 00000000..081f37fa --- /dev/null +++ b/askbot/setup_templates/settings.py.mustache @@ -0,0 +1,220 @@ +## Django settings for ASKBOT enabled project. +import os.path +import logging +import sys +import askbot + +#this line is added so that we can import pre-packaged askbot dependencies +sys.path.append(os.path.join(os.path.dirname(askbot.__file__), 'deps')) + +DEBUG = False#set to True to enable debugging +TEMPLATE_DEBUG = False#keep false when debugging jinja2 templates +INTERNAL_IPS = ('127.0.0.1',) + +ADMINS = ( + ('Your Name', 'your_email@domain.com'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'postgresql_psycopg2' # only postgres (>8.3) and mysql are supported so far others have not been tested yet +DATABASE_NAME = '{{database_name}}' # Or path to database file if using sqlite3. +DATABASE_USER = '{{database_user}}' # Not used with sqlite3. +DATABASE_PASSWORD = '{{database_password}}' # Not used with sqlite3. +DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +#outgoing mail server settings +SERVER_EMAIL = '' +DEFAULT_FROM_EMAIL = '' +EMAIL_HOST_USER = '' +EMAIL_HOST_PASSWORD = '' +EMAIL_SUBJECT_PREFIX = '' +EMAIL_HOST='' +EMAIL_PORT='' +EMAIL_USE_TLS=False +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' + +#incoming mail settings +#after filling out these settings - please +#go to the site's live settings and enable the feature +#"Email settings" -> "allow asking by email" +# +# WARNING: command post_emailed_questions DELETES all +# emails from the mailbox each time +# do not use your personal mail box here!!! +# +IMAP_HOST = '' +IMAP_HOST_USER = '' +IMAP_HOST_PASSWORD = '' +IMAP_PORT = '' +IMAP_USE_TLS = False + +# 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. +# On Unix systems, a value of None will cause Django to use the same +# timezone as the operating system. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'America/Chicago' + +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 +LANGUAGE_CODE = 'en' + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +ASKBOT_FILE_UPLOAD_DIR = os.path.join(os.path.dirname(__file__), 'askbot', 'upfiles') + +PROJECT_ROOT = os.path.dirname(__file__) + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/admin/media/' + +# Make up some unique string, and don't share it with anybody. +SECRET_KEY = 'sdljdfjkldsflsdjkhsjkldgjlsdgfs s ' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', + #below is askbot stuff for this tuple + 'askbot.skins.loaders.filesystem_load_template_source', + #'django.template.loaders.eggs.load_template_source', +) + + +MIDDLEWARE_CLASSES = ( + #'django.middleware.gzip.GZipMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + #'django.middleware.cache.UpdateCacheMiddleware', + 'django.middleware.common.CommonMiddleware', + #'django.middleware.cache.FetchFromCacheMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + #'django.middleware.sqlprint.SqlPrintingMiddleware', + + #below is askbot stuff for this tuple + 'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware', + 'askbot.middleware.pagesize.QuestionsPageSizeMiddleware', + 'askbot.middleware.cancel.CancelActionMiddleware', + 'django.middleware.transaction.TransactionMiddleware', + #'debug_toolbar.middleware.DebugToolbarMiddleware', + 'askbot.middleware.view_log.ViewLogMiddleware', + 'askbot.middleware.spaceless.SpacelessMiddleware', +) + + +ROOT_URLCONF = os.path.basename(os.path.dirname(__file__)) + '.urls' + + +#UPLOAD SETTINGS +FILE_UPLOAD_TEMP_DIR = os.path.join( + os.path.dirname(__file__), + 'tmp' + ).replace('\\','/') + +FILE_UPLOAD_HANDLERS = ( + '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 +DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' + + +#TEMPLATE_DIRS = (,) #template have no effect in askbot, use the variable below +#ASKBOT_EXTRA_SKIN_DIR = #path to your private skin collection +#take a look here http://askbot.org/en/question/207/ + +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.core.context_processors.request', + 'askbot.context.application_settings', + #'django.core.context_processors.i18n', + '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.csrf', #necessary for csrf protection +) + + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + + #all of these are needed for the askbot + 'django.contrib.admin', + 'django.contrib.humanize', + 'django.contrib.sitemaps', + #'debug_toolbar', + 'askbot', + 'askbot.deps.django_authopenid', + #'askbot.importers.stackexchange', #se loader + 'south', + 'askbot.deps.livesettings', + 'keyedcache', + 'robots', + 'django_countries', + 'djcelery', + 'djkombu', + 'followit', + #'avatar',#experimental use git clone git://github.com/ericflo/django-avatar.git$ + #requires setting of MEDIA_ROOT and MEDIA_URL +) + + +#setup memcached for production use! +#see http://docs.djangoproject.com/en/1.1/topics/cache/ for details +CACHE_BACKEND = 'locmem://' +#needed for django-keyedcache +CACHE_TIMEOUT = 6000 +CACHE_PREFIX = 'askbot' #make this unique +CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True +#If you use memcache you may want to uncomment the following line to enable memcached based sessions +#SESSION_ENGINE = 'django.contrib.sessions.backends.cache_db' + +AUTHENTICATION_BACKENDS = ( + 'django.contrib.auth.backends.ModelBackend', + 'askbot.deps.django_authopenid.backends.AuthBackend', +) + +#logging settings +LOG_FILENAME = 'askbot.log' +logging.basicConfig( + filename=os.path.join(os.path.dirname(__file__), 'log', LOG_FILENAME), + level=logging.CRITICAL, + format='%(pathname)s TIME: %(asctime)s MSG: %(filename)s:%(funcName)s:%(lineno)d %(message)s', +) + +########################### +# +# this will allow running your forum with url like http://site.com/forum +# +# ASKBOT_URL = 'forum/' +# +ASKBOT_URL = '' #no leading slash, default = '' empty string +ASKBOT_TRANSLATE_URL = True #translate specific URLs +_ = lambda v:v #fake translation function for the login url +LOGIN_URL = '/%s%s%s' % (ASKBOT_URL,_('account/'),_('signin/')) +#note - it is important that upload dir url is NOT translated!!! +#also, this url must not have the leading slash +ASKBOT_UPLOADED_FILES_URL = '%s%s' % (ASKBOT_URL, 'upfiles/') +ALLOW_UNICODE_SLUGS = False +ASKBOT_USE_STACKEXCHANGE_URLS = False #mimic url scheme of stackexchange + +#Celery Settings +BROKER_TRANSPORT = "djkombu.transport.DatabaseTransport" +CELERY_ALWAYS_EAGER = True + +import djcelery +djcelery.setup_loader() +DOMAIN_NAME = '{{domain_name}}' + +CSRF_COOKIE_NAME = '{{domain_name}}_csrf' +CSRF_COOKIE_DOMAIN = DOMAIN_NAME |