davidmiller/pony-mode — pull request #83 by myrjola (2014-05-11 11:02:49+00:00)
Title: Fix pony-goto-template for projects with TEMPLATE_DIRS in project root

One of my Django projects has the following layout with the templates-directory in the project root like this:
```
.
├── app1
├── app2
├── manage.py
├── static
└── templates
```
The TEMPLATE_DIRS variable is defined like this:
```
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, "templates"),
)
```

This results in the tuple `('templates',)`, but pony-goto-template tries to find the template directory from `app1/templates`. By using pony-locate when expanding the template filename we can accomodate both directory layouts.