Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.71 KB | None | 0 0
  1. """
  2. Django settings for core project.
  3.  
  4. Generated by 'django-admin startproject' using Django 2.1.3.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/2.1/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/2.1/ref/settings/
  11. """
  12.  
  13. import os
  14.  
  15. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  16. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  17.  
  18.  
  19. # Quick-start development settings - unsuitable for production
  20. # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
  21.  
  22. # SECURITY WARNING: keep the secret key used in production secret!
  23. SECRET_KEY = 'nifp6up^^bh^7c_26a6cuy$0p&8$fadg+-)5&dv0k6e$gbp$hn'
  24.  
  25. # SECURITY WARNING: don't run with debug turned on in production!
  26. DEBUG = True
  27.  
  28. ALLOWED_HOSTS = ['*']
  29.  
  30. CORS_ORIGIN_ALLOW_ALL = True
  31.  
  32.  
  33. # Application definition
  34.  
  35. INSTALLED_APPS = [
  36. 'django.contrib.admin',
  37. 'django.contrib.auth',
  38. 'django.contrib.contenttypes',
  39. 'django.contrib.sessions',
  40. 'django.contrib.messages',
  41. 'django.contrib.staticfiles',
  42.  
  43. 'rest_framework',
  44. 'corsheaders',
  45. 'v1',
  46. 'usb_api_caller_v2',
  47. ]
  48.  
  49. MIDDLEWARE = [
  50. 'corsheaders.middleware.CorsMiddleware',
  51. 'django.middleware.security.SecurityMiddleware',
  52. 'django.contrib.sessions.middleware.SessionMiddleware',
  53. 'django.middleware.common.CommonMiddleware',
  54. 'django.middleware.csrf.CsrfViewMiddleware',
  55. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  56. 'django.contrib.messages.middleware.MessageMiddleware',
  57. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  58. ]
  59.  
  60. ROOT_URLCONF = 'core.urls'
  61.  
  62. TEMPLATES = [
  63. {
  64. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  65. 'DIRS': [],
  66. 'APP_DIRS': True,
  67. 'OPTIONS': {
  68. 'context_processors': [
  69. 'django.template.context_processors.debug',
  70. 'django.template.context_processors.request',
  71. 'django.contrib.auth.context_processors.auth',
  72. 'django.contrib.messages.context_processors.messages',
  73. ],
  74. },
  75. },
  76. ]
  77.  
  78. WSGI_APPLICATION = 'core.wsgi.application'
  79.  
  80.  
  81. # Database
  82. # https://docs.djangoproject.com/en/2.1/ref/settings/#databases
  83.  
  84. DATABASES = {
  85. 'default': {
  86. 'ENGINE': 'django.db.backends.postgresql',
  87. 'NAME': 'usbapi',
  88. 'USER': 'postgres',
  89. 'PASSWORD': 'aapbd',
  90. 'HOST': '127.0.0.1',
  91. 'PORT': '5432',
  92.  
  93. # 'ENGINE': 'django.db.backends.sqlite3',
  94. # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  95. }
  96. }
  97.  
  98.  
  99. # Password validation
  100. # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
  101.  
  102. AUTH_PASSWORD_VALIDATORS = [
  103. {
  104. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  105. },
  106. {
  107. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  108. },
  109. {
  110. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  111. },
  112. {
  113. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  114. },
  115. ]
  116.  
  117.  
  118. # Internationalization
  119. # https://docs.djangoproject.com/en/2.1/topics/i18n/
  120.  
  121. LANGUAGE_CODE = 'en-us'
  122.  
  123. TIME_ZONE = 'UTC'
  124.  
  125. USE_I18N = True
  126.  
  127. USE_L10N = True
  128.  
  129. USE_TZ = True
  130.  
  131.  
  132. # Static files (CSS, JavaScript, Images)
  133. # https://docs.djangoproject.com/en/2.1/howto/static-files/
  134.  
  135. STATIC_ROOT = os.path.join(BASE_DIR, "static")
  136.  
  137. STATIC_URL = '/static/'
  138.  
  139.  
  140. REST_FRAMEWORK = {
  141. # # Use Django's standard `django.contrib.auth` permissions,
  142. # # or allow read-only access for unauthenticated users.
  143. # 'DEFAULT_PERMISSION_CLASSES': [
  144. # 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
  145. # ],
  146. 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
  147. 'PAGE_SIZE': 10,
  148. }
  149.  
  150.  
  151. # api info for live production
  152. TTI_API_URL = 'http://wsapi-apac.ttinteractive.com/Zenith/TTI.PublicApi.Services/JsonSaleEngineService.svc/'
  153. TTI_API_ACCESS_CODE = '_JEAAAABWU_EYtV0PDQ5AefVBXqTISe7_EqErTgeZryEzUyElkoBqCSdJh8UQdKZLhbSW62OVwi7Ix58ZnGrS9CBDxSnz7g_U'
  154.  
  155.  
  156. #api info for preproduction
  157. #TTI_API_URL = 'http://tstws2.ttinteractive.com/Zenith/TTI.PublicApi.Services/JsonSaleEngineService.svc/'
  158. #TTI_API_ACCESS_CODE = '_JEAAAAL436mpPsYP3m2lwfwBiLPdzcUQEHyecX5mtHR1RMK0DTHTEiyA_EYVUazFkn3rIGIGu6wxA8qa1gYyfs1uOib4E_U'
  159.  
  160. # TTI_API_URL = os.environ.get('TTI_API_URL', '')
  161. # TTI_API_ACCESS_CODE = os.environ.get('TTI_API_ACCESS_CODE', '')
  162.  
  163. # is under development
  164. IS_DEV = os.environ.get('IS_DEV', False)
  165.  
  166.  
  167. # local settings for dev
  168. try:
  169. from .local_settings import *
  170. except ImportError:
  171. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement