Install django-js-reverse

This commit is contained in:
Ludovic Stephan 2019-11-29 14:50:44 +01:00
parent 091208b66c
commit 4e15ab8041
3 changed files with 13 additions and 1 deletions

View file

@ -64,7 +64,8 @@ INSTALLED_APPS = [
"django.contrib.sessions", "django.contrib.sessions",
"django.contrib.sites", "django.contrib.sites",
"django.contrib.messages", "django.contrib.messages",
"cof.apps.IgnoreSrcStaticFilesConfig", # Must be before django admin "cof.apps.IgnoreSrcStaticFilesConfig",
# Must be before django admin
# https://github.com/infoportugal/wagtail-modeltranslation/issues/193 # https://github.com/infoportugal/wagtail-modeltranslation/issues/193
"wagtail_modeltranslation", "wagtail_modeltranslation",
"wagtail_modeltranslation.makemigrations", "wagtail_modeltranslation.makemigrations",
@ -102,6 +103,7 @@ INSTALLED_APPS = [
"kfet.auth", "kfet.auth",
"kfet.cms", "kfet.cms",
"gestioncof.cms", "gestioncof.cms",
"django_js_reverse",
] ]
@ -259,3 +261,8 @@ FORMAT_MODULE_PATH = "cof.locale"
WAGTAIL_SITE_NAME = "GestioCOF" WAGTAIL_SITE_NAME = "GestioCOF"
WAGTAIL_ENABLE_UPDATE_CHECK = False WAGTAIL_ENABLE_UPDATE_CHECK = False
TAGGIT_CASE_INSENSITIVE = True TAGGIT_CASE_INSENSITIVE = True
# Django-js-reverse settings
JS_REVERSE_JS_VAR_NAME = "django_urls"
# Quand on aura namespace les urls...
# JS_REVERSE_INCLUDE_ONLY_NAMESPACES = ['k-fet']

View file

@ -8,8 +8,10 @@ from django.conf.urls.static import static
from django.contrib import admin from django.contrib import admin
from django.contrib.auth import views as django_auth_views from django.contrib.auth import views as django_auth_views
from django.urls import include, path from django.urls import include, path
from django.views.decorators.cache import cache_page
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from django_cas_ng import views as django_cas_views from django_cas_ng import views as django_cas_views
from django_js_reverse.views import urls_js
from wagtail.admin import urls as wagtailadmin_urls from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls from wagtail.documents import urls as wagtaildocs_urls
@ -121,6 +123,8 @@ urlpatterns = [
path("documents/", include(wagtaildocs_urls)), path("documents/", include(wagtaildocs_urls)),
# djconfig # djconfig
path("config", gestioncof_views.ConfigUpdate.as_view(), name="config.edit"), path("config", gestioncof_views.ConfigUpdate.as_view(), name="config.edit"),
# js-reverse
path("jsreverse/", cache_page(3600)(urls_js), name="js_reverse"),
] ]
if "events" in settings.INSTALLED_APPS: if "events" in settings.INSTALLED_APPS:

View file

@ -17,3 +17,4 @@ wagtail==2.7.*
wagtailmenus==3.* wagtailmenus==3.*
wagtail-modeltranslation==0.10.* wagtail-modeltranslation==0.10.*
django-cors-headers==2.2.0 django-cors-headers==2.2.0
django-js-reverse