如何将模板包含到django包中?

时间:2014-01-28 10:15:14

标签: python django

我创建了一个新的django应用程序并将其作为新包上传到pypi。但是当我们将软件包安装到项目时,模板文件夹中的html文件没有显示。为什么会发生这种情况? setup.py文件(示例)也在下面给出:

from distutils.core import setup

setup(
    name='test',
    version='0.1.0',
    author='Devs',
    author_email='tester@gmail.com',
    packages=     ['tester','tester.apps','tester.templates'],
    url='http://pypi.python.org/pypi/tester/',
    license='LICENSE.txt',
    description='A reusable app',
    long_description=open('README.txt').read(),
    install_requires=[
        "Django == 1.5",
        "Unidecode==0.04.14",
        "django-ckeditor==4.0.2",
        "django-email-extras==0.1.13",
        "django-extensions==1.2.5",
        "django-forms-builder==0.9",
        "jsonfield==0.9.20",
        "python-gnupg==0.3.5",
        "sphinx-me==0.2.1",
        "wsgiref==0.1.2",
        "South==0.8.4",
    ],
)

1 个答案:

答案 0 :(得分:3)

Django模板目录不是Python包。您可能需要specify them as data_files in Distutils