diff --git a/requirements/base.txt b/requirements/base.txt index 4fe5f68ad1..c115eb35c3 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -8,6 +8,7 @@ django-import-export==0.4.2 django-mptt==0.8.7 django-reversion==1.8.6 django-rq==0.9.0 +django-sitetree==1.7.0 django-taggit==0.17.1 django-taggit-serializer==0.1.5 django-threadlocals==0.8 @@ -26,5 +27,4 @@ six>=1.9.0 sqlparse==0.1.16 Unidecode==0.04.18 tablib==0.11.2 -git+https://github.com/idlesign/django-sitetree.git@a626559c39ff1e865cde3441c44f42864c648dfb factory-boy diff --git a/src/ralph/settings/dev.py b/src/ralph/settings/dev.py index 6858ab97b9..59f29824c3 100644 --- a/src/ralph/settings/dev.py +++ b/src/ralph/settings/dev.py @@ -22,10 +22,6 @@ def only_true(request): ROOT_URLCONF = 'ralph.urls.dev' -# Disable exception for the missing element in SiteTree -# https://github.com/idlesign/django-sitetree/pull/157/files -RAISE_ITEMS_ERRORS_ON_DEBUG = False - TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', diff --git a/src/ralph/urls/base.py b/src/ralph/urls/base.py index 240dc0726d..d3d59e0fe4 100644 --- a/src/ralph/urls/base.py +++ b/src/ralph/urls/base.py @@ -1,10 +1,16 @@ from django.conf import settings from django.conf.urls import include, url from rest_framework.authtoken import views +from sitetree.sitetreeapp import SiteTree # noqa from ralph.admin import ralph_site as admin from ralph.api import router +# monkey patch for sitetree until +# https://github.com/idlesign/django-sitetree/issues/226 will be discussed +# and resolved +SiteTree.current_app_is_admin = lambda self: False + # import custom urls from each api module # notice that each module should have `urlpatters` variable defined # (as empty list if there is any custom url)