跳转到主要内容

Django urls.py TemplateView urlpatterns

项目描述

安装

$ pip install django-urls-templateview

settings.py

INSTALLED_APPS+=['django_urls_templateview']

migrate

$ python manage.py migrate

功能

  • urls.py TemplateView urlpatterns
  • admin

模型

模型 列/字段
映射 django_urls_templateview id,url,template_name

示例

urls.py

from django.db import connection
from django.views.generic.base import TemplateView

urlpatterns = []

cursor = connection.cursor()
cursor.execute("SELECT url,template_name FROM public.django_urls_templateview")
for url,template_name in cursor.fetchall():
    urlpatterns.insert(0,path(url, TemplateView.as_view(template_name=template_name)))

项目详情


下载文件

为您的平台下载文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分布

django_urls_templateview-1.0.2.tar.gz (2.0 kB 查看哈希)

上传时间:

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面