0

I am writing a program which uses Jinja2. I use PackageLoader - a template loader which looks for templates inside Python packages. I am distributing my program with distutils. How can I make distutils install template files inside python packages, together with modules? I tried writing in setup.py something like that:

packages=['myapp.mypackage', 'myapp.templates']

but id does not work - only files with .py extension which are inside myapp.templates gets installed, but templates, which have .html extension, do not.

user983447
  • 1,598
  • 4
  • 19
  • 36
  • I'm afraidi it is not a duplicate of "Including non-Python files with setup.py". I know about "package-data", but when I use "package-data" I mus say where those files should be put - and I just want them to be put in the same place where modules are. – user983447 Jan 03 '14 at 14:57
  • Wouldn't you just use [data_files](http://docs.python.org/2/distutils/setupscript.html#installing-additional-files) with an empty string for the directory? `data_files=[("", ["package_name/templates/*.html"])]` perhaps? – Sean Vieira Jan 03 '14 at 22:19

0 Answers0