From faf167aed99ac4e28927f729b7c7bc94a47ef139 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 26 Jul 2009 22:33:56 -0400 Subject: merged in latest Mikes changes --- settings.py | 95 ++++++++++++++++--------------------------------------------- 1 file changed, 25 insertions(+), 70 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index 88dd0cc7..985de51a 100644 --- a/settings.py +++ b/settings.py @@ -1,51 +1,24 @@ +# encoding:utf-8 # Django settings for lanai project. import os.path +#DEBUG SETTINGS DEBUG = True TEMPLATE_DEBUG = DEBUG - - -#David Cramer debug toolbar INTERNAL_IPS = ('127.0.0.1',) -DEBUG_TOOLBAR_PANELS = ( - 'debug_toolbar.panels.sql.SQLDebugPanel', - 'debug_toolbar.panels.headers.HeaderDebugPanel', - 'debug_toolbar.panels.cache.CacheDebugPanel', - 'debug_toolbar.panels.profiler.ProfilerDebugPanel', - 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', - 'debug_toolbar.panels.templates.TemplatesDebugPanel', - # If you are using the profiler panel you don't need the timer - # 'debug_toolbar.panels.timer.TimerDebugPanel', -) - -DEBUG_TOOLBAR_CONFIG = { - "INTERCEPT_REDIRECTS":False -} #for OpenID auth ugettext = lambda s: s LOGIN_URL = '/%s%s' % (ugettext('account/'), ugettext('signin/')) -#system will send admins email about error stacktrace if DEBUG=False +#EMAIL AND ADMINS ADMINS = ( - ('you', 'you@where.com'), + ('CNProg team', 'team@cnprog.com'), ) - MANAGERS = ADMINS -DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -#DATABASE_NAME = 'cnprog' # Or path to database file if using sqlite3. -#DATABASE_USER = 'root' # Not used with sqlite3. -#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. - -DATABASE_NAME = 'dbname' # Or path to database file if using sqlite3. -DATABASE_USER = 'dbuser' # Not used with sqlite3. -DATABASE_PASSWORD = 'dbpass' # Not used with sqlite3. - -SERVER_EMAIL = 'server@where.com' -DEFAULT_FROM_EMAIL = 'from@where.com' +SERVER_EMAIL = 'webmaster@cnprog.com' +DEFAULT_FROM_EMAIL = 'webmaster@cnprog.com' EMAIL_HOST_USER = '' EMAIL_HOST_PASSWORD = '' EMAIL_SUBJECT_PREFIX = '[cnprog.com]' @@ -53,44 +26,21 @@ EMAIL_HOST='smtp.gmail.com' EMAIL_PORT='587' EMAIL_USE_TLS=True - - - -# 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. -# If running in a Windows environment this must be set to the same as your -# system time zone. -TIME_ZONE = 'America/Chicago' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -#LANGUAGE_CODE = 'en' +#LOCALIZATIONS +TIME_ZONE = 'Asia/Chongqing Asia/Chungking' +# LANGUAGE_CODE = 'en-us' LANGUAGE_CODE = 'zh-cn' - 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 -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = '/var/www/vhosts/cnprog/templates/upfiles/' - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = 'http://where.com/upfiles/' - -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". +#OTHER SETTINS +APP_TITLE = u'CNProg.com 程序员问答社区' +APP_URL = 'http://www.cnprog.com' +APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客' +APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。' +APP_INTRO = u'

CNProg是一个面向程序员的可协作编辑的开放源代码问答社区

您可以在这里提问各类程序技术问题 - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。

' ADMIN_MEDIA_PREFIX = '/admin/media/' - -# Make this unique, and don't share it with anybody. -SECRET_KEY = '$oo^&_m&qwbib=ffljk_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' - +SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', @@ -105,12 +55,15 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.transaction.TransactionMiddleware', - 'debug_toolbar.middleware.DebugToolbarMiddleware', + #'django.middleware.sqlprint.SqlPrintingMiddleware', + 'middleware.pagesize.QuestionsPageSizeMiddleware', + #'debug_toolbar.middleware.DebugToolbarMiddleware', ) TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', 'django.core.context_processors.auth', + 'context.application_settings' ) ROOT_URLCONF = 'urls' @@ -119,6 +72,7 @@ TEMPLATE_DIRS = ( os.path.join(os.path.dirname(__file__), 'templates').replace('\\','/'), ) +#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",) @@ -139,6 +93,7 @@ INSTALLED_APPS = ( 'django_authopenid', 'debug_toolbar' , ) -#local configs -from settings_local import * - + +# User settings +from settings_local import * + -- cgit v1.2.3-1-g7c22 From 20a7ce5657bf3d8683bdb4f9b860dbad044fb2f3 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 4 Aug 2009 23:25:57 -0400 Subject: included changes by Adolfo and Chaitanya and found temporary fix for languages --- settings.py | 199 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 100 insertions(+), 99 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index 985de51a..e2d384c1 100644 --- a/settings.py +++ b/settings.py @@ -1,99 +1,100 @@ -# encoding:utf-8 -# Django settings for lanai project. -import os.path - -#DEBUG SETTINGS -DEBUG = True -TEMPLATE_DEBUG = DEBUG -INTERNAL_IPS = ('127.0.0.1',) - -#for OpenID auth -ugettext = lambda s: s -LOGIN_URL = '/%s%s' % (ugettext('account/'), ugettext('signin/')) - -#EMAIL AND ADMINS -ADMINS = ( - ('CNProg team', 'team@cnprog.com'), -) -MANAGERS = ADMINS - -SERVER_EMAIL = 'webmaster@cnprog.com' -DEFAULT_FROM_EMAIL = 'webmaster@cnprog.com' -EMAIL_HOST_USER = '' -EMAIL_HOST_PASSWORD = '' -EMAIL_SUBJECT_PREFIX = '[cnprog.com]' -EMAIL_HOST='smtp.gmail.com' -EMAIL_PORT='587' -EMAIL_USE_TLS=True - -#LOCALIZATIONS -TIME_ZONE = 'Asia/Chongqing Asia/Chungking' -# LANGUAGE_CODE = 'en-us' -LANGUAGE_CODE = 'zh-cn' -SITE_ID = 1 -USE_I18N = True - -#OTHER SETTINS -APP_TITLE = u'CNProg.com 程序员问答社区' -APP_URL = 'http://www.cnprog.com' -APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客' -APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。' -APP_INTRO = u'

CNProg是一个面向程序员的可协作编辑的开放源代码问答社区

您可以在这里提问各类程序技术问题 - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。

' -ADMIN_MEDIA_PREFIX = '/admin/media/' -SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' -# 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', -# 'django.template.loaders.eggs.load_template_source', -) - -MIDDLEWARE_CLASSES = ( - 'django.middleware.gzip.GZipMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.locale.LocaleMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.middleware.transaction.TransactionMiddleware', - #'django.middleware.sqlprint.SqlPrintingMiddleware', - 'middleware.pagesize.QuestionsPageSizeMiddleware', - #'debug_toolbar.middleware.DebugToolbarMiddleware', -) - -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.core.context_processors.request', - 'django.core.context_processors.auth', - 'context.application_settings' -) - -ROOT_URLCONF = 'urls' - -TEMPLATE_DIRS = ( - os.path.join(os.path.dirname(__file__), 'templates').replace('\\','/'), -) - -#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",) -DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' -# for user upload -ALLOW_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff') -# unit byte -ALLOW_MAX_FILE_SIZE = 1024 * 1024 - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.admin', - 'django.contrib.humanize', - 'forum', - 'django_authopenid', - 'debug_toolbar' , -) - -# User settings -from settings_local import * - +# encoding:utf-8 +# Django settings for lanai project. +import os.path + +#DEBUG SETTINGS +DEBUG = True +TEMPLATE_DEBUG = DEBUG +INTERNAL_IPS = ('127.0.0.1',) + +#for OpenID auth +ugettext = lambda s: s +LOGIN_URL = '/%s%s' % (ugettext('account/'), ugettext('signin/')) + +#EMAIL AND ADMINS +ADMINS = ( + ('CNProg team', 'team@cnprog.com'), +) +MANAGERS = ADMINS + +SERVER_EMAIL = '' +DEFAULT_FROM_EMAIL = '' +EMAIL_HOST_USER = '' +EMAIL_HOST_PASSWORD = '' +EMAIL_SUBJECT_PREFIX = '[cnprog.com]' +EMAIL_HOST='smtp.gmail.com' +EMAIL_PORT='587' +EMAIL_USE_TLS=True + +#LOCALIZATIONS +TIME_ZONE = 'Asia/Chongqing Asia/Chungking' +# LANGUAGE_CODE = 'en-us' +SITE_ID = 1 + +#OTHER SETTINS +APP_TITLE = u'CNProg.com 程序员问答社区' +APP_URL = 'http://www.cnprog.com' +APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客' +APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。' +APP_INTRO = u'

CNProg是一个面向程序员的可协作编辑的开放源代码问答社区

您可以在这里提问各类程序技术问题 - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。

' +ADMIN_MEDIA_PREFIX = '/admin/media/' +SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' +# 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', +# 'django.template.loaders.eggs.load_template_source', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.gzip.GZipMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + #'django.middleware.locale.LocaleMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.middleware.transaction.TransactionMiddleware', + #'django.middleware.sqlprint.SqlPrintingMiddleware', + #'middleware.pagesize.QuestionsPageSizeMiddleware', + #'debug_toolbar.middleware.DebugToolbarMiddleware', +) + +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.core.context_processors.request', + 'django.core.context_processors.auth', + 'context.application_settings', + #'django.core.context_processors.i18n', +) + +ROOT_URLCONF = 'urls' + +TEMPLATE_DIRS = ( + os.path.join(os.path.dirname(__file__), 'templates').replace('\\','/'), +) + +#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",) +DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' +# for user upload +ALLOW_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff') +# unit byte +ALLOW_MAX_FILE_SIZE = 1024 * 1024 + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'django.contrib.humanize', + 'forum', + 'django_authopenid', + 'debug_toolbar' , +) + +# User settings +from settings_local import * + +USE_I18N = True +LANGUAGE_CODE = 'en' -- cgit v1.2.3-1-g7c22 From ef8f66ba6c7a22c277c6315df8040365b5684e6c Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 5 Aug 2009 22:50:08 -0400 Subject: added anonymous posting, per-question subscription and fixes by Pothers and some more, see development.log --- settings.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index e2d384c1..fac3c0d5 100644 --- a/settings.py +++ b/settings.py @@ -17,8 +17,9 @@ ADMINS = ( ) MANAGERS = ADMINS +#email server settings SERVER_EMAIL = '' -DEFAULT_FROM_EMAIL = '' +DEFAULT_FROM_EMAIL = 'team@cnprog.com' EMAIL_HOST_USER = '' EMAIL_HOST_PASSWORD = '' EMAIL_SUBJECT_PREFIX = '[cnprog.com]' @@ -31,12 +32,12 @@ TIME_ZONE = 'Asia/Chongqing Asia/Chungking' # LANGUAGE_CODE = 'en-us' SITE_ID = 1 -#OTHER SETTINS +#OTHER SETTINGS APP_TITLE = u'CNProg.com 程序员问答社区' -APP_URL = 'http://www.cnprog.com' APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客' APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。' APP_INTRO = u'

CNProg是一个面向程序员的可协作编辑的开放源代码问答社区

您可以在这里提问各类程序技术问题 - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。

' +APP_COPYRIGHT = 'Copyright CNPROG.COM 2009' ADMIN_MEDIA_PREFIX = '/admin/media/' SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' # List of callables that know how to import templates from various sources. @@ -60,7 +61,7 @@ MIDDLEWARE_CLASSES = ( TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', - 'django.core.context_processors.auth', + 'context.auth_processor', 'context.application_settings', #'django.core.context_processors.i18n', ) @@ -98,3 +99,9 @@ from settings_local import * USE_I18N = True LANGUAGE_CODE = 'en' +EMAIL_VALIDATION = 'off' +MIN_USERNAME_LENGTH = 1 +EMAIL_UNIQUE = False +APP_URL = 'http://server.com' #used by email notif system and RSS +GOOGLE_SITEMAP_CODE = '55uGNnQVJW8p1bbXeF/Xbh9I7nZBM/wLhRz6N/I1kkA=' +GOOGLE_ANALYTICS_KEY = '' -- cgit v1.2.3-1-g7c22 From fed254aac68551d612f1ce0ab0e6d6a55f8b7c5a Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Sat, 8 Aug 2009 21:34:53 -0600 Subject: fixing error in settings.py (missing template stuff for admin) --- settings.py | 1 + 1 file changed, 1 insertion(+) (limited to 'settings.py') diff --git a/settings.py b/settings.py index fac3c0d5..fb594676 100644 --- a/settings.py +++ b/settings.py @@ -64,6 +64,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'context.auth_processor', 'context.application_settings', #'django.core.context_processors.i18n', + 'django.core.context_processors.auth' #this is required for admin ) ROOT_URLCONF = 'urls' -- cgit v1.2.3-1-g7c22 From f5eb705941a8d67397d733dcb2acde1e35728cce Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Sun, 9 Aug 2009 16:06:30 -0600 Subject: moving settings values from settings.py to settings_local.py for better organization --- settings.py | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index fb594676..5947617e 100644 --- a/settings.py +++ b/settings.py @@ -17,27 +17,27 @@ ADMINS = ( ) MANAGERS = ADMINS -#email server settings -SERVER_EMAIL = '' -DEFAULT_FROM_EMAIL = 'team@cnprog.com' -EMAIL_HOST_USER = '' -EMAIL_HOST_PASSWORD = '' -EMAIL_SUBJECT_PREFIX = '[cnprog.com]' -EMAIL_HOST='smtp.gmail.com' -EMAIL_PORT='587' -EMAIL_USE_TLS=True +#email server settings (moved to settings_local) +#SERVER_EMAIL = '' +#DEFAULT_FROM_EMAIL = 'team@cnprog.com' +#EMAIL_HOST_USER = '' +#EMAIL_HOST_PASSWORD = '' +#EMAIL_SUBJECT_PREFIX = '[cnprog.com]' +#EMAIL_HOST='smtp.gmail.com' +#EMAIL_PORT='587' +#EMAIL_USE_TLS=True -#LOCALIZATIONS -TIME_ZONE = 'Asia/Chongqing Asia/Chungking' +#LOCALIZATIONS (Moved to settings_local) +#TIME_ZONE = 'Asia/Chongqing Asia/Chungking' # LANGUAGE_CODE = 'en-us' SITE_ID = 1 -#OTHER SETTINGS -APP_TITLE = u'CNProg.com 程序员问答社区' -APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客' -APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。' -APP_INTRO = u'

CNProg是一个面向程序员的可协作编辑的开放源代码问答社区

您可以在这里提问各类程序技术问题 - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。

' -APP_COPYRIGHT = 'Copyright CNPROG.COM 2009' +#OTHER SETTINGS (Moved to settings_local) +#APP_TITLE = u'CNProg.com 程序员问答社区' +#APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客' +#APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。' +#APP_INTRO = u'

CNProg是一个面向程序员的可协作编辑的开放源代码问答社区

您可以在这里提问各类程序技术问题 - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。

' +#APP_COPYRIGHT = 'Copyright CNPROG.COM 2009' ADMIN_MEDIA_PREFIX = '/admin/media/' SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' # List of callables that know how to import templates from various sources. @@ -98,11 +98,12 @@ INSTALLED_APPS = ( # User settings from settings_local import * -USE_I18N = True -LANGUAGE_CODE = 'en' -EMAIL_VALIDATION = 'off' -MIN_USERNAME_LENGTH = 1 -EMAIL_UNIQUE = False -APP_URL = 'http://server.com' #used by email notif system and RSS -GOOGLE_SITEMAP_CODE = '55uGNnQVJW8p1bbXeF/Xbh9I7nZBM/wLhRz6N/I1kkA=' -GOOGLE_ANALYTICS_KEY = '' +#Moved to settings_local +#USE_I18N = True +#LANGUAGE_CODE = 'en' +#EMAIL_VALIDATION = 'off' +#MIN_USERNAME_LENGTH = 1 +#EMAIL_UNIQUE = False +#APP_URL = 'http://server.com' #used by email notif system and RSS +#GOOGLE_SITEMAP_CODE = '55uGNnQVJW8p1bbXeF/Xbh9I7nZBM/wLhRz6N/I1kkA=' +#GOOGLE_ANALYTICS_KEY = '' -- cgit v1.2.3-1-g7c22 From 725dbd5794ba7e19c218ca2cd1f2e798255acdf0 Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Sun, 9 Aug 2009 21:34:41 -0600 Subject: modified settings.py and settings_local.py.dist to be more organized --- settings.py | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index 5947617e..fcfdb548 100644 --- a/settings.py +++ b/settings.py @@ -17,27 +17,8 @@ ADMINS = ( ) MANAGERS = ADMINS -#email server settings (moved to settings_local) -#SERVER_EMAIL = '' -#DEFAULT_FROM_EMAIL = 'team@cnprog.com' -#EMAIL_HOST_USER = '' -#EMAIL_HOST_PASSWORD = '' -#EMAIL_SUBJECT_PREFIX = '[cnprog.com]' -#EMAIL_HOST='smtp.gmail.com' -#EMAIL_PORT='587' -#EMAIL_USE_TLS=True - -#LOCALIZATIONS (Moved to settings_local) -#TIME_ZONE = 'Asia/Chongqing Asia/Chungking' -# LANGUAGE_CODE = 'en-us' SITE_ID = 1 -#OTHER SETTINGS (Moved to settings_local) -#APP_TITLE = u'CNProg.com 程序员问答社区' -#APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客' -#APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。' -#APP_INTRO = u'

CNProg是一个面向程序员的可协作编辑的开放源代码问答社区

您可以在这里提问各类程序技术问题 - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。

' -#APP_COPYRIGHT = 'Copyright CNPROG.COM 2009' ADMIN_MEDIA_PREFIX = '/admin/media/' SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' # List of callables that know how to import templates from various sources. @@ -97,13 +78,3 @@ INSTALLED_APPS = ( # User settings from settings_local import * - -#Moved to settings_local -#USE_I18N = True -#LANGUAGE_CODE = 'en' -#EMAIL_VALIDATION = 'off' -#MIN_USERNAME_LENGTH = 1 -#EMAIL_UNIQUE = False -#APP_URL = 'http://server.com' #used by email notif system and RSS -#GOOGLE_SITEMAP_CODE = '55uGNnQVJW8p1bbXeF/Xbh9I7nZBM/wLhRz6N/I1kkA=' -#GOOGLE_ANALYTICS_KEY = '' -- cgit v1.2.3-1-g7c22 From 7e4f1d542e00b4d3121da6ae5524e95867f2371b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 13 Nov 2009 20:18:55 -0500 Subject: better comments, email subscriptions, corrected view counter, some ie7 issues, wiki optional with settings.WIKI_ON, site can be mounted on arbitrary url prefix, english language improvements, added feedback form, versioned css and js files to force browser cache reload when settings.RESOURCE_REVISION is incremented , other fixes --- settings.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index fcfdb548..daada933 100644 --- a/settings.py +++ b/settings.py @@ -1,25 +1,23 @@ # encoding:utf-8 # Django settings for lanai project. import os.path +import sys +sys.path.insert(0,'/home/fadeev/incoming/Django-1.1.1') #DEBUG SETTINGS -DEBUG = True +DEBUG = False TEMPLATE_DEBUG = DEBUG -INTERNAL_IPS = ('127.0.0.1',) - -#for OpenID auth -ugettext = lambda s: s -LOGIN_URL = '/%s%s' % (ugettext('account/'), ugettext('signin/')) +INTERNAL_IPS = ('127.0.0.1','128.200.203.33') #EMAIL AND ADMINS ADMINS = ( - ('CNProg team', 'team@cnprog.com'), + ('Evgeny Fadeev', 'evgeny.fadeev@gmail.com'), ) MANAGERS = ADMINS SITE_ID = 1 -ADMIN_MEDIA_PREFIX = '/admin/media/' +ADMIN_MEDIA_PREFIX = '/forum/admin/media/' SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( @@ -36,16 +34,18 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.transaction.TransactionMiddleware', #'django.middleware.sqlprint.SqlPrintingMiddleware', - #'middleware.pagesize.QuestionsPageSizeMiddleware', + 'middleware.anon_user.ConnectToSessionMessagesMiddleware', + 'middleware.pagesize.QuestionsPageSizeMiddleware', + 'middleware.cancel.CancelActionMiddleware', #'debug_toolbar.middleware.DebugToolbarMiddleware', ) TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', - 'context.auth_processor', 'context.application_settings', #'django.core.context_processors.i18n', - 'django.core.context_processors.auth' #this is required for admin + 'user_messages.context_processors.user_messages',#must be before auth + 'django.core.context_processors.auth', #this is required for admin ) ROOT_URLCONF = 'urls' @@ -73,7 +73,8 @@ INSTALLED_APPS = ( 'django.contrib.humanize', 'forum', 'django_authopenid', - 'debug_toolbar' , + #'debug_toolbar' , + 'user_messages', ) # User settings -- cgit v1.2.3-1-g7c22 From ebb0f636ae8f7db4e7a2e7470e449af3d96b15c0 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 13 Nov 2009 20:18:55 -0500 Subject: better comments, email subscriptions, corrected view counter, some ie7 issues, wiki optional with settings.WIKI_ON, site can be mounted on arbitrary url prefix, english language improvements, added feedback form, versioned css and js files to force browser cache reload when settings.RESOURCE_REVISION is incremented , other fixes --- settings.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index fcfdb548..daada933 100644 --- a/settings.py +++ b/settings.py @@ -1,25 +1,23 @@ # encoding:utf-8 # Django settings for lanai project. import os.path +import sys +sys.path.insert(0,'/home/fadeev/incoming/Django-1.1.1') #DEBUG SETTINGS -DEBUG = True +DEBUG = False TEMPLATE_DEBUG = DEBUG -INTERNAL_IPS = ('127.0.0.1',) - -#for OpenID auth -ugettext = lambda s: s -LOGIN_URL = '/%s%s' % (ugettext('account/'), ugettext('signin/')) +INTERNAL_IPS = ('127.0.0.1','128.200.203.33') #EMAIL AND ADMINS ADMINS = ( - ('CNProg team', 'team@cnprog.com'), + ('Evgeny Fadeev', 'evgeny.fadeev@gmail.com'), ) MANAGERS = ADMINS SITE_ID = 1 -ADMIN_MEDIA_PREFIX = '/admin/media/' +ADMIN_MEDIA_PREFIX = '/forum/admin/media/' SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( @@ -36,16 +34,18 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.transaction.TransactionMiddleware', #'django.middleware.sqlprint.SqlPrintingMiddleware', - #'middleware.pagesize.QuestionsPageSizeMiddleware', + 'middleware.anon_user.ConnectToSessionMessagesMiddleware', + 'middleware.pagesize.QuestionsPageSizeMiddleware', + 'middleware.cancel.CancelActionMiddleware', #'debug_toolbar.middleware.DebugToolbarMiddleware', ) TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', - 'context.auth_processor', 'context.application_settings', #'django.core.context_processors.i18n', - 'django.core.context_processors.auth' #this is required for admin + 'user_messages.context_processors.user_messages',#must be before auth + 'django.core.context_processors.auth', #this is required for admin ) ROOT_URLCONF = 'urls' @@ -73,7 +73,8 @@ INSTALLED_APPS = ( 'django.contrib.humanize', 'forum', 'django_authopenid', - 'debug_toolbar' , + #'debug_toolbar' , + 'user_messages', ) # User settings -- cgit v1.2.3-1-g7c22 From 46e48e400f30bde76a9b21db78f9b727149a3e24 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 17 Nov 2009 22:14:15 -0500 Subject: full text search with Sphinx, added session-based greeting message for the first time visitor --- settings.py | 1 + 1 file changed, 1 insertion(+) (limited to 'settings.py') diff --git a/settings.py b/settings.py index daada933..3fc37dce 100644 --- a/settings.py +++ b/settings.py @@ -73,6 +73,7 @@ INSTALLED_APPS = ( 'django.contrib.humanize', 'forum', 'django_authopenid', + 'djangosphinx', #'debug_toolbar' , 'user_messages', ) -- cgit v1.2.3-1-g7c22 From bf3a507acbc253f436ffc51e2cf8b42b707c617b Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 Nov 2009 17:15:08 -0500 Subject: fixed error in template and removed ADMINS and DEBUG settings from settings.py --- settings.py | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index 3fc37dce..e964f092 100644 --- a/settings.py +++ b/settings.py @@ -2,18 +2,6 @@ # Django settings for lanai project. import os.path import sys -sys.path.insert(0,'/home/fadeev/incoming/Django-1.1.1') - -#DEBUG SETTINGS -DEBUG = False -TEMPLATE_DEBUG = DEBUG -INTERNAL_IPS = ('127.0.0.1','128.200.203.33') - -#EMAIL AND ADMINS -ADMINS = ( - ('Evgeny Fadeev', 'evgeny.fadeev@gmail.com'), -) -MANAGERS = ADMINS SITE_ID = 1 -- cgit v1.2.3-1-g7c22 From 9655bd421022dd6488b21184cc9fd0242c6b345e Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Tue, 8 Dec 2009 22:50:45 -0500 Subject: added interesting and ignored tag selectors (works) and per-tag subscription (not tested yet) --- settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index e964f092..a32b2303 100644 --- a/settings.py +++ b/settings.py @@ -25,7 +25,7 @@ MIDDLEWARE_CLASSES = ( 'middleware.anon_user.ConnectToSessionMessagesMiddleware', 'middleware.pagesize.QuestionsPageSizeMiddleware', 'middleware.cancel.CancelActionMiddleware', - #'debug_toolbar.middleware.DebugToolbarMiddleware', + 'debug_toolbar.middleware.DebugToolbarMiddleware', ) TEMPLATE_CONTEXT_PROCESSORS = ( @@ -62,7 +62,7 @@ INSTALLED_APPS = ( 'forum', 'django_authopenid', 'djangosphinx', - #'debug_toolbar' , + 'debug_toolbar' , 'user_messages', ) -- cgit v1.2.3-1-g7c22 From fdac57838a27f3837b0ef187a9a3f86f293d29b1 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 9 Dec 2009 19:57:49 -0500 Subject: added sitemap at /sitemap.xml and fixed per tag subscription (hopefully) --- settings.py | 1 + 1 file changed, 1 insertion(+) (limited to 'settings.py') diff --git a/settings.py b/settings.py index a32b2303..6310ce41 100644 --- a/settings.py +++ b/settings.py @@ -59,6 +59,7 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.humanize', + 'django.contrib.sitemaps', 'forum', 'django_authopenid', 'djangosphinx', -- cgit v1.2.3-1-g7c22