#-*-coding:utf-8-*- __author__ = 'lqe' from django.conf.urls import url from polls.views import Home urlpatterns = [url(u'^$',Home.as_view(),name='index')]
"""lab5 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 from django.contrib import admin from polls.views import Base, Home, Bank, Trans, BankView urlpatterns = [ url(r'^admin/$', admin.site.urls), url(r'^base/$', Base.as_view(), name='base'), url(r'^home/$', Home.as_view(), name='home'), url(r'^bank/(?P<id>\d+)$', BankView.as_view(), name='bank_url'), url(r'^bank/$', Bank.as_view(), name='bank'), url(r'transactions/$', Trans.as_view(), name='trans'), ]
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() from polls.views import Home, Detail urlpatterns = patterns('', url(r'^$', Home.as_view(), name='home'), url(r'^poll/(?P<pk>\d+)/$', Detail.as_view(), name='polls-detail'), url(r'^admin/', include(admin.site.urls)), )
from django.urls import path from polls.views import Home #cargamos la vista urlpatterns = [ path('', Home.as_view(), name='home'), #se renderiza como clase ]
#-*-coding:utf-8-*- __author__ = 'lqe' from django.conf.urls import url from polls.views import Home urlpatterns = [url(u'^$', Home.as_view(), name='index')]