[PYTHON] Install by specifying the version of Django in the Docker environment

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)

スクリーンショット 2020-09-05 22.48.57.png

Reference material for version

https://docs.djangoproject.com/ja/3.1/faq/install/#what-python-version-can-i-use-with-django

What i did

Modify requirements.txt

Specify the version of requirements.txtDjango with RUN pip install -r requirements.txt on the Dockerfile Fixed Django version to 3.0

Django==3.0
psycopg2
freeze

Docker environment rebuild

Rebuild Docker environment

docker-compose down --rmi all --volumes
docker-compose up -d

Version confirmation

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

Install by specifying the version of Django in the Docker environment
SSL in the local environment of Docker / Rails / puma
How to install Docker in the local environment of an existing Rails application [Rails 6 / MySQL 8]
Setting the baseURL in the axios module of Docker environment Nuxt
Install laravel/Dusk in docker environment (laravel6)
Install lsb_release from the command line when lsb_release fails in docker environment
Run Redmine in the local environment of Windows10 Pro-Use Docker Desktop for Windows
I had to lower the PHP version in Docker + Composer + Laravel environment
[Error] Error during Docker build (solved by pulling the latest version of image)
Self-hosting with Docker of AuteMuteUs in Windows environment
Just install Laravel8 on docker in PHP8 environment
Improve the performance of your Docker development environment
Install an older version of Docker for Mac
Create an app by specifying the Rails version
Install the latest version of Jenkins on Ubuntu 16
Support out of support in docker environment using centos6
Call a method of the parent class by explicitly specifying the name in Ruby
Format of the log output by Tomcat itself in Tomcat 8
Prepare the execution environment of Tomcat in IntelliJ Community
Docker the development environment of Ruby on Rails project
Dramatically speed up slow bundle install in docker environment
Command memo to install xeyes in ubuntu docker environment
[Java] Get the file in the jar regardless of the environment
Install / run a standalone robot simulator in wsl2 / docker environment!
Docker monitoring-explaining the basics of basics-
Install yarn in docker image
Understand the basics of docker
[Docker] List of errors that occurred when building the environment
Install the plugin in Eclipse
Install docker and docker-compose on ubuntu in the shortest process
Get only the ID of the container specified by docker ps
I tried to build the environment little by little using docker
I tried to build the environment of WSL2 + Docker + VSCode
Switch the version of bundler
What I was addicted to when updating the PHP version of the development environment (Docker) from 7.2.11 to 7.4.x
[Be careful about changing the version of Xdebug! ] Create a development environment with Xdebug3 + docker + VS Code
Use MailHog for checking emails in the development environment (using Docker)
Switch the version of java installed by SDKMAN when moving directories
Examine the system information of AWS Lambda operating environment in Java
Get the current date and time by specifying the time zone in Thymeleaf
I tried to build the environment of PlantUML Server with Docker
Build a browser test environment using Capybara in the Docker development environment
How to install the language used in Ubuntu and how to build the environment
Replace preview by uploading by clicking the image in file_field of Rails
Install Rails in the development environment and create a new application
Simplified version of number calculation by collecting information in an instance
[Rails] How to reset the database in production environment (Capistrano version)
[Java version] The story of serialization
Check the version of Cent OS
Install CentOS Stream 8 in Hyper-V environment
Hit the Docker API in Rust
Order of processing in the program
Check MySQL logs in Docker environment
[Rails & Docker & MySQL environment construction] Could not find gem ‘mysql2 (> = 0.4.4, <0.6.0)’ in any of the gem sources listed in your Gemfile.
How to execute with commands of normal development language in Docker development environment
Install Zabbix 5.0 with Docker → Set up Slack notification in case of failure
Get the value of enum saved in DB by Rails with attribute_before_type_cast
Alert slack with alert manager in Docker environment
Rails on Docker environment construction procedure
GPU environment construction with Docker [October 2020 version]
Spring Boot environment construction with Docker (January 2021 version)
IntelliJ + Docker (APP + DB) + SpringBoot (Maven) environment construction
Docker environment construction
Wordpress local environment construction & development procedure with Docker
[Note] Build a Python3 environment with Docker in EC2
[Note] Create a java environment from scratch with docker
Rails Docker environment construction
Install by specifying the version of Django in the Docker environment
Get the result of POST in Java
Let's specify the version when using docker