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.

25th Jan 2017, 6:43 PM
Aditya Gurjar
Aditya Gurjar - avatar
3 Respostas
0
Do you have the good path in Python ?
26th Jan 2017, 2:19 AM
Adrien
0
Didn't get what you meant there.
26th Jan 2017, 3:19 AM
Aditya Gurjar
Aditya Gurjar - avatar
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.
26th Jan 2017, 9:29 AM
Adrien