django problem - install the xxx package by putting it on your python path?
I'm trying to deploy Everyblock specifically its ebblog package on my OSX. I already have both Python and Django installed, unfortunately I am fairly new to both Python and Django.
The readme says something like this:
- Install th开发者_JAVA技巧e ebblog package by putting it on your Python path.
Here is the complete readme if you need further context: https://github.com/brosner/everyblock_code/blob/master/ebblog/README.TXT
I'm stuck at #1 - when oyu look at the ebblog its a whole django new application directory/file structure, so do I like copy this entier folder to my python's .../lib folder or what?
I can't imagine copying the entire ebblog folder if that is what it meant by the instruction.
Thanks in advance.
Usually, installing to the python path means making a python package or module importable, so that when you do
import someapp
you can then use someapp in your code. In order to do that you can
- put the package's path into sys.path (import sys;sys.path.append("path/to/package"))
- put the path into a file someapp.pth and place someapp.pth inside your dist-packages directory
- put the path into the PYTHONPATH environment variable
plus some others, see The Module Search Path.
Have a look at virtualenv. It helps to keep dependencies of different projects separate. Here's a good tutorial.
精彩评论