"""my_upload URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/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 include, url
from django.contrib import admin

from upload.views import IndexView

urlpatterns = [
    url(r"^$", IndexView.as_view()),
    url(r"^admin/", admin.site.urls),
    url(r"^upload/", include("upload.urls")),
]
示例#2
0
from django.contrib import admin
from django.urls import path
from upload.views import IndexView, UploadViewImage, UploadViewUrl, get_upload_page, get_image
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', IndexView.as_view()),
    path('upload/from_image/', UploadViewImage.as_view()),
    path('upload/from_url/', UploadViewUrl.as_view()),
    path('upload/', get_upload_page),
    path('img/<str:img>/', get_image)
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
"""my_upload URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/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 include, url
from django.contrib import admin

from upload.views import IndexView

urlpatterns = [
    url(r'^$', IndexView.as_view()),
    url(r'^admin/', admin.site.urls),
    url(r'^upload/', include('upload.urls')),
]
示例#4
0
文件: urls.py 项目: kesuki/App-Web
from django.conf.urls import patterns, url

from . import views
from upload.views import IndexView
from upload.views import DetailView
from upload.views import JiaguView
from upload.views import JieguView

app_name = 'upload'
urlpatterns = [
    url(r'^$', IndexView.as_view(), name='index'),
    # url(r'^(?P<hash>[0-9abcdef]+)/$', views.detail, name='detail'),
    url(r'^(?P<pk>[0-9abcdef]+)/$', views.DetailView.as_view(), name='detail'),
    url(r'^(?P<pk>[0-9abcdef]+)/jiagu/(?P<pk2>[0-9abcdef]+)$', views.JiaguView.as_view(), name='jiagu'),
    url(r'^(?P<pk>[0-9abcdef]+)/jiagu/fingerprint/$', views.JiagufingerprintView.as_view(), name='fingerprint'),
    url(r'^(?P<pk>[0-9abcdef]+)/jiagu/secretkey/$', views.JiagusecretkeyView.as_view(), name='secretkey'),
    url(r'^(?P<pk>[0-9abcdef]+)/jiegu/$', views.JieguView.as_view(), name='jiegu'),
]