django-hosts:Django的动态和静态主机解析。 将主机名映射到URLconf

时间:2021-04-29 00:44:47
【文件属性】:
文件名称:django-hosts:Django的动态和静态主机解析。 将主机名映射到URLconf
文件大小:47KB
文件格式:ZIP
更新时间:2021-04-29 00:44:47
Python django主机 这个Django应用将特定主机的请求路由到在称为“ hostconfs”的模块中定义的不同URL方案。 例如,如果您拥有example.com但希望在api.example.com和beta.example.com上提供特定内容, api.example.com以下内容添加到hosts.py文件中: from django_hosts import patterns, host host_patterns = patterns('path.to', host(r'api', 'api.urls', name='api'), host(r'beta', 'beta.urls', name='beta'), ) 这导致对{api,beta}.example.com请求被路由到其相应的URLconf。 您可以将urls.py用作这些hostconf的模板。
【文件预览】:
django-hosts-master
----MANIFEST.in(59B)
----README.rst(3KB)
----.coveragerc(64B)
----docs()
--------reference.rst(396B)
--------conf.py(7KB)
--------make.bat(4KB)
--------callbacks.rst(3KB)
--------changelog.rst(8KB)
--------faq.rst(811B)
--------requirements.txt(28B)
--------Makefile(5KB)
--------templatetags.rst(5KB)
--------index.rst(4KB)
----.github()
--------workflows()
----django_hosts()
--------managers.py(5KB)
--------apps.py(400B)
--------callbacks.py(4KB)
--------utils.py(435B)
--------resolvers.py(6KB)
--------middleware.py(3KB)
--------checks.py(696B)
--------__init__.py(479B)
--------defaults.py(5KB)
--------templatetags()
----tests()
--------test_utils.py(644B)
--------test_middleware.py(5KB)
--------models.py(963B)
--------test_defaults.py(3KB)
--------broken_module.py(178B)
--------test_resolvers.py(5KB)
--------__init__.py(0B)
--------migrations()
--------settings.py(442B)
--------hosts()
--------views.py(59B)
--------test_sites.py(5KB)
--------test_templatetags.py(5KB)
--------urls()
--------base.py(284B)
----tox.ini(446B)
----LICENSE(4KB)
----CONTRIBUTING.md(574B)
----setup.cfg(236B)
----AUTHORS(127B)
----setup.py(1KB)
----.gitignore(87B)
----Makefile(272B)

网友评论