urlpatterns
section, but if you do that, you lose the ability to get to the original Django admin page link at: 127.0.0.1:8000/admin/ (in fact it will throw another exception). So perhaps the code in this section should be modified to fix that problem.--
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-fram...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/6307fb92-3cce-4c5f-b630-6d076fb081dao%40googlegroups.com.
restservice
"""
restservice URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
#
# Original (default) now disabled per DRF Installation Guide: https://www.django-rest-framework.org/#example
# We intend to create a read-write API for accessing information on the users of our project.
#
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
url(r'^api-auth/', include('rest_framework.urls')) # Per: https://www.django-rest-framework.org/#installation:
# ...add REST framework's login and logout views.
]
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/6307fb92-3cce-4c5f-b630-6d076fb081dao%40googlegroups.com.
--
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-fram...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/3535b2aa-5df4-47bd-8a81-74336e9f4c86o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/CA%2Ba7aJ1%2BgVAQhpTokEzoVumEvGO10Q2h_46m9HjzW%3Di1_ik0GA%40mail.gmail.com.
Hi again Daniel.You made your point, I don't agree with you though.Seems to me that the documentation is fineIn the "installation" link you were following you have just small pieces of code, so don't follow this as a tutorial, if you just want "copy and paste" go the the "Tuorial" part from the DRF (Django Rest Framework).The "Installation" provides only some examples, but you should not just copy and paste from there.In your code for example you're trying to use the url function without importing it, for this code to work properly, you should first import the url function.from django.contrib import admin
from django.urls import path, includefrom django.conf.urls import url #IMPORT THIS LINE IT WILL WORK.
urlpatterns = [
path('admin/', admin.site.urls),
url(r'^api-auth/', include('rest_framework.urls')) # Per: https://www.django-rest-framework.org/#installation:
# ...add REST framework's login and logout views.
]as I said, follow the tutorial session and you will find a really working project.That would be advises.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/6307fb92-3cce-4c5f-b630-6d076fb081dao%40googlegroups.com.
--
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+unsub...@googlegroups.com.