settings.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. """
  2. Django settings for celutz project.
  3. For more information on this file, see
  4. https://docs.djangoproject.com/en/1.7/topics/settings/
  5. For the full list of settings and their values, see
  6. https://docs.djangoproject.com/en/1.7/ref/settings/
  7. """
  8. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  9. import os
  10. BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  11. import altitude.providers
  12. # Quick-start development settings - unsuitable for production
  13. # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
  14. # SECURITY WARNING: keep the secret key used in production secret!
  15. SECRET_KEY = 'ei3#@ejlp((&tlx2jrscs^wrvpn$y4o-7_(-$a_uc9%j3eux1*'
  16. # SECURITY WARNING: don't run with debug turned on in production!
  17. DEBUG = True
  18. ALLOWED_HOSTS = ['localhost', '127.0.0.1', '::1']
  19. # Application definition
  20. INSTALLED_APPS = (
  21. 'django.contrib.admin',
  22. 'django.contrib.auth',
  23. 'django.contrib.contenttypes',
  24. 'django.contrib.sessions',
  25. 'django.contrib.messages',
  26. 'django.contrib.staticfiles',
  27. # For Celery
  28. 'kombu.transport.django',
  29. 'rest_framework',
  30. 'panorama.apps.PanoramaConfig',
  31. 'altitude.apps.AltitudeConfig',
  32. 'api'
  33. )
  34. MIDDLEWARE_CLASSES = (
  35. 'django.contrib.sessions.middleware.SessionMiddleware',
  36. 'django.middleware.locale.LocaleMiddleware',
  37. 'django.middleware.common.CommonMiddleware',
  38. 'django.middleware.csrf.CsrfViewMiddleware',
  39. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  40. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  41. 'django.contrib.messages.middleware.MessageMiddleware',
  42. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  43. )
  44. ROOT_URLCONF = 'celutz.urls'
  45. TEMPLATES = [
  46. {
  47. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  48. 'DIRS': [],
  49. 'APP_DIRS': True,
  50. 'OPTIONS': {
  51. 'context_processors': [
  52. 'django.contrib.auth.context_processors.auth',
  53. 'django.template.context_processors.debug',
  54. 'django.template.context_processors.request',
  55. 'django.template.context_processors.i18n',
  56. 'django.template.context_processors.media',
  57. 'django.template.context_processors.static',
  58. 'django.template.context_processors.tz',
  59. 'django.template.context_processors.csrf',
  60. 'django.contrib.messages.context_processors.messages',
  61. ],
  62. },
  63. },
  64. ]
  65. WSGI_APPLICATION = 'celutz.wsgi.application'
  66. # Database
  67. # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
  68. DATABASES = {
  69. 'default': {
  70. 'ENGINE': 'django.db.backends.sqlite3',
  71. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  72. }
  73. }
  74. # Internationalization
  75. # https://docs.djangoproject.com/en/1.7/topics/i18n/
  76. LANGUAGE_CODE = 'fr'
  77. LANGUAGES = [
  78. ('en', 'English'),
  79. ('fr', 'French'),
  80. ('es', 'Spanish'),
  81. ]
  82. TIME_ZONE = 'UTC'
  83. USE_I18N = True
  84. USE_L10N = True
  85. USE_TZ = True
  86. # Static files (CSS, JavaScript, Images)
  87. # https://docs.djangoproject.com/en/1.7/howto/static-files/
  88. STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  89. STATIC_URL = '/static/'
  90. # Is it required to login to use celutz?
  91. LOGIN_REQUIRED = False
  92. # Altitude providers are tried in order until obtaining a result.
  93. ALTITUDE_PROVIDERS = [altitude.providers.GeoportailProvider,
  94. altitude.providers.GeonamesProvider]
  95. # Connection timeout for each provider, in seconds
  96. ALTITUDE_PROVIDER_TIMEOUT = 3.
  97. # For uploaded panorama
  98. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  99. MEDIA_URL = '/media/'
  100. # Relative to MEDIA_ROOT and MEDIA_URL
  101. PANORAMA_TILES_DIR = "tiles"
  102. # Max distance around a point at which to consider reference points
  103. # (in meters)
  104. PANORAMA_MAX_DISTANCE = 50000
  105. # Map bounds (in degrees) for the main view.
  106. # If not defined, all points are used to fit the view.
  107. #MAP_BOUNDS = {
  108. # "min_lat": 45.17,
  109. # "max_lat": 45.20,
  110. # "min_lon": 5.68,
  111. # "max_lon": 5.77,
  112. #}
  113. # Celery configuration
  114. BROKER_URL = 'django://'
  115. CELERY_TASK_SERIALIZER = 'json'
  116. CELERY_ACCEPT_CONTENT = ['json']
  117. # Local settings overriding
  118. try:
  119. from celutz.local_settings import *
  120. except ImportError:
  121. pass