|
|
@ -1,19 +1,20 @@ |
|
|
|
""" |
|
|
|
Django base settings for sigi project. |
|
|
|
|
|
|
|
Generated by 'django-admin startproject' using Django 4.0.1. |
|
|
|
Generated by 'django-admin startproject' using Django 5.0.6. |
|
|
|
|
|
|
|
For more information on this file, see |
|
|
|
https://docs.djangoproject.com/en/4.0/topics/settings/ |
|
|
|
https://docs.djangoproject.com/en/5.0/topics/settings/ |
|
|
|
|
|
|
|
For the full list of settings and their values, see |
|
|
|
https://docs.djangoproject.com/en/4.0/ref/settings/ |
|
|
|
https://docs.djangoproject.com/en/5.0/ref/settings/ |
|
|
|
""" |
|
|
|
|
|
|
|
import environ |
|
|
|
from pathlib import Path |
|
|
|
from django.utils.translation import gettext_lazy as _ |
|
|
|
from django.conf.locale.pt_BR import formats as br_formats |
|
|
|
from djbs import djbs_constants |
|
|
|
|
|
|
|
|
|
|
|
# Build paths inside the project like this: BASE_DIR / 'subdir'. |
|
|
@ -41,6 +42,22 @@ DATA_UPLOAD_MAX_NUMBER_FIELDS = 3000 |
|
|
|
# Application definition |
|
|
|
|
|
|
|
INSTALLED_APPS = [ |
|
|
|
"djbs", |
|
|
|
"django.forms", |
|
|
|
"django.contrib.admin", |
|
|
|
"admin_auto_filters", |
|
|
|
"django.contrib.auth", |
|
|
|
"django.contrib.contenttypes", |
|
|
|
"django.contrib.sessions", |
|
|
|
"django.contrib.messages", |
|
|
|
"django.contrib.staticfiles", |
|
|
|
"django.contrib.sites", |
|
|
|
"django_extensions", |
|
|
|
"django_filters", |
|
|
|
"localflavor", |
|
|
|
"import_export", |
|
|
|
"tinymce", |
|
|
|
"rest_framework", |
|
|
|
"sigi.apps.casas", |
|
|
|
"sigi.apps.contatos", |
|
|
|
"sigi.apps.convenios", |
|
|
@ -53,22 +70,6 @@ INSTALLED_APPS = [ |
|
|
|
"sigi.apps.servicos", |
|
|
|
"sigi.apps.servidores", |
|
|
|
"sigi.apps.utils", |
|
|
|
"localflavor", |
|
|
|
"import_export", |
|
|
|
"tinymce", |
|
|
|
"django.forms", |
|
|
|
"rest_framework", |
|
|
|
"material", |
|
|
|
"material.admin", |
|
|
|
"admin_auto_filters", |
|
|
|
"django.contrib.auth", |
|
|
|
"django.contrib.contenttypes", |
|
|
|
"django.contrib.sessions", |
|
|
|
"django.contrib.messages", |
|
|
|
"django.contrib.staticfiles", |
|
|
|
"django.contrib.sites", |
|
|
|
"django_extensions", |
|
|
|
"django_filters", |
|
|
|
] |
|
|
|
|
|
|
|
MIDDLEWARE = [ |
|
|
@ -107,7 +108,7 @@ DEFAULT_FROM_EMAIL = env( |
|
|
|
SERVER_EMAIL = DEFAULT_FROM_EMAIL |
|
|
|
|
|
|
|
# Database |
|
|
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases |
|
|
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases |
|
|
|
|
|
|
|
DATABASES = { |
|
|
|
"default": env.db(), |
|
|
@ -127,6 +128,7 @@ TEMPLATES = [ |
|
|
|
"django.contrib.auth.context_processors.auth", |
|
|
|
"django.contrib.messages.context_processors.messages", |
|
|
|
"django.template.context_processors.media", |
|
|
|
"djbs.context_processors.sets", |
|
|
|
"sigi.apps.utils.context_processors.site_context", |
|
|
|
"sigi.apps.home.context_processors.dashboard", |
|
|
|
], |
|
|
@ -139,7 +141,7 @@ FORM_RENDERER = "django.forms.renderers.TemplatesSetting" |
|
|
|
WSGI_APPLICATION = "sigi.wsgi.application" |
|
|
|
|
|
|
|
# Internationalization |
|
|
|
# https://docs.djangoproject.com/en/4.0/topics/i18n/ |
|
|
|
# https://docs.djangoproject.com/en/5.0/topics/i18n/ |
|
|
|
|
|
|
|
LANGUAGE_CODE = "pt-br" |
|
|
|
|
|
|
@ -154,7 +156,7 @@ USE_TZ = True |
|
|
|
USE_THOUSAND_SEPARATOR = True |
|
|
|
|
|
|
|
# Password validation |
|
|
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators |
|
|
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators |
|
|
|
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [ |
|
|
|
{ |
|
|
@ -214,7 +216,7 @@ LOGIN_REDIRECT_URL = "home_index" |
|
|
|
|
|
|
|
|
|
|
|
# Static files (CSS, JavaScript, Images) |
|
|
|
# https://docs.djangoproject.com/en/4.0/howto/static-files/ |
|
|
|
# https://docs.djangoproject.com/en/5.0/howto/static-files/ |
|
|
|
|
|
|
|
STATIC_URL = "static/" |
|
|
|
STATICFILES_DIRS = [ |
|
|
@ -223,13 +225,13 @@ STATICFILES_DIRS = [ |
|
|
|
STATIC_ROOT = BASE_DIR / "../static/" |
|
|
|
|
|
|
|
# Media files |
|
|
|
# https://docs.djangoproject.com/en/4.0/topics/files/#managing-files |
|
|
|
# https://docs.djangoproject.com/en/5.0/topics/files/#managing-files |
|
|
|
|
|
|
|
MEDIA_ROOT = BASE_DIR / "../media" |
|
|
|
MEDIA_URL = "media/" |
|
|
|
|
|
|
|
# Default primary key field type |
|
|
|
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field |
|
|
|
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field |
|
|
|
|
|
|
|
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
|
|
|
|
|
|
@ -243,20 +245,18 @@ IMPORT_EXPORT_SKIP_ADMIN_LOG = True |
|
|
|
br_formats.DATE_FORMAT = br_formats.SHORT_DATE_FORMAT |
|
|
|
br_formats.DATETIME_FORMAT = br_formats.SHORT_DATETIME_FORMAT |
|
|
|
|
|
|
|
# Django Material Admin settings |
|
|
|
# https://github.com/MaistrenkoAnton/django-material-admin#django-material-administration |
|
|
|
|
|
|
|
MATERIAL_ADMIN_SITE = { |
|
|
|
"HEADER": _("SIGI - Sistema de Informações do Interlegis"), |
|
|
|
"TITLE": _("SIGI"), |
|
|
|
"FAVICON": "img/favicon.ico", |
|
|
|
"PROFILE_PICTURE": "img/interlegis.jpeg", # Admin site profile picture (path to static should be specified) |
|
|
|
"PROFILE_BG": "img/engitec.jpeg", # Admin site profile background (path to static should be specified) |
|
|
|
"LOGIN_LOGO": "img/interlegis.jpeg", # Admin site logo on login page (path to static should be specified) |
|
|
|
"LOGOUT_BG": "img/engitec.jpeg", # Admin site background on login/logout pages (path to static should be specified) |
|
|
|
"SHOW_THEMES": False, # Show default admin themes button |
|
|
|
"TRAY_REVERSE": False, # Hide object-tools and additional-submit-line by default |
|
|
|
"NAVBAR_REVERSE": False, # Hide side navbar by default |
|
|
|
# djbs-theme settings - Django Bootstrap Theme |
|
|
|
# https://github.com/interlegis/djbs-theme/?tab=readme-ov-file#customizing |
|
|
|
|
|
|
|
DJBSTHEME_DEFAULTS = { |
|
|
|
"SEARCH_URL": None, |
|
|
|
"SEARCH_PARAM": None, |
|
|
|
"MENU_FILE": BASE_DIR / "menu_conf.yaml", |
|
|
|
"CHECK_AS_SWITCH": True, |
|
|
|
"FILTER_STYLE": djbs_constants.FILTER_STYLE_CLASSIC, |
|
|
|
"FIELDSET_STYLE": djbs_constants.STYLE_CARD, |
|
|
|
"INLINESET_STYLE": djbs_constants.STYLE_CARD, |
|
|
|
"BADGERIZE_FACETS": True, |
|
|
|
} |
|
|
|
|
|
|
|
# tinyMCE rich text editor settings |
|
|
|