Django backend for WorkX project
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

base.py 2.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. from pathlib import Path
  2. # Build paths inside the project like this: BASE_DIR / 'subdir'.
  3. BASE_DIR = Path(__file__).resolve().parent.parent
  4. # Quick-start development settings - unsuitable for production
  5. # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
  6. # SECURITY WARNING: keep the secret key used in production secret!
  7. SECRET_KEY = 'django-insecure--oe&1myti$m^yq^r_)uljs+mnl(k4hj13x1i)c6xrvm1s99obz'
  8. # SECURITY WARNING: don't run with debug turned on in production!
  9. DEBUG = True
  10. INSTALLED_APPS = [
  11. 'django.contrib.admin',
  12. 'django.contrib.auth',
  13. 'django.contrib.contenttypes',
  14. 'django.contrib.sessions',
  15. 'django.contrib.messages',
  16. 'django.contrib.staticfiles',
  17. 'rest_framework',
  18. 'rest_framework.authtoken',
  19. 'drfpasswordless'
  20. ]
  21. PASSWORDLESS_AUTH = {
  22. 'PASSWORDLESS_AUTH_TYPES': ['EMAIL'],
  23. 'PASSWORDLESS_EMAIL_NOREPLY_ADDRESS': 'kj@webtrigon.com',
  24. }
  25. MIDDLEWARE = [
  26. 'django.middleware.security.SecurityMiddleware',
  27. 'django.contrib.sessions.middleware.SessionMiddleware',
  28. 'django.middleware.common.CommonMiddleware',
  29. 'django.middleware.csrf.CsrfViewMiddleware',
  30. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  31. 'django.contrib.messages.middleware.MessageMiddleware',
  32. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  33. ]
  34. ROOT_URLCONF = 'workx_backend.urls'
  35. REST_FRAMEWORK = {
  36. 'DEFAULT_AUTHENTICATION_CLASSES': [
  37. 'rest_framework.authentication.TokenAuthentication'
  38. ]
  39. }
  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 = 'workx_backend.wsgi.application'
  56. AUTH_PASSWORD_VALIDATORS = [
  57. {
  58. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  59. },
  60. {
  61. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  62. },
  63. {
  64. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  65. },
  66. {
  67. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  68. },
  69. ]
  70. # Internationalization
  71. # https://docs.djangoproject.com/en/4.0/topics/i18n/
  72. LANGUAGE_CODE = 'en-us'
  73. TIME_ZONE = 'UTC'
  74. USE_I18N = True
  75. USE_TZ = True
  76. # Static files (CSS, JavaScript, Images)
  77. # https://docs.djangoproject.com/en/4.0/howto/static-files/
  78. STATIC_URL = 'static/'
  79. # Default primary key field type
  80. # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
  81. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'