Installation de la Django Debug Toolbar pour l'environnement de DEV.

This commit is contained in:
2018-02-03 20:01:34 +01:00
parent 5e1c32a2ff
commit 52d56926d4
4 changed files with 39 additions and 28 deletions

View File

@ -13,18 +13,19 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.conf import settings
from django.conf.urls import include
from django.conf.urls import url
from django.contrib import admin
from collection import __version__ as app_version
from games.views import (
GameList,
GameViewSet,
GameTimelineViewSet,
PlatformViewSet,
)
from games.views import GameList
from games.views import GameTimelineViewSet
from games.views import GameViewSet
from games.views import PlatformViewSet
from rest_framework import routers
from rest_framework.documentation import include_docs_urls
from collection import __version__ as app_version
# Admin config
admin.site.site_title = 'OpenBackloggery'
admin.site.site_header = '%s %s' % (admin.site.site_title, app_version)
@ -34,17 +35,21 @@ router = routers.DefaultRouter()
router.register(r'games', GameViewSet)
router.register(r'platforms', PlatformViewSet)
router.register(
r'game_timelines',
GameTimelineViewSet,
base_name='game_timeline')
r'game_timelines', GameTimelineViewSet, base_name='game_timeline')
urlpatterns = [
url(r'^$', GameList.as_view(), name='homepage'),
url(r'^games/', include('games.urls', namespace='games'), name='games'),
url(r'^admin/', admin.site.urls),
url(r'^api/v1/', include(router.urls), name='api'),
url(r'^api/v1/docs/', include_docs_urls(title=' '.join(
[admin.site.site_title,
'API']))),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
url(r'^api/v1/docs/',
include_docs_urls(title=' '.join([admin.site.site_title, 'API']))),
url(r'^api-auth/',
include('rest_framework.urls', namespace='rest_framework'))
]
if settings.DEBUG:
import debug_toolbar
urlpatterns = [
url(r'^__debug__/', include(debug_toolbar.urls)),
] + urlpatterns