how to include django templates in app installed via pip?
Asked Answered
E

1

9

I'm working on a django app (django-flux) and I'm trying to get it to properly install with pip from pypi. From this blog post and the distutils documentation, it seems like my setup.py and MANIFEST.in files should be including the flux/templates/flux/*.html data files, for example, but they are not included when I install the app via pip for some reason.

Any suggestion on what I am doing wrong? How can you install django templates (among other non-python files)?

For reference, I have distutils 2.7.3.

Earring answered 3/12, 2012 at 23:18 Comment(0)
S
13

You are missing include_package_data=True in your setup function.

For more information on this you could turn to Flask's excellent documentation which covers writing a Basic Setup Script:

include_package_data tells distribute to look for a MANIFEST.in file and install all the entries that match as package data.

Then your are importing find_packages but aren't using it so far (packages = find_packages())

Sympetalous answered 4/12, 2012 at 0:5 Comment(1)
Dang it! I thought I tried that permutation. the include_package_data=True fixed it in the latest version github.com/deanmalmgren/django-flux/blob/… thanks!Earring

© 2022 - 2024 — McMap. All rights reserved.