LiveStock & Grazing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

settings.py 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. """
  2. Django settings for pmap project.
  3. Generated by 'django-admin startproject' using Django 2.0.5.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/2.0/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/2.0/ref/settings/
  8. """
  9. import os
  10. import dj_database_url
  11. import environ
  12. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  13. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  14. # Quick-start development settings - unsuitable for production
  15. # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
  16. SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'imasecret')
  17. DEBUG = os.environ.get('DJANGO_DEBUG', '')
  18. ALLOWED_HOSTS = [
  19. '192.168.56.1',
  20. 'alireza-pmap.herokuapp.com',
  21. 'alireza-pmap-staging.herokuapp.com',
  22. '127.0.0.1',
  23. ]
  24. # Application definition
  25. INSTALLED_APPS = [
  26. 'django.contrib.admin',
  27. 'django.contrib.auth',
  28. 'django.contrib.contenttypes',
  29. 'django.contrib.sessions',
  30. 'django.contrib.messages',
  31. 'django.contrib.staticfiles',
  32. 'rest_framework',
  33. 'livestock',
  34. 'api',
  35. ]
  36. MIDDLEWARE = [
  37. 'django.middleware.security.SecurityMiddleware',
  38. 'whitenoise.middleware.WhiteNoiseMiddleware',
  39. 'django.contrib.sessions.middleware.SessionMiddleware',
  40. 'django.middleware.common.CommonMiddleware',
  41. 'django.middleware.csrf.CsrfViewMiddleware',
  42. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  43. 'django.contrib.messages.middleware.MessageMiddleware',
  44. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  45. ]
  46. ROOT_URLCONF = 'pmap.urls'
  47. TEMPLATES = [
  48. {
  49. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  50. 'DIRS': [],
  51. 'APP_DIRS': True,
  52. 'OPTIONS': {
  53. 'context_processors': [
  54. 'django.template.context_processors.debug',
  55. 'django.template.context_processors.request',
  56. 'django.contrib.auth.context_processors.auth',
  57. 'django.contrib.messages.context_processors.messages',
  58. ],
  59. },
  60. },
  61. ]
  62. WSGI_APPLICATION = 'pmap.wsgi.application'
  63. # Database
  64. # https://docs.djangoproject.com/en/2.0/ref/settings/#databases
  65. os.environ.setdefault('DATABASE_URL', 'sqlite://')
  66. DATABASES = {'default': dj_database_url.config()}
  67. # Password validation
  68. # https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
  69. AUTH_PASSWORD_VALIDATORS = [
  70. {
  71. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  72. },
  73. {
  74. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  75. },
  76. {
  77. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  78. },
  79. {
  80. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  81. },
  82. ]
  83. # Internationalization
  84. # https://docs.djangoproject.com/en/2.0/topics/i18n/
  85. LANGUAGE_CODE = 'en-us'
  86. TIME_ZONE = 'UTC'
  87. USE_I18N = True
  88. USE_L10N = True
  89. USE_TZ = True
  90. # Static files (CSS, JavaScript, Images)
  91. # https://docs.djangoproject.com/en/2.0/howto/static-files/
  92. STATIC_URL = '/static/'
  93. STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')