Python is installed in almost every environment, but the packages required for each project tend to vary widely. E.g. some projects only work with Django version 1.6, while others are designed for Django version 1.7.
For this reason, some ingenious person created virtual environments. And this is the helpful tutorial done on Red Hat.
Your project is most likely meant to run from within such a virtual environment. The fact that Python can't import django.http
suggests that your default environment doesn't even have Django installed.
Developers put the environment folders in different places. Your previous developer may have put it within the project folder, or in another place where other virtual environments are stored.
Look for a folder name with a structure like [name_for_env]/bin/activate
.
You would activate this with:
source [name_for_env]/bin/activate
Then deactivate with:
deactivate
When you are in a virtual environment, you can install missing packages with:
pip install [name_of_package]
OR
You're also using PDB wrong. And that will also give you the import error message. You must run the server with manage.py
. This is necessary to setup various Django settings.
Run it like so:
python -m pdb manage.py runserver
You can enter in PDB breakpoints in your views.py by following this tutorial.