I need to setup a Django dev environment.
I did a git clone and pulled all the django project files from production on my local machine (a Vagrant enabled VM).
The problem is that my local machine has a different path to the project than my production ( and I can’t change that) so it’s having problems finding modules stated under INSTALLED_APPS on my local machine.
For example on the production my project is on the /myproject folder while on my local machine is under /vagrant/web/myproject.
On the production I’m accessing my app modules like this:
INSTALLED_APPS = ( 'myproject.myapp')
Also within the Django apps I’m accessing various app modules like this:
from myproject.myapp.models import *
What do I need to do to emulate production paths to my modules on my dev box so I don’t have to change the paths to the modules on my local machine?
If you’re doing project-relative imports, all you need to do is ensure that the path directly above your project is on the
PYTHONPATH.You need only issue the following at the command line:
If you’re using virtualenv, you can add that line to your environment’s bin/activate file.