Skip to content

Commit

Permalink
Update urls.py
Browse files Browse the repository at this point in the history
  • Loading branch information
algathento authored Dec 12, 2023
1 parent b322251 commit c5c51cf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions example/resource-provider-api/myapp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
2. Add a URL to urlpatterns: re_path(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
2. Add a URL to urlpatterns: re_path(r'^$', Home.as_view(), name='home')
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'))
1. Import the include() function: from django.urls import re_path, include
2. Add a URL to urlpatterns: re_path(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.urls import re_path, include
from django.contrib import admin

from myapp import views


urlpatterns = [
url(r'^api/end-point$', views.api_end_point),
url(r'^api/authenticated-end-point$', views.authenticated_end_point),
url(r'^admin/', admin.site.urls),
re_path(r'^api/end-point$', views.api_end_point),
re_path(r'^api/authenticated-end-point$', views.authenticated_end_point),
re_path(r'^admin/', admin.site.urls),
]

0 comments on commit c5c51cf

Please sign in to comment.