3rd party Apps in Django

14 views
Skip to first unread message

Andre Lopes

unread,
Aug 15, 2011, 8:59:58 AM8/15/11
to django...@googlegroups.com
Hi, I have put this question in StackOverflow, but no response untill
now... This is an important question to me to understand how Django
works

I am new to Django.

I have some doubts about installing 3rd party Apps in Django.

A specific example. The "django-registration" App in
https://bitbucket.org/ubernostrum/django-registration/src. Reading the
instructions the doc tell us to install this app with PIP(pip install
django-registration), doing this the App will be installed in Python
Site-packages, right?

My question is: The App must to be installed in that way? Why not put
the 'django-registration' folder in our Project as an App?

PS: This is a starter Django Question.

Best Regards,

Cal Leeming [Simplicity Media Ltd]

unread,
Aug 15, 2011, 9:02:56 AM8/15/11
to django...@googlegroups.com
Personally, I don't rely on easy_install/pip to install project specific packages into the OS site-packages.

There is absolutely nothing stopping you from doing this on a project level, as I would recommend to do it where ever possible. 

Although do remember, some packages won't be cross-system compatible (such as MySQL-python).

Cal


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


william ratcliff

unread,
Aug 15, 2011, 9:07:19 AM8/15/11
to django...@googlegroups.com
Someone else may want to confirm this, but were there any issues with signals depending on location within the project?

Best,
William

Thomas Weholt

unread,
Aug 15, 2011, 9:11:42 AM8/15/11
to django...@googlegroups.com
Hmmm...

Using pip will take care of requirements the package might have and
install it in the right python lib folder so several projects can use
it among other things.

Are there good reasons NOT to use pip/easy_install or at least python
setup.py install?

Thomas

> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

--
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

william ratcliff

unread,
Aug 15, 2011, 9:12:45 AM8/15/11
to django...@googlegroups.com
Yes--as I recalled from the documentation:

I’ve got functions listening for the registration/activation signals, but they’re not getting called!

The most common cause of this is placing django-registration in a sub-directory that’s on your Python import path, rather than installing it directly onto the import path as normal. Importing from django-registration in that case can cause various issues, including incorrectly connecting signal handlers. For example, if you were to place django-registration inside a directory named django_apps, and refer to it in that manner, you would end up with a situation where your code does this:


from django_apps.registration.signals import user_registered

But django-registration will be doing:


from registration.signals import user_registered

From Python’s point of view, these import statements refer to two different objects in two different modules, and so signal handlers connected to the signal from the first import will not be called when the signal is sent using the second import.

To avoid this problem, follow the standard practice of installing django-registration directly on your import path and always referring to it by its own module name: registration (and in general, it is always a good idea to follow normal Python practices for installing and using Django applications).

william ratcliff

unread,
Aug 15, 2011, 9:17:54 AM8/15/11
to django...@googlegroups.com
Generally, I tend to create a local cache of dependencies (ex. beautiful soup, django-registration, etc.) and then use pip to install them to the python site-packages directory.   The reason I use pip is because uninstall can be a pain.  It's only when there are 3rd party apps that I need to modify (which I try to avoid :p) that I include them in an "external_apps" folder under the project directory.   I suppose some of this is a matter of personal preference.  I use pip instead of easy_install because it keeps a record of which packages are installed and allows for uninstall.     You might also want to investigate virtual-env.   I think the main goal for me is to try to keep things as decoupled as possible and to keep packages locally in case their source somehow vanishes online, or if I depend on the particulars of a given version...

Best,
William

Andre Lopes

unread,
Aug 15, 2011, 9:25:19 AM8/15/11
to django...@googlegroups.com
Thanks for your replies.Now I understand the differences.

Best Regards,

Cal Leeming [Simplicity Media Ltd]

unread,
Aug 15, 2011, 1:32:52 PM8/15/11
to django...@googlegroups.com
+1

Although I haven't personally used virtual-env, from what I've seen this may be worth looking at (seems to be the bridge between users that don't want to have root privs, but do want to manage their python install)

On Mon, Aug 15, 2011 at 2:17 PM, william ratcliff <william....@gmail.com> wrote:

Chris Lawlor

unread,
Aug 15, 2011, 6:54:19 PM8/15/11
to django...@googlegroups.com
+1 for using virtualenv. Indispensable for working on more than one dingo project on the same development machine. If you're developing on Linux or Mac, take a look at virtualenvwrapper. It makes working with virtual environments practically painless.

Derek

unread,
Aug 17, 2011, 2:35:00 AM8/17/11
to Django users
Chris

"Dingo" projects? Is that what they call them in Australia ;)
Reply all
Reply to author
Forward
0 new messages