mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-15 10:32:30 +03:00
Update config
This commit is contained in:
parent
5d7d8f54d5
commit
bddd16572d
|
@ -4,9 +4,11 @@
|
||||||
{% if cookiecutter.use_celery == 'y' -%}
|
{% if cookiecutter.use_celery == 'y' -%}
|
||||||
import ssl
|
import ssl
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
from datetime import timedelta
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import environ
|
import environ
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
|
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
|
||||||
# {{ cookiecutter.project_slug }}/
|
# {{ cookiecutter.project_slug }}/
|
||||||
|
@ -28,14 +30,11 @@ DEBUG = env.bool("DJANGO_DEBUG", False)
|
||||||
# In Windows, this must be set to your system time zone.
|
# In Windows, this must be set to your system time zone.
|
||||||
TIME_ZONE = "{{ cookiecutter.timezone }}"
|
TIME_ZONE = "{{ cookiecutter.timezone }}"
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#language-code
|
# https://docs.djangoproject.com/en/dev/ref/settings/#language-code
|
||||||
LANGUAGE_CODE = "en-us"
|
LANGUAGE_CODE = "sr-latn"
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#languages
|
# https://docs.djangoproject.com/en/dev/ref/settings/#languages
|
||||||
# from django.utils.translation import gettext_lazy as _
|
LANGUAGES = [
|
||||||
# LANGUAGES = [
|
("sr-latn", _("Serbian")),
|
||||||
# ('en', _('English')),
|
]
|
||||||
# ('fr-fr', _('French')),
|
|
||||||
# ('pt-br', _('Portuguese')),
|
|
||||||
# ]
|
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#site-id
|
# https://docs.djangoproject.com/en/dev/ref/settings/#site-id
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
|
# https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
|
||||||
|
@ -97,6 +96,10 @@ THIRD_PARTY_APPS = [
|
||||||
"rest_framework.authtoken",
|
"rest_framework.authtoken",
|
||||||
"corsheaders",
|
"corsheaders",
|
||||||
"drf_spectacular",
|
"drf_spectacular",
|
||||||
|
"dj_rest_auth",
|
||||||
|
"dj_rest_auth.registration",
|
||||||
|
"rest_framework_simplejwt",
|
||||||
|
"rest_framework_simplejwt.token_blacklist",
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
|
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
|
||||||
"webpack_loader",
|
"webpack_loader",
|
||||||
|
@ -240,6 +243,8 @@ CSRF_COOKIE_HTTPONLY = True
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#x-frame-options
|
# https://docs.djangoproject.com/en/dev/ref/settings/#x-frame-options
|
||||||
X_FRAME_OPTIONS = "DENY"
|
X_FRAME_OPTIONS = "DENY"
|
||||||
|
|
||||||
|
DATA_UPLOAD_MAX_NUMBER_FIELDS = 10_000
|
||||||
|
|
||||||
# EMAIL
|
# EMAIL
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
|
||||||
|
@ -367,6 +372,7 @@ STATICFILES_FINDERS += ["compressor.finders.CompressorFinder"]
|
||||||
# django-rest-framework - https://www.django-rest-framework.org/api-guide/settings/
|
# django-rest-framework - https://www.django-rest-framework.org/api-guide/settings/
|
||||||
REST_FRAMEWORK = {
|
REST_FRAMEWORK = {
|
||||||
"DEFAULT_AUTHENTICATION_CLASSES": (
|
"DEFAULT_AUTHENTICATION_CLASSES": (
|
||||||
|
"rest_framework_simplejwt.authentication.JWTAuthentication",
|
||||||
"rest_framework.authentication.SessionAuthentication",
|
"rest_framework.authentication.SessionAuthentication",
|
||||||
"rest_framework.authentication.TokenAuthentication",
|
"rest_framework.authentication.TokenAuthentication",
|
||||||
),
|
),
|
||||||
|
@ -374,6 +380,15 @@ REST_FRAMEWORK = {
|
||||||
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
|
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
REST_AUTH = {
|
||||||
|
"USE_JWT": True,
|
||||||
|
"JWT_AUTH_HTTPONLY": False,
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMPLE_JWT = {
|
||||||
|
"ACCESS_TOKEN_LIFETIME": timedelta(days=env.int("SIMPLE_JWT_ACCESS_TOKEN_LIFETIME", default=180)),
|
||||||
|
}
|
||||||
|
|
||||||
# django-cors-headers - https://github.com/adamchainz/django-cors-headers#setup
|
# django-cors-headers - https://github.com/adamchainz/django-cors-headers#setup
|
||||||
CORS_URLS_REGEX = r"^/api/.*$"
|
CORS_URLS_REGEX = r"^/api/.*$"
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ SECRET_KEY = env(
|
||||||
default="!!!SET DJANGO_SECRET_KEY!!!",
|
default="!!!SET DJANGO_SECRET_KEY!!!",
|
||||||
)
|
)
|
||||||
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
||||||
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"] # noqa: S104
|
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1", "*"] # noqa: S104
|
||||||
|
|
||||||
# CACHES
|
# CACHES
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -23,10 +23,19 @@ services:
|
||||||
env_file:
|
env_file:
|
||||||
- ./.envs/.local/.django
|
- ./.envs/.local/.django
|
||||||
- ./.envs/.local/.postgres
|
- ./.envs/.local/.postgres
|
||||||
|
- path: ./.env # Use this .env file to override the values .envs/.local/.django
|
||||||
|
- required: false
|
||||||
ports:
|
ports:
|
||||||
- '8000:8000'
|
- '8000:8000'
|
||||||
command: /start
|
command: /start
|
||||||
|
|
||||||
|
interpreter:
|
||||||
|
<<: *django
|
||||||
|
profiles:
|
||||||
|
- interpreter
|
||||||
|
container_name: gebi_local_interpreter
|
||||||
|
ports: []
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
@ -38,6 +47,8 @@ services:
|
||||||
- {{ cookiecutter.project_slug }}_local_postgres_data_backups:/backups
|
- {{ cookiecutter.project_slug }}_local_postgres_data_backups:/backups
|
||||||
env_file:
|
env_file:
|
||||||
- ./.envs/.local/.postgres
|
- ./.envs/.local/.postgres
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
|
||||||
{%- if cookiecutter.use_mailpit == 'y' %}
|
{%- if cookiecutter.use_mailpit == 'y' %}
|
||||||
|
|
||||||
|
@ -46,6 +57,7 @@ services:
|
||||||
container_name: {{ cookiecutter.project_slug }}_local_mailpit
|
container_name: {{ cookiecutter.project_slug }}_local_mailpit
|
||||||
ports:
|
ports:
|
||||||
- "8025:8025"
|
- "8025:8025"
|
||||||
|
- "1025:1025"
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if cookiecutter.use_celery == 'y' %}
|
{%- if cookiecutter.use_celery == 'y' %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user