Discussion:
coreapi tutorial not working
Evan Zamir
2017-06-20 19:41:10 UTC
Permalink
Here is the code I have in my snippet.urls.py file:

from django.conf.urls import url, include
from snippets import views
from rest_framework.routers import DefaultRouter
from rest_framework.schemas import get_schema_view

schema_view = get_schema_view(title='Pastebin API')

# Create a router and register our viewsets with it.
router = DefaultRouter()
router.register(r'snippets', views.SnippetViewSet)
router.register(r'users', views.UserViewSet)

# The API URLs are now determined automatically by the router.
# Additionally, we include the login URLs for the browsable API.
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^schema/$', schema_view),
]


I followed all the instructions in the tutorial up until this point, but I
do not see the option of "corejson" in the browser menu. Furthermore, when
I run

coreapi get http://127.0.0.1:8000/schema/


I get the following:

➔ coreapi get http://127.0.0.1:8000/schema/
<Error: 403 Forbidden>
detail: "Authentication credentials were not provided."

Any idea what is going on?
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jijun Niu
2017-08-02 06:53:40 UTC
Permalink
Maybe I can degrade your coreapi to solve this issue. try:
pip install 'coreapi==2.0.0' --force-reinstall
Post by Evan Zamir
from django.conf.urls import url, include
from snippets import views
from rest_framework.routers import DefaultRouter
from rest_framework.schemas import get_schema_view
schema_view = get_schema_view(title='Pastebin API')
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.register(r'snippets', views.SnippetViewSet)
router.register(r'users', views.UserViewSet)
# The API URLs are now determined automatically by the router.
# Additionally, we include the login URLs for the browsable API.
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^schema/$', schema_view),
]
I followed all the instructions in the tutorial up until this point, but I
do not see the option of "corejson" in the browser menu. Furthermore, when
I run
coreapi get http://127.0.0.1:8000/schema/
➔ coreapi get http://127.0.0.1:8000/schema/
<Error: 403 Forbidden>
detail: "Authentication credentials were not provided."
Any idea what is going on?
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Daviddd
2017-08-09 12:18:02 UTC
Permalink
This for sure not. From the DRF doc:
http://www.django-rest-framework.org/topics/3.6-announcement/#interactive-api-documentation
The coreapi library is required as a dependancy for the API docs. Make
sure to install the latest version (2.3.0 or above).
pip install 'coreapi==2.0.0' --force-reinstall
Post by Evan Zamir
from django.conf.urls import url, include
from snippets import views
from rest_framework.routers import DefaultRouter
from rest_framework.schemas import get_schema_view
schema_view = get_schema_view(title='Pastebin API')
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.register(r'snippets', views.SnippetViewSet)
router.register(r'users', views.UserViewSet)
# The API URLs are now determined automatically by the router.
# Additionally, we include the login URLs for the browsable API.
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^schema/$', schema_view),
]
I followed all the instructions in the tutorial up until this point, but
I do not see the option of "corejson" in the browser menu. Furthermore,
when I run
coreapi get http://127.0.0.1:8000/schema/
➔ coreapi get http://127.0.0.1:8000/schema/
<Error: 403 Forbidden>
detail: "Authentication credentials were not provided."
Any idea what is going on?
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Adi Fahmi
2018-09-13 03:01:22 UTC
Permalink
Did you manage to solve this?

I also got the same problem

coreapi==2.3.3

Django==2.1

djangorestframework==3.8.2
Post by Evan Zamir
from django.conf.urls import url, include
from snippets import views
from rest_framework.routers import DefaultRouter
from rest_framework.schemas import get_schema_view
schema_view = get_schema_view(title='Pastebin API')
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.register(r'snippets', views.SnippetViewSet)
router.register(r'users', views.UserViewSet)
# The API URLs are now determined automatically by the router.
# Additionally, we include the login URLs for the browsable API.
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^schema/$', schema_view),
]
I followed all the instructions in the tutorial up until this point, but I
do not see the option of "corejson" in the browser menu. Furthermore, when
I run
coreapi get http://127.0.0.1:8000/schema/
➔ coreapi get http://127.0.0.1:8000/schema/
<Error: 403 Forbidden>
detail: "Authentication credentials were not provided."
Any idea what is going on?
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...