2025-03-06 12:10:17 -03:00
|
|
|
# ruff: noqa: E501
|
|
|
|
|
from .base import * # noqa: F403
|
|
|
|
|
from .base import INSTALLED_APPS
|
|
|
|
|
from .base import MIDDLEWARE
|
|
|
|
|
from .base import env
|
|
|
|
|
|
|
|
|
|
# GENERAL
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
|
|
|
|
|
DEBUG = True
|
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
|
|
|
|
SECRET_KEY = env(
|
|
|
|
|
"DJANGO_SECRET_KEY",
|
|
|
|
|
default="tYdYl0MP5zgpMlMmjBuYHvH4Dp3JDN5q3sxWBdFejemZSr0qpI9IrvrvTm17F0aW",
|
|
|
|
|
)
|
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
2025-03-07 07:10:13 +01:00
|
|
|
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1", "109.199.98.226"] # noqa: S104
|
2025-03-06 12:10:17 -03:00
|
|
|
|
|
|
|
|
# CACHES
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#caches
|
|
|
|
|
CACHES = {
|
|
|
|
|
"default": {
|
|
|
|
|
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
|
|
|
|
|
"LOCATION": "",
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# EMAIL
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
|
|
|
|
|
EMAIL_BACKEND = env(
|
2025-03-07 15:31:53 +01:00
|
|
|
"DJANGO_EMAIL_BACKEND",
|
|
|
|
|
default="django.core.mail.backends.console.EmailBackend",
|
2025-03-06 12:10:17 -03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# WhiteNoise
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development
|
|
|
|
|
INSTALLED_APPS = ["whitenoise.runserver_nostatic", *INSTALLED_APPS]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# django-debug-toolbar
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites
|
|
|
|
|
INSTALLED_APPS += ["debug_toolbar"]
|
|
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware
|
|
|
|
|
MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]
|
|
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config
|
|
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
|
|
|
|
"DISABLE_PANELS": [
|
|
|
|
|
"debug_toolbar.panels.redirects.RedirectsPanel",
|
|
|
|
|
# Disable profiling panel due to an issue with Python 3.12:
|
|
|
|
|
# https://github.com/jazzband/django-debug-toolbar/issues/1875
|
|
|
|
|
"debug_toolbar.panels.profiling.ProfilingPanel",
|
|
|
|
|
],
|
|
|
|
|
"SHOW_TEMPLATE_CONTEXT": True,
|
|
|
|
|
}
|
|
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips
|
|
|
|
|
INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]
|
|
|
|
|
if env("USE_DOCKER") == "yes":
|
|
|
|
|
import socket
|
|
|
|
|
|
|
|
|
|
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
|
|
|
|
|
INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
|
|
|
|
|
# RunServerPlus
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# This is a custom setting for RunServerPlus to fix reloader issue in Windows docker environment
|
|
|
|
|
# Werkzeug reloader type [auto, watchdog, or stat]
|
2025-03-07 15:31:53 +01:00
|
|
|
RUNSERVERPLUS_POLLER_RELOADER_TYPE = "stat"
|
2025-03-06 12:10:17 -03:00
|
|
|
# If you have CPU and IO load issues, you can increase this poller interval e.g) 5
|
|
|
|
|
RUNSERVERPLUS_POLLER_RELOADER_INTERVAL = 1
|
|
|
|
|
|
|
|
|
|
# django-extensions
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# https://django-extensions.readthedocs.io/en/latest/installation_instructions.html#configuration
|
|
|
|
|
INSTALLED_APPS += ["django_extensions"]
|
|
|
|
|
|
|
|
|
|
# Your stuff...
|
|
|
|
|
# ------------------------------------------------------------------------------
|