Vijesh Venugopal
Vijesh Venugopal

Reputation: 1641

How to include templates to a django package?

I have created a new django app and uploaded it to pypi as a new package.But when we install the package to a project, the html files inside the template folder is not showing.Why is this happening? Also the setup.py file(sample) is given below:

from distutils.core import setup

setup(
    name='test',
    version='0.1.0',
    author='Devs',
    author_email='[email protected]',
    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",
    ],
)

Upvotes: 3

Views: 1692

Answers (1)

lanzz
lanzz

Reputation: 43158

Django template directories are not Python packages. You probably need to specify them as data_files in Distutils.

Upvotes: 4

Related Questions