25👍
If you already activated your virtualenv (source /path/bin/activate
) then check if you have installed Django.
pip install django
With next command you can see if Django was installed.
pip freeze | grep django
Another thing that you can try is to remove first line (#!/usr/bin/env python
) in the manage.py
file.
6👍
You should check if django is installed
Activate your environment, then run the following command to see which version is installed :
python -c "import django; print(django.get_version())"
- How to use Channel instead of Group when using django channels?
- Django and multi-stage servers
- Iterating over a Django QuerySet while deleting objects in the same QuerySet
- Django no module named "compressor"
1👍
I am using virtual environment so I added this line in manage.py
:
sys.path.append('./myvenv/lib/python3.5/site-packages')
in which myvenv
is the name of my virtual environment and version of my installed Python is 3.5
.
This solved my issued.
- How to find top-X highest values in column using Django Queryset without cutting off ties at the bottom?
- 'WSGIRequest' object has no attribute 'Post'
- Saving Base64ImageField Type using Django Rest saves it as Raw image. How do I convert it to a normal image
- Passing a variable in redirect in Django
- Object of type 'TypeError' is not JSON serializable
0👍
I found that I had Python 3.4 and 2.7 installed concurrently, and the pip install django==1.7
command automagically decided the Python 3.4 /dist-packages was where it should live. I CD’d over to the Python 2.7 directory and re-piped it… and all is well.
- How to deploy a WordPress site and Django site on the same domain?
- Generate update query using django orm
0👍
sudo pip install django --upgrade
worked for me, i am not having virutal environment by the way.
- A Simple View to Display/Render a Static image in Django
- Django – links generated with {% url %} – how to make them secure?
0👍
I had the same problem when I was running Django from inside a virtual environment and then using another terminal window ran the command
python manage.py shell
without first switching to the venv.
The problem was resolved after I switched back.
- Add object level permission to generic view
- Django's HttpResponseRedirect is http instead of https
- Do I need to close connection in mongodb?
0👍
I found that I could import the django module from the python interpreter, but django-admin.py could not import it when run from the command line.
I confirmed that I was using the python interpreter in my virtual environment.
I was using a 64-bit version of python. Uninstalling, and installing the 32-bit version, then re-creating my venv solved this for me.
- How to show database errors to user in Django Admin
- Django translations and gettext: The deprecation of the % (string interpolation) operator
- Limit Maximum Choices of ManyToManyField
0👍
If you’re using virtualenv, you can add it to your path using sys.path.append('./myvenv/lib/python3.5/site-packages')
.
Try closing and opening the terminal again. That worked for me too.
- U'rest_framework' is not a registered namespace
- Django – missing 1 required positional argument: 'request'
- Django rest framework cache policy
- Specify order of columns in SELECT with UNION using Django ORM
- Django Create View Image Upload