コード例 #1
0
ファイル: urls.py プロジェクト: lqe/dj
#-*-coding:utf-8-*-
__author__ = 'lqe'

from django.conf.urls import url

from polls.views import Home

urlpatterns = [url(u'^$',Home.as_view(),name='index')]
コード例 #2
0
ファイル: urls.py プロジェクト: Smet1/Py
"""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'),
]
コード例 #3
0
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)),
)
コード例 #4
0
from django.urls import path
from polls.views import Home

#cargamos la vista
urlpatterns = [
    path('', Home.as_view(), name='home'),  #se renderiza como clase
]
コード例 #5
0
#-*-coding:utf-8-*-
__author__ = 'lqe'

from django.conf.urls import url

from polls.views import Home

urlpatterns = [url(u'^$', Home.as_view(), name='index')]