Last active
March 16, 2021 23:32
-
-
Save rg3915/05e4370650e5db1971ee1db33bfb03b4 to your computer and use it in GitHub Desktop.
Python url routes definition Django Flask url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # urls.py | |
| person_patterns = [ | |
| path('', v.person_list, name='person_list'), | |
| path('<int:pk>/', v.person_detail, name='person_detail'), | |
| path('add/', v.person_create, name='person_create'), | |
| path('<int:pk>/update/', v.person_update, name='person_update'), | |
| path('<int:pk>/delete/', v.person_delete, name='person_delete'), | |
| ] | |
| api_person_patterns = [ | |
| path('', v.api_person_list, name='api_person_list'), | |
| path('<int:pk>/', v.api_person_detail, name='api_person_detail'), | |
| ] | |
| url_patterns = [ | |
| path('persons/', include(person_patterns)), | |
| path('/api/persons/', include(api_person_patterns)), | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment