Django app incorporation process
-
19-09-2019 - |
Question
Can some one please highlight what should be the process of incorporating reusable django app in a project without using setup.py.
Can we simply move app into project directory and start using it?
Solution
As long as it's on sys.path
, it will be found by Django. And yes, you can move it to project's directory.
OTHER TIPS
To add to that: if you are pretty sure you are only going to use an app once, it may be easiest just to drop it in the project directory; however, I have found that for apps I use more than once, it is easier to put in the sys.path
(as mentioned).
Since most apps are availabale via svn or git, I tend to grab the source (trunk) this way, and then create a symbolic link into my site-packages folders (which is on sys.path
). This way I can continue to pull updates to the app in this folder.
I do this with the django trunk as well.
For example, I have: ~/src/django-notification
and ~/src/django-trunk
. And I have then symbolically linked onto my python path.
sudo ln -s ~/src/django-notification/notification /usr/lib/python2.5/site-packages/notification
This way all my projects can import the app easily and I can continue to get updates.