Guest User

local_settings.py

a guest
Aug 22nd, 2013
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.03 KB | None | 0 0
  1. # Django settings for fixmystreet project.
  2. import os
  3. import logging
  4.  
  5. PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
  6. POSTGIS_TEMPLATE = 'template_postgis'
  7.  
  8. logging.basicConfig(
  9.     level = logging.DEBUG,
  10.     format = '%(asctime)s %(levelname)s %(message)s',
  11.     filename = '/tmp/fixmystreet.log',
  12.     filemode = 'w'
  13. )
  14.  
  15. # Local time zone for this installation. Choices can be found here:
  16. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  17. # although not all choices may be available on all operating systems.
  18. # If running in a Windows environment this must be set to the same as your
  19. # system time zone.
  20. TIME_ZONE = 'America/Chicago'
  21.  
  22. # Language code for this installation. All choices can be found here:
  23. # http://www.i18nguy.com/unicode/language-identifiers.html
  24. LANGUAGE_CODE = 'en-us'
  25.  
  26. # If you set this to False, Django will make some optimizations so as not
  27. # to load the internationalization machinery.
  28. USE_I18N = True
  29.  
  30. # Absolute path to the directory that holds media.
  31. # Example: "/home/media/media.lawrence.com/"
  32. MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
  33.  
  34. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  35. # trailing slash if there is a path component (optional in other cases).
  36. # Examples: "http://media.lawrence.com", "http://example.com/media/"
  37. MEDIA_URL = '/media/'
  38.  
  39. # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
  40. # trailing slash.
  41. # Examples: "http://foo.com/media/", "/media/".
  42. ADMIN_MEDIA_PREFIX = '/admin_media/'
  43.  
  44. # ensure large uploaded files end up with correct permissions.  See
  45. # http://docs.djangoproject.com/en/dev/ref/settings/#file-upload-permissions
  46.  
  47. FILE_UPLOAD_PERMISSIONS = 0644
  48. DATE_FORMAT = "l, F jS, Y"
  49.  
  50. # List of callables that know how to import templates from various sources.
  51. TEMPLATE_LOADERS = (
  52.     'django.template.loaders.filesystem.Loader',
  53.     'django.template.loaders.app_directories.Loader',
  54. #     'django.template.loaders.eggs.load_template_source',
  55. )
  56.  
  57. # include request object in template to determine active page
  58. TEMPLATE_CONTEXT_PROCESSORS = (
  59.   'django.core.context_processors.request',
  60.   'django.contrib.auth.context_processors.auth',
  61.   'django.core.context_processors.csrf',
  62. )
  63.  
  64. MIDDLEWARE_CLASSES = (
  65.     'django.middleware.common.CommonMiddleware',
  66.     'django.contrib.sessions.middleware.SessionMiddleware',
  67.     'django.middleware.locale.LocaleMiddleware',
  68.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  69.     'django.middleware.csrf.CsrfViewMiddleware',
  70.     'django.middleware.csrf.CsrfResponseMiddleware',
  71.     'mainapp.middleware.subdomains.SubdomainMiddleware',
  72.     'mainapp.middleware.SSLMiddleware.SSLRedirect',
  73. )
  74.  
  75.  
  76. LANGUAGES = (
  77.   ('en','English'),
  78.   ('fr', 'French'),
  79. )
  80.  
  81.  
  82. ROOT_URLCONF = 'fixmystreet.urls'
  83.  
  84. TEMPLATE_DIRS = (
  85.     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  86.     # Always use forward slashes, even on Windows.
  87.     # Don't forget to use absolute paths, not relative paths.
  88.     os.path.join(PROJECT_PATH, 'templates')
  89. )
  90.  
  91. INSTALLED_APPS = (
  92.     'django.contrib.auth',
  93.     'django.contrib.admin',
  94.     'django.contrib.contenttypes',
  95.     'django.contrib.sessions',
  96.     'django.contrib.sites',
  97.     'django.contrib.gis',
  98.     'registration',
  99.     'google_analytics',
  100.     'transmeta',
  101.     'social_auth',
  102.     'mainapp',
  103. )
  104.  
  105. AUTH_PROFILE_MODULE = 'mainapp.UserProfile'
  106.  
  107. AUTHENTICATION_BACKENDS = (
  108.     'social_auth.backends.twitter.TwitterBackend',
  109.     'social_auth.backends.facebook.FacebookBackend',
  110. #    'social_auth.backends.google.GoogleOAuthBackend',
  111. #    'social_auth.backends.google.GoogleOAuth2Backend',
  112. #    'social_auth.backends.google.GoogleBackend',
  113. #    'social_auth.backends.yahoo.YahooBackend',
  114. #    'social_auth.backends.OpenIDBackend',
  115.     'django.contrib.auth.backends.ModelBackend',
  116. #    'mainapp.tests.testsocial_auth.dummy_socialauth.DummyBackend',
  117. )
  118.  
  119. CACHE_MIDDLEWARE_ANONYMOUS_ONLY =True
  120. SOCIAL_AUTH_USER_MODEL = 'mainapp.FMSUser'
  121. SOCIAL_AUTH_ASSOCIATE_BY_MAIL = True
  122. ACCOUNT_ACTIVATION_DAYS = 14
  123. SOCIAL_AUTH_EXTRA_DATA = False
  124. SOCIAL_AUTH_COMPLETE_URL_NAME = 'socialauth_complete'
  125. LOGIN_ERROR_URL = '/accounts/login/error/'
  126. SOCIAL_AUTH_ERROR_KEY = 'socialauth_error'
  127. LOGIN_REDIRECT_URL = '/accounts/home/'
  128. LOGIN_DISABLED = False
  129.  
  130. #################################################################################
  131. # These variables Should be defined in the local settings file
  132. #################################################################################
  133. #
  134. DATABASES = {
  135.     'default': {
  136.         'ENGINE': 'django.contrib.gis.db.backends.postgis',
  137.         'NAME': 'fixmystreet',
  138.         'USER': 'postgres',
  139.         'PASSWORD': 'postgres'
  140.     }
  141. }
  142.  
  143. EMAIL_USE_TLS =''
  144. EMAIL_HOST =''
  145. EMAIL_HOST_USER =''
  146. EMAIL_HOST_PASSWORD =''
  147. EMAIL_PORT =''
  148. EMAIL_FROM_USER =''
  149. DEBUG =True
  150. LOCAL_DEV =''
  151. SITE_URL = 'http://localhost:8000'
  152. SECRET_KEY='12345'
  153. GMAP_KEY=''
  154.  
  155. ADMIN_EMAIL =''
  156. ADMINS =''
  157.  
  158. # ----- social_auth consumer id's ----- #
  159. TWITTER_CONSUMER_KEY         = ''
  160. TWITTER_CONSUMER_SECRET      = ''
  161. FACEBOOK_APP_ID              = ''
  162. FACEBOOK_API_SECRET          = ''
  163. #####################################################################################
  164.  
  165. # import local settings overriding the defaults
  166. # local_settings.py is machine independent and should not be checked in
  167.  
  168. try:
  169.     from local_settings import *
  170. except ImportError:
  171.     try:
  172.         from mod_python import apache
  173.         apache.log_error( "local_settings.py not set; using default settings", apache.APLOG_NOTICE )
  174.     except ImportError:
  175.         import sys
  176.         sys.stderr.write( "local_settings.py not set; using default settings\n" )
  177.  
  178.  
  179. # Using django_testview from here (add 'TESTVIEW' to your local settings):
  180. # https://github.com/visiblegovernment/django_testview
  181.  
  182. if DEBUG and globals().has_key('TESTVIEW'):
  183.     INSTALLED_APPS += ('django_testview',)
  184.  
  185.  
  186. if DEBUG:
  187.     SOCIAL_AUTH_IMPORT_BACKENDS = (
  188.                                    'mainapp.tests.testsocial_auth',
  189.                                    )
Advertisement
Add Comment
Please, Sign In to add comment