settings.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. """
  2. Django settings for upsharing project.
  3. Generated by 'django-admin startproject' using Django 3.1.5.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/3.1/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/3.1/ref/settings/
  8. """
  9. import os
  10. from pathlib import Path
  11. # Build paths inside the project like this: BASE_DIR / 'subdir'.
  12. BASE_DIR = Path(__file__).resolve().parent.parent
  13. # Quick-start development settings - unsuitable for production
  14. # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = 'wv--u0_-5w2%aidw&^s0p!lva9cz$bip7c)&oxdq@xe+2m%pmt'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. ALLOWED_HOSTS = []
  20. # Application definition
  21. INSTALLED_APPS = [
  22. 'sharing.apps.SharingConfig',
  23. 'django.contrib.admin',
  24. 'django.contrib.auth',
  25. 'django.contrib.contenttypes',
  26. 'django.contrib.sessions',
  27. 'django.contrib.messages',
  28. 'django.contrib.staticfiles',
  29. ]
  30. MIDDLEWARE = [
  31. 'django.middleware.security.SecurityMiddleware',
  32. 'django.contrib.sessions.middleware.SessionMiddleware',
  33. 'django.middleware.common.CommonMiddleware',
  34. 'django.middleware.csrf.CsrfViewMiddleware',
  35. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  36. 'django.contrib.messages.middleware.MessageMiddleware',
  37. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  38. ]
  39. ROOT_URLCONF = 'upsharing.urls'
  40. TEMPLATES = [
  41. {
  42. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  43. 'DIRS': [],
  44. 'APP_DIRS': True,
  45. 'OPTIONS': {
  46. 'context_processors': [
  47. 'django.template.context_processors.debug',
  48. 'django.template.context_processors.request',
  49. 'django.contrib.auth.context_processors.auth',
  50. 'django.contrib.messages.context_processors.messages',
  51. ],
  52. },
  53. },
  54. ]
  55. WSGI_APPLICATION = 'upsharing.wsgi.application'
  56. # Database
  57. # https://docs.djangoproject.com/en/3.1/ref/settings/#databases
  58. DATABASES = {
  59. 'default': {
  60. 'ENGINE': 'django.db.backends.sqlite3',
  61. 'NAME': BASE_DIR / 'db.sqlite3',
  62. }
  63. }
  64. # Password validation
  65. # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
  66. AUTH_PASSWORD_VALIDATORS = [
  67. {
  68. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  69. },
  70. {
  71. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  72. },
  73. {
  74. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  75. },
  76. {
  77. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  78. },
  79. ]
  80. # Internationalization
  81. # https://docs.djangoproject.com/en/3.1/topics/i18n/
  82. LANGUAGE_CODE = 'en-us'
  83. TIME_ZONE = 'UTC'
  84. USE_I18N = True
  85. USE_L10N = True
  86. USE_TZ = True
  87. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  88. MEDIA_URL = '/media/'
  89. # Uncomment lines di bawah ini kalau ingin menggunakan AWS S3
  90. # DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
  91. # AWS_ACCESS_KEY_ID = ''
  92. # AWS_SECRET_ACCESS_KEY = ''
  93. # AWS_STORAGE_BUCKET_NAME = ''
  94. # AWS_IS_GZIPPED = True
  95. # Static files (CSS, JavaScript, Images)
  96. # https://docs.djangoproject.com/en/3.1/howto/static-files/
  97. STATIC_URL = '/static/'