46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
"""
|
|
Além de /api/, este urls.py também serve o frontend (templates/*.html) —
|
|
front e back na mesma origem, para autenticação por sessão/cookie funcionar
|
|
sem CORS. Os estáticos (static/) são servidos por django.contrib.staticfiles
|
|
automaticamente em DEBUG (ver STATICFILES_DIRS em settings.py); em produção,
|
|
rode `manage.py collectstatic` e sirva STATIC_ROOT via whitenoise/nginx.
|
|
"""
|
|
|
|
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.contrib import admin
|
|
from django.urls import include, path
|
|
from django.views.generic import TemplateView
|
|
|
|
PAGINAS_FRONTEND = [
|
|
"index.html",
|
|
"portal.html",
|
|
"perfis-acesso.html",
|
|
"usuarios.html",
|
|
"calendario-individual.html",
|
|
"links-ferramentas.html",
|
|
"acessos-gerais.html",
|
|
"ramais.html",
|
|
"importacao-plano-saude.html",
|
|
"importacao-plano-saude-de-paula.html",
|
|
"conciliacao-fornecedores.html",
|
|
"custo-contratacao.html",
|
|
"indicador-desempenho.html",
|
|
"nao-conformidades.html",
|
|
"dashboard-contabil.html",
|
|
"dashboard-contabil-de-paula.html",
|
|
]
|
|
|
|
urlpatterns = [
|
|
path("admin/", admin.site.urls),
|
|
path("api/", include("portal_api.urls")),
|
|
path("", TemplateView.as_view(template_name="index.html")),
|
|
]
|
|
|
|
urlpatterns += [
|
|
path(pagina, TemplateView.as_view(template_name=pagina)) for pagina in PAGINAS_FRONTEND
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|