settings.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. """
  2. Django settings for NFTmarket project.
  3. Generated by 'django-admin startproject' using Django 4.0.4.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/4.0/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/4.0/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/4.0/howto/deployment/checklist/
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = 'django-insecure-agnf^2dq!tvh(e6e(zi66b7ay9hkv7g!c)uevl#z+!nn8huz7m'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. ALLOWED_HOSTS = ['127.0.0.1', 'localhost', '0.0.0.0']
  20. # Application definition
  21. INSTALLED_APPS = [
  22. 'django.contrib.admin',
  23. 'django.contrib.auth',
  24. 'django.contrib.contenttypes',
  25. 'django.contrib.sessions',
  26. 'django.contrib.messages',
  27. 'django.contrib.staticfiles',
  28. 'rest_framework',
  29. #'info_pages',
  30. ]
  31. MIDDLEWARE = [
  32. 'django.middleware.security.SecurityMiddleware',
  33. 'django.contrib.sessions.middleware.SessionMiddleware',
  34. 'django.middleware.common.CommonMiddleware',
  35. 'django.middleware.csrf.CsrfViewMiddleware',
  36. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  37. 'django.contrib.messages.middleware.MessageMiddleware',
  38. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  39. ]
  40. ROOT_URLCONF = 'NFTmarket.urls'
  41. TEMPLATES = [
  42. {
  43. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  44. 'DIRS': [Path.home().joinpath(BASE_DIR, 'templates')],
  45. 'APP_DIRS': True,
  46. 'OPTIONS': {
  47. 'context_processors': [
  48. 'django.template.context_processors.debug',
  49. 'django.template.context_processors.request',
  50. 'django.contrib.auth.context_processors.auth',
  51. 'django.contrib.messages.context_processors.messages',
  52. ],
  53. },
  54. },
  55. ]
  56. REST_FRAMEWORK = {
  57. # Use Django's standard `django.contrib.auth` permissions,
  58. # or allow read-only access for unauthenticated users.
  59. 'DEFAULT_PERMISSION_CLASSES': [
  60. 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
  61. ]
  62. }
  63. WSGI_APPLICATION = 'NFTmarket.wsgi.application'
  64. # Database
  65. # https://docs.djangoproject.com/en/4.0/ref/settings/#databases
  66. DATABASES = {
  67. 'default': {
  68. 'ENGINE': 'django.db.backends.sqlite3',
  69. 'NAME': BASE_DIR / 'db.sqlite3',
  70. }
  71. }
  72. # Password validation
  73. # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
  74. AUTH_PASSWORD_VALIDATORS = [
  75. {
  76. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  77. },
  78. {
  79. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  80. },
  81. {
  82. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  83. },
  84. {
  85. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  86. },
  87. ]
  88. # Internationalization
  89. # https://docs.djangoproject.com/en/4.0/topics/i18n/
  90. LANGUAGE_CODE = 'en-us'
  91. TIME_ZONE = 'UTC'
  92. USE_I18N = True
  93. USE_TZ = True
  94. # Static files (CSS, JavaScript, Images)
  95. # https://docs.djangoproject.com/en/4.0/howto/static-files/
  96. STATIC_URL = 'static/'
  97. # Default primary key field type
  98. # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
  99. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  100. STATICFILES_DIRS = [
  101. os.path.join(BASE_DIR, 'static'),
  102. ]