Advertisement
Guest User

settings.py

a guest
May 22nd, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.53 KB | None | 0 0
  1. """
  2. Django settings for bikepurranque project.
  3.  
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.7/topics/settings/
  6.  
  7. For the full list of settings and their values, see
  8. https://docs.djangoproject.com/en/1.7/ref/settings/
  9. """
  10.  
  11. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  12. import os
  13. #si se comenta crashea heroku
  14. BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  15.  
  16.  
  17.  
  18. # Quick-start development settings - unsuitable for production
  19. # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
  20.  
  21. # SECURITY WARNING: keep the secret key used in production secret!
  22. SECRET_KEY = 'p$a#mo2!&$97cg9m^%di_uvue2g8qdf*-v#v189x3jigybk%@l'
  23.  
  24. # SECURITY WARNING: don't run with debug turned on in production!
  25. DEBUG = True
  26.  
  27. TEMPLATE_DEBUG = True
  28.  
  29. ALLOWED_HOSTS = []
  30.  
  31.  
  32. # Application definition
  33.  
  34. INSTALLED_APPS = (
  35.     'django.contrib.auth',
  36.     'django.contrib.contenttypes',
  37.     'django.contrib.sessions',
  38.     'django.contrib.messages',
  39.     'django.contrib.staticfiles',
  40.     'rutasQr',
  41.     'rest_framework',
  42.     'competencias',
  43.     'noticias',
  44.     #'django_admin_bootstrapped.bootstrap3',
  45.     #'django_admin_bootstrapped',
  46.     'ckeditor',
  47.     'social.apps.django_app.default',
  48.     'bootstrap_admin',
  49.     'django.contrib.admin',
  50.  #   'latch',
  51.  
  52. )
  53.  
  54. MIDDLEWARE_CLASSES = (
  55.     'django.contrib.sessions.middleware.SessionMiddleware',
  56.     'django.middleware.common.CommonMiddleware',
  57.     'django.middleware.csrf.CsrfViewMiddleware',
  58.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  59.     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  60.     'django.contrib.messages.middleware.MessageMiddleware',
  61.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  62. )
  63.  
  64. ROOT_URLCONF = 'bikepurranque.urls'
  65.  
  66. WSGI_APPLICATION = 'bikepurranque.wsgi.application'
  67.  
  68.  
  69. # Database
  70. # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
  71.  
  72. DATABASES = {
  73.     'default': {
  74.         'ENGINE': 'django.db.backends.sqlite3',
  75.         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  76.     }
  77. }
  78.  
  79. # Internationalization
  80. # https://docs.djangoproject.com/en/1.7/topics/i18n/
  81.  
  82. LANGUAGE_CODE = 'es-cl'
  83.  
  84. TIME_ZONE = 'Chile/Continental'
  85.  
  86. USE_I18N = True
  87.  
  88. USE_L10N = True
  89.  
  90. USE_TZ = True
  91.  
  92. TEMPLATE_DIRS = (
  93.     os.path.join(BASE_DIR, 'templates'),
  94.     #BASE_DIR  + "/templates/",
  95. )
  96.  
  97. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  98.  
  99. CKEDITOR_UPLOAD_PATH = 'http://127.0.0.1:8000/media/' + 'content/ckeditor/'
  100.  
  101. """CKEDITOR_CONFIGS = {
  102.    'default': { 'toolbar': None, },
  103. }"""
  104.  
  105. # Static files (CSS, JavaScript, Images)
  106. # https://docs.djangoproject.com/en/1.7/howto/static-files/
  107.  
  108. STATIC_URL = '/static/'
  109.  
  110. STATICFILES_DIRS = (
  111.     os.path.join((BASE_DIR), "static"),
  112. )
  113.  
  114. #login social
  115. AUTHENTICATION_BACKENDS = (
  116.     'social.backends.facebook.FacebookAppOAuth2',
  117.     'social.backends.facebook.FacebookOAuth2',
  118.     'social.backends.twitter.TwitterOAuth',
  119.     #Login normal de django user/password
  120.     'django.contrib.auth.backends.ModelBackend',
  121. )
  122.  
  123. #a que url redirrecciona una vez logeado. inicio
  124. SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/'
  125.  
  126. SOCIAL_AUTH_FACEBOOK_KEY = ''
  127. SOCIAL_AUTH_FACEBOOK_SECRET = ''
  128.  
  129. SOCIAL_AUTH_TWITTER_KEY = ''
  130. SOCIAL_AUTH_TWITTER_SECRET = ''
  131.  
  132. # For Sidebar Menu in Django 1.7 only (List of apps and models) (RECOMMENDED)
  133. from django.conf import global_settings
  134. TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
  135.     'django.core.context_processors.request',
  136. )
  137. BOOTSTRAP_ADMIN_SIDEBAR_MENU = True
  138.  
  139. # Anadir el modelo de usuario en settings.py
  140. #AUTH_PROFILE_MODULE='latch.UserProfile'
  141. # Establecer el backend de autenticacion
  142. #AUTHENTICATION_BACKENDS = (
  143. #'latch.auth_backend.LatchAuthBackend',
  144. #)
  145.  
  146. #heroku
  147. #COMENTAR PARA EJECUTAR EN LOCAL, DESCOMENTAR PARA HEROKU
  148. # Parse database configuration from $DATABASE_URL
  149. import dj_database_url
  150. DATABASES['default'] =  dj_database_url.config()
  151.  
  152. # Honor the 'X-Forwarded-Proto' header for request.is_secure()
  153. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  154.  
  155. # Allow all host headers
  156. ALLOWED_HOSTS = ['*']
  157.  
  158. # Static asset configuration
  159. import os
  160. BASE_DIR = os.path.dirname(os.path.abspath(__file__))
  161. STATIC_ROOT = 'staticfiles'
  162. STATIC_URL = '/static/'
  163.  
  164. STATICFILES_DIRS = (
  165.     #local
  166.     #os.path.join(BASE_DIR, 'static'),
  167.     #heroku
  168.     #os.path.join('static'),
  169. )
  170.  
  171. # Simplified static file serving.
  172. # https://warehouse.python.org/project/whitenoise/
  173.  
  174. STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement