Commit 3eacba31 authored by okhin's avatar okhin 🚴

Merge branch '29-fournir-une-structure-de-donnee-initiale' into 'rp2'

Ajout d'un urlpattern docs/api/ pour avoir au moins un minimum de...

Closes #28

See merge request !14
parents 5aa88a01 77419e0b
Pipeline #2495 passed with stages
in 4 minutes and 45 seconds
from rest_framework import routers from rest_framework import routers
from .views import ArticleViewSet, ArticleSearch, ArticleTag from .views import ArticleViewSet, ArticleSearch, ArticleTag
router = routers.DefaultRouter() router = routers.DefaultRouter()
router.register(r"articles", ArticleViewSet) router.register(r"articles", ArticleViewSet)
router.register(r"articles-by-tag/(?P<filter_tag>.+)", ArticleTag) router.register(r"articles-by-tag/(?P<filter_tag>.+)", ArticleTag)
router.register(r"articles-search/(?P<search_keywords>.+)", ArticleSearch) router.register(r"articles-search/(?P<search_keywords>.+)", ArticleSearch)
urlpatterns = router.urls urlpatterns = router.urls
...@@ -11,6 +11,10 @@ from django.contrib import admin ...@@ -11,6 +11,10 @@ from django.contrib import admin
from core.routers import DefaultRouter from core.routers import DefaultRouter
from rp.api.urls import router as rp_router from rp.api.urls import router as rp_router
# Django rest framework documentation
from rest_framework.documentation import include_docs_urls
router = DefaultRouter() router = DefaultRouter()
router.extend(rp_router) router.extend(rp_router)
...@@ -22,7 +26,8 @@ urlpatterns = [ ...@@ -22,7 +26,8 @@ urlpatterns = [
url(r"^feeds/", include("rp.feeds.urls", namespace="feeds")), url(r"^feeds/", include("rp.feeds.urls", namespace="feeds")),
url(r"^rp/", include("rp.urls", namespace="rp")), url(r"^rp/", include("rp.urls", namespace="rp")),
url(r'^accounts/', include('allauth.urls')), url(r'^accounts/', include('allauth.urls')),
url(r"^users/", include('userprofile.urls', namespace="users")) url(r"^users/", include('userprofile.urls', namespace="users")),
url(r"^docs/api/", include_docs_urls(title="API de la revue de presse")),
] ]
if settings.DEBUG: if settings.DEBUG:
......
...@@ -12,4 +12,7 @@ django-allauth ...@@ -12,4 +12,7 @@ django-allauth
django-fsm django-fsm
django-markdown2 django-markdown2
url url
coreapi
pygments
markdown
-e git+https://github.com/mariocesar/sorl-thumbnail.git#egg=sorl-thumbnail -e git+https://github.com/mariocesar/sorl-thumbnail.git#egg=sorl-thumbnail
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment