This commit is contained in:
Herculino Trotta
2024-10-09 00:31:21 -03:00
parent e78e4cc5e1
commit 3dde44b1cd
139 changed files with 4965 additions and 1004 deletions
+36 -4
View File
@@ -13,6 +13,10 @@ https://docs.djangoproject.com/en/5.1/ref/settings/
import os
from pathlib import Path
SITE_TITLE = "WYGIWYH"
TITLE_SEPARATOR = "::"
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
ROOT_DIR = Path(__file__).resolve().parent.parent.parent
@@ -57,7 +61,9 @@ INSTALLED_APPS = [
"apps.currencies.apps.CurrenciesConfig",
"apps.accounts.apps.AccountsConfig",
"apps.common.apps.CommonConfig",
"tz_detect",
"apps.net_worth.apps.NetWorthConfig",
"cachalot",
"rest_framework",
]
MIDDLEWARE = [
@@ -65,6 +71,7 @@ MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"apps.common.middleware.timezone.TimezoneMiddleware",
"django.middleware.locale.LocaleMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
@@ -73,7 +80,6 @@ MIDDLEWARE = [
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"django_browser_reload.middleware.BrowserReloadMiddleware",
"hijack.middleware.HijackUserMiddleware",
"tz_detect.middleware.TimezoneMiddleware",
]
ROOT_URLCONF = "WYGIWYH.urls"
@@ -150,7 +156,7 @@ LANGUAGES = (
("pt-br", "Português (Brasil)"),
)
TIME_ZONE = "America/Sao_Paulo"
TIME_ZONE = "UTC"
USE_I18N = True
@@ -200,7 +206,26 @@ SESSION_EXPIRE_AT_BROWSER_CLOSE = False
SESSION_COOKIE_AGE = 86400 # 24 horas
SESSION_COOKIE_SECURE = os.getenv("HTTPS_ENABLED", "false").lower() == "true"
DEBUG_TOOLBAR_CONFIG = {"ROOT_TAG_EXTRA_ATTRS": "hx-preserve"}
DEBUG_TOOLBAR_CONFIG = {
"ROOT_TAG_EXTRA_ATTRS": "hx-preserve",
"SHOW_TOOLBAR_CALLBACK": lambda r: False, # disables it}
}
DEBUG_TOOLBAR_PANELS = [
"debug_toolbar.panels.history.HistoryPanel",
"debug_toolbar.panels.versions.VersionsPanel",
"debug_toolbar.panels.timer.TimerPanel",
"debug_toolbar.panels.settings.SettingsPanel",
"debug_toolbar.panels.headers.HeadersPanel",
"debug_toolbar.panels.request.RequestPanel",
"debug_toolbar.panels.sql.SQLPanel",
"debug_toolbar.panels.staticfiles.StaticFilesPanel",
"debug_toolbar.panels.templates.TemplatesPanel",
"debug_toolbar.panels.cache.CachePanel",
"debug_toolbar.panels.signals.SignalsPanel",
"debug_toolbar.panels.redirects.RedirectsPanel",
"debug_toolbar.panels.profiling.ProfilingPanel",
"cachalot.panels.CachalotPanel",
]
INTERNAL_IPS = [
"127.0.0.1",
]
@@ -216,3 +241,10 @@ if DEBUG:
except socket.gaierror:
# The node container isn't started (yet?)
pass
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
"DEFAULT_PERMISSION_CLASSES": ["rest_framework.permissions.DjangoModelPermissions"]
}
+6 -1
View File
@@ -23,7 +23,12 @@ urlpatterns = [
path("hijack/", include("hijack.urls")),
path("__debug__/", include("debug_toolbar.urls")),
path("__reload__/", include("django_browser_reload.urls")),
path("tz_detect/", include("tz_detect.urls")),
path("api/", include("rest_framework.urls")),
path("", include("apps.transactions.urls")),
path("", include("apps.common.urls")),
path("", include("apps.users.urls")),
path("", include("apps.accounts.urls")),
path("", include("apps.net_worth.urls")),
path("", include("apps.monthly_overview.urls")),
path("", include("apps.currencies.urls")),
]