I specified the version of Django in the Docker environment and installed it, so make a note of what I did The python version was 3.8.5 and the Django version was 1.11 but it didn't seem to support the python version, so I decided to raise the Django version. (Reference image is below)
https://docs.djangoproject.com/ja/3.1/faq/install/#what-python-version-can-i-use-with-django
Specify the version of requirements.txt
Django with RUN pip install -r requirements.txt
on the Dockerfile
Fixed Django version to 3.0
Django==3.0
psycopg2
freeze
Rebuild Docker environment
docker-compose down --rmi all --volumes
docker-compose up -d
Check the operation to see if the installation is successful Confirm with 2 patterns
toruchan:~/work/py-work (master *)$ docker-compose exec web ./manage.py --version
3.0
toruchan:~/work/py-work (master *)$
toruchan:~/work/py-work (master *)$ docker-compose exec web python -c "import django; print(django.get_version())"
3.0
toruchan:~/work/py-work (master *)$
Also check the python version
toruchan:~/work/py-work (master *)$ docker-compose exec web python --version
Python 3.8.5
toruchan:~/work/py-work (master *)$
With this, there seems to be no problem around the installation
Recommended Posts