Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Template dirs in setup.py #24

Open
wants to merge 1 commit into from

5 participants

@aehlke

Hi,
I modified setup.py to include the template dirs for each app. Before this, installing via pip would not include them since they weren't Python packages. Data files have to be explicitly included in setup.py. The way I did it is a little brittle, but should work with any Django project I've personally seen - maybe you know a better way, but it seems to work fine for basic-apps at least.
Thanks for your hard work on this!
Alex

@franckbret

Yes please pull

@laran

So does this mean that the templates just aren't included with the install? I get a "TemplateDoesNotExist at /blog/" and I'm not sure why. Is your fix what's missing?

@laran: correct

@azuer88

@alex: I've sent another pull request similar to yours.

@wearpants

Seriously, just pull this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 10, 2010
  1. add template dirs, which otherwise would have been ignored due to not…

    Alex Ehlke authored
    … being Python modules, to setup
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 1 deletion.
  1. +12 −1 setup.py
View
13 setup.py
@@ -29,10 +29,21 @@ def fullsplit(path, result=None):
if "__init__.py" in filenames:
packages.append(".".join(fullsplit(dirpath)))
+template_patterns = [
+ 'templates/*.html',
+ 'templates/*/*.html',
+ 'templates/*/*/*.html',
+]
+
+package_data = dict(
+ (package_name, template_patterns)
+ for package_name in packages
+)
setup(name='django-basic-apps',
version='0.7',
description='Django Basic Apps',
author='Nathan Borror',
url='http://github.com/nathanborror/django-basic-apps',
- packages=packages)
+ packages=packages,
+ package_data=package_data)
Something went wrong with that request. Please try again.