Advertisement
Guest User

settings.py

a guest
Mar 25th, 2012
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.05 KB | None | 0 0
  1. # Django settings for myproject project.
  2. import os
  3. gettext = lambda s: s
  4. PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
  5.  
  6.  
  7.  
  8. DEBUG = True
  9. TEMPLATE_DEBUG = DEBUG
  10.  
  11. ADMINS = (
  12.     # ('Your Name', 'your_email@example.com'),
  13. )
  14.  
  15. MANAGERS = ADMINS
  16.  
  17. DATABASES = {
  18.     'default': {
  19.         'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
  20.         'NAME': 'name',                      # Or path to database file if using sqlite3.
  21.         'USER': 'user',                      # Not used with sqlite3.
  22.         'PASSWORD': 'pass',                  # Not used with sqlite3.
  23.         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
  24.         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
  25.     }
  26. }
  27.  
  28. # Local time zone for this installation. Choices can be found here:
  29. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  30. # although not all choices may be available on all operating systems.
  31. # On Unix systems, a value of None will cause Django to use the same
  32. # timezone as the operating system.
  33. # If running in a Windows environment this must be set to the same as your
  34. # system time zone.
  35. TIME_ZONE = 'America/Chicago'
  36.  
  37. # Language code for this installation. All choices can be found here:
  38. # http://www.i18nguy.com/unicode/language-identifiers.html
  39. LANGUAGE_CODE = 'en-us'
  40.  
  41. LANGUAGES = [
  42.     ('en', 'English'),
  43. ]
  44.  
  45. SITE_ID = 1
  46.  
  47. # If you set this to False, Django will make some optimizations so as not
  48. # to load the internationalization machinery.
  49. USE_I18N = True
  50.  
  51. # If you set this to False, Django will not format dates, numbers and
  52. # calendars according to the current locale
  53. USE_L10N = True
  54.  
  55. # Absolute filesystem path to the directory that will hold user-uploaded files.
  56. # Example: "/home/media/media.lawrence.com/media/"
  57. MEDIA_ROOT = os.path.join(PROJECT_PATH, "media")
  58.  
  59. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  60. # trailing slash.
  61. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  62. MEDIA_URL = "/media/"
  63.  
  64. # Absolute path to the directory static files should be collected to.
  65. # Don't put anything in this directory yourself; store your static files
  66. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  67. # Example: "/home/media/media.lawrence.com/static/"
  68. STATIC_ROOT = os.path.join(PROJECT_PATH, "static")
  69.  
  70. # URL prefix for static files.
  71. # Example: "http://media.lawrence.com/static/"
  72. STATIC_URL = "/static/"
  73.  
  74. # URL prefix for admin static files -- CSS, JavaScript and images.
  75. # Make sure to use a trailing slash.
  76. # Examples: "http://foo.com/static/admin/", "/static/admin/".
  77. ADMIN_MEDIA_PREFIX = "/static/admin/"
  78.  
  79. # Additional locations of static files
  80. STATICFILES_DIRS = (
  81.     # Put strings here, like "/home/html/static" or "C:/www/django/static".
  82.     # Always use forward slashes, even on Windows.
  83.     # Don't forget to use absolute paths, not relative paths.
  84. )
  85.  
  86. # List of finder classes that know how to find static files in
  87. # various locations.
  88. STATICFILES_FINDERS = (
  89.     'django.contrib.staticfiles.finders.FileSystemFinder',
  90.     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  91. #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
  92. )
  93.  
  94. # Make this unique, and don't share it with anybody.
  95. SECRET_KEY = 'q8bv)br+3vty&w0*1=83*-a+mm)c^2sviaq5($b_t7$c6a=o6e'
  96.  
  97. # List of callables that know how to import templates from various sources.
  98. TEMPLATE_LOADERS = (
  99.     'django.template.loaders.filesystem.Loader',
  100.     'django.template.loaders.app_directories.Loader',
  101. #     'django.template.loaders.eggs.Loader',
  102. )
  103.  
  104. TEMPLATE_CONTEXT_PROCESSORS = (
  105.     'django.contrib.auth.context_processors.auth',
  106.     'django.core.context_processors.i18n',
  107.     'django.core.context_processors.request',
  108.     'django.core.context_processors.media',
  109.     'django.core.context_processors.static',
  110.     'cms.context_processors.media',
  111.     'sekizai.context_processors.sekizai',
  112. )
  113.  
  114. MIDDLEWARE_CLASSES = (
  115.     'django.middleware.common.CommonMiddleware',
  116.     'django.contrib.sessions.middleware.SessionMiddleware',
  117.     'django.middleware.csrf.CsrfViewMiddleware',
  118.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  119.     'django.contrib.messages.middleware.MessageMiddleware',
  120.     'cms.middleware.multilingual.MultilingualURLMiddleware',
  121.     'cms.middleware.page.CurrentPageMiddleware',
  122.     'cms.middleware.user.CurrentUserMiddleware',
  123.     'cms.middleware.toolbar.ToolbarMiddleware',
  124. )
  125.  
  126. ROOT_URLCONF = 'myproject.urls'
  127.  
  128. TEMPLATE_DIRS = (
  129.     # The docs say it should be absolute path: PROJECT_PATH is precisely one.
  130.     # Life is wonderful!
  131.     os.path.join(PROJECT_PATH, "templates"),
  132. )
  133.  
  134. CMS_TEMPLATES = (
  135.     ('template_1.html', 'Template One'),
  136.     ('template_2.html', 'Template Two'),
  137.     ('footer.html','Template Footer'),
  138.     ('sidebar.html','Template Sidebar'),
  139.     ('cmsplugin_blog/cmsplugin_blog_base.html','cmsplugin_blog'),
  140.     ('cmsplugin_blog/entry_detail.html','cmsplugin_blog_detail'),
  141.  
  142. )
  143.  
  144. INSTALLED_APPS = (
  145.     'django.contrib.auth',
  146.     'django.contrib.contenttypes',
  147.     'django.contrib.sessions',
  148.     'django.contrib.sites',
  149.     'django.contrib.messages',
  150.     'django.contrib.staticfiles',
  151.     'django.contrib.auth',
  152.     'django.contrib.contenttypes',
  153.     'django.contrib.sessions',
  154.     'django.contrib.admin',
  155.     'django.contrib.sites',
  156.     'cms',
  157.     'cms.plugins.text',
  158.     'cms.plugins.picture',
  159.     'cms.plugins.link',
  160.     'cms.plugins.file',
  161.     'cms.plugins.flash',
  162.     'cms.plugins.googlemap',
  163.     'cms.plugins.teaser',
  164.     'cms.plugins.video',
  165.     'cms.plugins.twitter',
  166.     'cms.plugins.snippet',
  167.     'cms.plugins.inherit',
  168.     'cmsplugin_contact',
  169.     'cmsplugin_gallery',
  170.     'mptt',
  171.     'menus',
  172.     'south',
  173.     'sekizai',
  174.     'cmsplugin_blog',
  175.     'djangocms_utils',
  176.     'simple_translation',
  177.     'tagging',
  178.     'django.contrib.staticfiles',
  179.     'django.contrib.admin',
  180.     # Uncomment the next line to enable admin documentation:
  181.     # 'django.contrib.admindocs',
  182. )
  183.  
  184. JQUERY_JS = 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'
  185. JQUERY_UI_JS = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js'
  186. JQUERY_UI_CSS = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/smoothness/jquery-ui.css'
  187.  
  188. CMSPLUGIN_BLOG_PLACEHOLDERS = ('first', 'second', 'third')
  189. # A sample logging configuration. The only tangible logging
  190. # performed by this configuration is to send an email to
  191. # the site admins on every HTTP 500 error.
  192. # See http://docs.djangoproject.com/en/dev/topics/logging for
  193. # more details on how to customize your logging configuration.
  194. LOGGING = {
  195.     'version': 1,
  196.     'disable_existing_loggers': False,
  197.     'handlers': {
  198.         'mail_admins': {
  199.             'level': 'ERROR',
  200.             'class': 'django.utils.log.AdminEmailHandler'
  201.         }
  202.     },
  203.     'loggers': {
  204.         'django.request': {
  205.             'handlers': ['mail_admins'],
  206.             'level': 'ERROR',
  207.             'propagate': True,
  208.         },
  209.     }
  210. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement