0
Can anyone help me with using djangorestframework with virtualenv?
I'm facing issues setting up Django rest framework with virtualenv. I've created a virtual env and installed Django rest using pip. I've then included 'rest_framework' in my INSTALLED_APPS in settings.py But on running it gives out error " module rest_framework not found" Can someone provide me with a solution? I couldn't find any on forums.
3 Respuestas
0
Do you have the good path in Python ?
0
Didn't get what you meant there.
0
ok look !
First you should know where your Python script is going to look for modules. At the beginning of your script add:
import sys
print(sys.path)
This will print the list of directories where Python is going to look for modules. If you know where is yours you can do:
sys.path.append(foo)
Where 'foo' is the absolute/relative path to go to your module.