"""geographic URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/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')) """ from django.contrib import admin from django.urls import path, include from countries.views import HomeView, TagsView, CountryDetailView, CountryDetailIDView from continents.views import ContinentsView urlpatterns = [ path('admin/', admin.site.urls), path('', HomeView.as_view(), name="home"), path('tags/', TagsView.as_view(), name="tags"), path('continents/', include("continents.urls", namespace="continents")), path('countries/', include("countries.urls")), path('people/', include("people.urls")) ]
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/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')) """ from django.contrib import admin from django.urls import path, include from countries.views import (HomeView, TagsView, CountryDetailView, CountryIdDetailView ) #importar la vistas de countries from continents.views import ContinentsView urlpatterns = [ path('admin/', admin.site.urls), path('', HomeView.as_view(), name="home"), #name, permite colocar nombres a las url path('tags/', TagsView.as_view(), name="tags"), path('continents/', include("continents.urls", namespace="continents")), path('countries/', include("countries.urls")), path('people/', include("people.urls")), ]
"""geographic URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(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') 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')) """ from django.conf.urls import url, include from django.contrib import admin from countries.views import HomeView, TagsView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^home/', HomeView.as_view(), name="home"), url(r'^tags/', TagsView.as_view(), name="tags"), url(r'^continents/', include("continents.urls", namespace="continents")), url(r'^countries/', include("countries.urls")), url(r'^people/', include("people.urls")), url(r'', HomeView.as_view()), ]
from django.urls import path from countries.views import ( HomeView, TagsView, CountryDetailView, CountrySearchView, ) app_name = 'countries' urlpatterns = [ path('', HomeView.as_view(), name='home'), path('tags/', TagsView.as_view(), name='tags'), path('<str:code>/', CountryDetailView.as_view(), name='country_detail_code'), path('search/<query>/', CountrySearchView.as_view(), name='country_search') ]
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(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') 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')) """ from django.conf.urls import url from countries.views import CountryDetailView, CountryDetailIdView, CountrySearchView, HomeView, CreateCountryView urlpatterns = [ url(r'^register/', CreateCountryView.as_view(), name="country_register"), url(r'^search/(?P<pk>.*)/$', CountrySearchView.as_view(), name="country_search"), url(r'^(?P<pk>\d+)/$', CountryDetailIdView.as_view(), name="country_id_detail"), url(r'^(?P<code>.*)/$', CountryDetailView.as_view(), name="country_code_detail"), url(r'', HomeView.as_view(), name="country_home") ]
from django.urls import path from countries.views import HomeView, \ CountryIdDetailView, \ CountriesSearchView, \ CreateCountryView urlpatterns = [ path("", HomeView.as_view(), name='countries.index'), path("<int:id>", CountryIdDetailView.as_view(), name='countries.detail'), path("create", CreateCountryView.as_view(), name='countries.create'), path("search/<query>", CountriesSearchView.as_view(), name='countries.search'), ]