Advertisement
Guest User

Sample settings

a guest
Feb 11th, 2012
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.08 KB | None | 0 0
  1. # Django settings for projectname project.
  2.  
  3. DEBUG = True
  4. TEMPLATE_DEBUG = DEBUG
  5.  
  6. ADMINS = ()
  7.  
  8. MANAGERS = ADMINS
  9.  
  10. DATABASES = {
  11.     'default': {
  12.         'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
  13.         'NAME': 'projectname_db',                      # Or path to database file if using sqlite3.
  14.         'USER': 'user',                      # Not used with sqlite3.
  15.         'PASSWORD': 'password',                  # Not used with sqlite3.
  16.         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
  17.         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
  18.     }
  19. }
  20.  
  21. # Local time zone for this installation. Choices can be found here:
  22. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  23. # although not all choices may be available on all operating systems.
  24. # On Unix systems, a value of None will cause Django to use the same
  25. # timezone as the operating system.
  26. # If running in a Windows environment this must be set to the same as your
  27. # system time zone.
  28. TIME_ZONE = 'America/Chicago'
  29.  
  30. # Language code for this installation. All choices can be found here:
  31. # http://www.i18nguy.com/unicode/language-identifiers.html
  32. LANGUAGE_CODE = 'en-us'
  33.  
  34. SITE_ID = 1
  35.  
  36. # If you set this to False, Django will make some optimizations so as not
  37. # to load the internationalization machinery.
  38. USE_I18N = True
  39.  
  40. # If you set this to False, Django will not format dates, numbers and
  41. # calendars according to the current locale
  42. USE_L10N = True
  43.  
  44. # Absolute filesystem path to the directory that will hold user-uploaded files.
  45. # Example: "/home/media/media.lawrence.com/media/"
  46. MEDIA_ROOT = '/var/www/'
  47.  
  48. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  49. # trailing slash.
  50. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  51. MEDIA_URL = 'http://localhost/'
  52.  
  53. # Absolute path to the directory static files should be collected to.
  54. # Don't put anything in this directory yourself; store your static files
  55. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  56. # Example: "/home/media/media.lawrence.com/static/"
  57. STATIC_ROOT = ''
  58.  
  59. # URL prefix for static files.
  60. # Example: "http://media.lawrence.com/static/"
  61. STATIC_URL = '/static/'
  62.  
  63. # URL prefix for admin static files -- CSS, JavaScript and images.
  64. # Make sure to use a trailing slash.
  65. # Examples: "http://foo.com/static/admin/", "/static/admin/".
  66. ADMIN_MEDIA_PREFIX = '/static/admin/'
  67.  
  68. # Additional locations of static files
  69. STATICFILES_DIRS = (
  70.     # Put strings here, like "/home/html/static" or "C:/www/django/static".
  71.     # Always use forward slashes, even on Windows.
  72.     # Don't forget to use absolute paths, not relative paths.
  73. )
  74.  
  75. # List of finder classes that know how to find static files in
  76. # various locations.
  77. STATICFILES_FINDERS = (
  78.     'django.contrib.staticfiles.finders.FileSystemFinder',
  79.     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  80. #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
  81. )
  82.  
  83. # Make this unique, and don't share it with anybody.
  84. SECRET_KEY = '&67tk4yxrg7w4553#g4=3au!0#&^)u8o3w%xv9u9fb^(o8xd0m'
  85.  
  86. # List of callables that know how to import templates from various sources.
  87. TEMPLATE_LOADERS = (
  88.     'django.template.loaders.filesystem.Loader',
  89.     'django.template.loaders.app_directories.Loader',
  90. #     'django.template.loaders.eggs.Loader',
  91. )
  92.  
  93. MIDDLEWARE_CLASSES = (
  94.     'django.middleware.common.CommonMiddleware',
  95.     'django.contrib.sessions.middleware.SessionMiddleware',
  96.     'django.middleware.csrf.CsrfViewMiddleware',
  97.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  98.     'django.contrib.messages.middleware.MessageMiddleware',
  99. )
  100.  
  101. ROOT_URLCONF = 'Alak.urls'
  102.  
  103. TEMPLATE_DIRS = (
  104.     'templates/'
  105.     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  106.     # Always use forward slashes, even on Windows.
  107.     # Don't forget to use absolute paths, not relative paths.
  108. )
  109.  
  110. INSTALLED_APPS = (
  111.     'django.contrib.auth',
  112.     'django.contrib.contenttypes',
  113.     'django.contrib.sessions',
  114.     'django.contrib.sites',
  115.     'django.contrib.messages',
  116.     'django.contrib.staticfiles',
  117.     # Uncomment the next line to enable the admin:
  118.     # 'django.contrib.admin',
  119.     # Uncomment the next line to enable admin documentation:
  120.     # 'django.contrib.admindocs',
  121. )
  122.  
  123. # A sample logging configuration. The only tangible logging
  124. # performed by this configuration is to send an email to
  125. # the site admins on every HTTP 500 error.
  126. # See http://docs.djangoproject.com/en/dev/topics/logging for
  127. # more details on how to customize your logging configuration.
  128. LOGGING = {
  129.     'version': 1,
  130.     'disable_existing_loggers': False,
  131.     'handlers': {
  132.         'mail_admins': {
  133.             'level': 'ERROR',
  134.             'class': 'django.utils.log.AdminEmailHandler'
  135.         }
  136.     },
  137.     'loggers': {
  138.         'django.request': {
  139.             'handlers': ['mail_admins'],
  140.             'level': 'ERROR',
  141.             'propagate': True,
  142.         },
  143.     }
  144. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement