treecoder
treecoder

Reputation: 45091

Pyramid + github + pip: install problems

I need to install a Pyramid project from a private repo from github.

The project has a structure something like this:

project_name
  project_name
    models/
    views/
    templates/
    __init__.py

  setup.py

I do a git clone and then do pip install project_name to install it from the local repo in a virtualenv.

Then I start the server with pserve production.ini and it starts without problems.

But, I get problems locating the mako templates...

I get the error:

TopLevelLookupException: Cant locate template for uri for `home.mak`

Also, I notice that inside the site_packages where my project is installed, ALL the files are copied except the templates/ directory. Why is this happening?

In my production.ini, I have the directive...

mako.directories = my_project:templates

And inside my view functions, I am doing something like this:

@view_config(route_name='home', renderer="home.mak")
def home_view(req):
    ...

Why am I getting this error?

UPDATE

When I manually copy the templates folder into the env/lib/python3.2/site-packages/my_pproject/ -- everything works just fine.

Hence, my question is: why is the templates directory NOT getting copied when I install the package?

Upvotes: 0

Views: 173

Answers (1)

treecoder
treecoder

Reputation: 45091

I needed to add the MANIFEST.in file which is important when you need to add non python files to your install.

Upvotes: 1

Related Questions