Re: 2 projects, 2 apps, bad templates ...
Use virtualenvs. That's basic for any serious python development
you'll want to do.
Besides that, you might add DjangoProjectA to sys.path on ProjectA
(and add DjangoProjectB to sys.path on ProjectB) in their respective
manage.py files.
On the other hand, why does pip install -e install it under ProjectA's
directories? that shouldn't happen, you should end up with a SINGLE
FOOAPP package, probably in /usr/local/lib or something. Try removing
(or renaming so it's not there under that name, anyways)
ProjectA/FOOAPP and see if adding FOOAPP to INSTALLED_APPS uses the
global version (the one you installed with `sudo pip`)
On Thu, Jan 24, 2013 at 10:58 PM, Micky Hulse <rgmicky@gmail.com> wrote:
> Noob alert! :D
>
> I work on a server where we have multiple Django projects that all
> share one Django installation.
>
> Each project has it's own subdomain.
>
> At this time, we aren't using virtual envs.
>
> Situation:
>
> 1. I built a basic application (let's call it FOOAPP) inside of
> DjangoProjectA; after using it for a while, I decided to put the app
> on GitHub.
>
> 2. One of my co-workers wanted to use the same app, but he needed it
> on DjangoProjectB; I installed FOOAPP using PIP from GitHub:
>
> $ sudo pip install -e git+https://github.com/user/FOOAPP.git#egg=FOOAPP
>
> ... which put it in a "src" folder at the root level of the
> DjangoProjectB project directory.
>
> 3. DjangoProjectB's FOOAPP now works great.
>
> 4. DjangoProjectA's FOOAPP templates all broke.
>
> From what we could tell, FOOAPP from DjangoProjectA was looking at the
> template folder from DjangoProjectB.
>
> We fixed the problem by being more explicit in DjangoProjectA's
> settings.py file. In other words, we changed this:
>
> INSTALLED_APPS = (
> # ...
> 'FOOAPP',
> # ...
> )
>
> ... to this:
>
> INSTALLED_APPS = (
> # ...
> 'DjangoProjectA.FOOAPP',
> # ...
> )
>
> And all of our templates came back to life.
>
> Other than setting up virtual environments, is there a better way to
> fix the problem? Being more explicit for this one particular app is
> fine, bu I think it kinda feels like a dirty patch.
>
> What did we do wrong? Why would Django look in a different project's
> app for templates before looking in its own? Tips on how to avoid this
> in the future?
>
> Thanks!
> 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+unsubscribe@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.
>
>
--
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde
|_|0|_|
|_|_|0|
|0|0|0|
(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.
--
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+unsubscribe@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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home