Hi Tomas! A million thanks for you help!

On Thu, Jan 24, 2013 at 7:34 PM, Tomas Neme <lacrymol...@gmail.com> wrote:
> really, it should be your SHORT term goal.

Without airing our dirty laundry, I can't argue with that. I will push
a little harder to get us to convert our projects to envs sooner than
later. :)

> As for your problem, you can't expect to install FOOAPP in two
> different directories on the same environment (system global, in this
> case) and expect that to work OK.

I was worried about that. The decision to install the app in the other
project was the Django noob in me shinning through. :D

> You're supposed to install that just once, and USE it from different
> projects, if that's what you want to do. Also, if you're installing in
> the global system python installation, you should not put them under
> any single project's directory, but rather somewhere outside them,
> because otherwise you'll end up with modules that can be reached from
> two different paths (FOOAPP and ProjectA.FOOAPP) and that's bad.

Excellent tip. Thank you for giving me a fix. :)

To be honest, this was the first time I've used one app in multiple
projects, so we've never run into this problem before.

> Now for the templates. If you're making a reusable app and providing
> templates with it, you should do your best to make the templates
> reusable as well. The standard procedure is to have them under an
> <appname> directory like this:
> AppDir/templates/appname/TemplateFiles.html
> so the idea is that if you need special modifications for a project,
> you can put your special templates in your project's
> templates/appname/ directory, and the template loader will find your
> local templates before it falls back to the app's directory.
> I hope that's clear enough.

Definitely! In fact, that's probably the one thing that I was doing right. :D

Only, in the case of DjangoProjectB.FOOAPP, we put new templates in
DjangoProjectB/templates/FOOAPP/TemplateFiles.html.

> Also, make sure your app has a MANIFEST for setup.py to be able to
> install non-python files (e.g.: your templates) when you install it
> without the -e option. Look at the distutils docs for more details

Interesting! Thanks for that tip as well!

I do have a MANIFEST.in file which has:

include *.md
+include LICENSE

(I think the pip installer did not like the +)

I did not realize that I should account for templates like you say! I
appreciate the advice.

Thanks again Tomas! I owe you one! :)

Cheers,
M

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to