Introduction to Python Django (2) Win

Explains how to build a development environment for Python and Django on Windows.

Python installation

First install Python. Please open the following URL in your browser.

Download the latest version for Windows https://www.python.org/downloads/

Download 3.8.1. (Choose the latest version of Python 3 at that time)

Double-click the downloaded python-3.8.1.exe.

python01.jpg

Install virtualenv

virtualenv is a tool for creating a virtual environment for Python. For each project

Build a fixed virtual environment.

Open a command prompt and enter the command as shown below. (User is hoge)

C:¥Users¥hoge> pip install virtualenv

Building a virtual environment --virtualenv

Create a virtual environment named env1 under My Documents.

C:¥Users¥hoge>cd Documents
C:¥Users¥hoge¥Documents> virtualenv env1

Use a virtual environment

Let's go inside the virtual environment env1.

C:¥Users¥hoge¥Documents> cd env1
C:¥Users¥hoge¥Documents¥env1> Scripts¥activate
(env1) C:¥Users¥hoge¥Documents¥env1> 

If (env1) is displayed like this, it is successful.

Use the Scripts \ deactivate command to exit the virtual environment, but keep this in mind as it will continue.

Install Django

Django is also one of the Python modules. Install in the virtual environment env1.

This time, I'll install the Django version specified for this course.

(env1) C:¥Users¥hoge¥Documents¥env1> pip install django==3.0.2

Check the version

You can view the list of Python packages installed locally in your virtual environment with the following command:

(env1) C:¥Users¥hoge¥Documents¥env1> pip freeze -l
asgiref==3.2.3
Django==3.0.2
pytz==2019.3
sqlparse==0.3.0

Installation of IDE integrated development environment

You can use any text editor to write your Django code, but we recommend that you install PyCharm Professional (https://www.jetbrains.com/pycharm/) as your IDE.

Features of PyCharm

Recently, there is an option to use Visual Studio Code as a Python IDE. I won't explain it here, but if you like the Japanese one for free, you can choose it. · Python code completion -If you can specify where the Python interpreter of the Python virtual environment is, debug execution Etc. can be done in the same way as PyCharm.

Install PyCharm Professional

  1. Download the Professional version from the Download PyCharm page.
  2. Open the downloaded .exe file.
  3. Click Next

pycharm01.jpg

  1. Click Next

pycharm02.jpg

  1. Do you have a shortcut on your desktop? Check and click Next

pycharm03.jpg

  1. This is good for the menu folder. Just click Install

pycharm04.jpg

  1. Finished

pycharm05.jpg

Start Pycharm

  1. After installation, let's start PyCharm.
  2. Click for Evaluate for free for 30 days

pycharm06.jpg

  1. Read carefully and click Accept.

pycharm07.jpg

Up to this point, in my case it has started. Since I installed the Community version once, is the setting left?

I think you've asked me what the theme should be, but the IDE theme: Darcula has a black background / white letters, and I feel like I'm writing code.

Once you've come this far, let's move on.

Continue to Introduction to Python Django (3)

Recommended Posts

Introduction to Python Django (2) Win
Introduction to Python Django (2) Mac Edition
Introduction to Python language
Introduction to OpenCV (python)-(2)
Introduction to serial communication [Python]
[Introduction to Python] <list> [edit: 2020/02/22]
Introduction to Python (Python version APG4b)
An introduction to Python Programming
Introduction to Python For, While
[Introduction to Udemy Python 3 + Application] 58. Lambda
[Introduction to Udemy Python 3 + Application] 31. Comments
Introduction to Python Numerical Library NumPy
Practice! !! Introduction to Python (Type Hints)
[Introduction to Python3 Day 1] Programming and Python
[Introduction to Python] <numpy ndarray> [edit: 2020/02/22]
[Introduction to Udemy Python 3 + Application] 57. Decorator
Introduction to Python Hands On Part 1
[Introduction to Python3 Day 13] Chapter 7 Strings (7.1-7.1.1.1)
[Introduction to Python] How to parse JSON
[Introduction to Udemy Python 3 + Application] 56. Closure
[Introduction to Python3 Day 14] Chapter 7 Strings (7.1.1.1 to 7.1.1.4)
Introduction to Protobuf-c (C language ⇔ Python)
[Introduction to Udemy Python3 + Application] 59. Generator
[Introduction to Python3 Day 15] Chapter 7 Strings (7.1.2-7.1.2.2)
[Introduction to Python] Let's use pandas
[Introduction to Python] Let's use pandas
[Introduction to Udemy Python 3 + Application] Summary
Introduction to image analysis opencv python
[Introduction to Python] Let's use pandas
An introduction to Python for non-engineers
[AWS SAM] Introduction to Python version
[Introduction to Python3 Day 21] Chapter 10 System (10.1 to 10.5)
[Python Tutorial] An Easy Introduction to Python
Introduction to MQTT (Introduction)
Introduction to Scrapy (1)
[Introduction to Udemy Python3 + Application] 18. List methods
[Introduction to Udemy Python3 + Application] 63. Generator comprehension
Introduction to Scrapy (3)
Migrate Django applications running on Python 2.7 to Python 3.5
Updated to Python 2.7.9
[Introduction to Udemy Python3 + Application] 28. Collective type
[Introduction to Python] How to use class in Python?
Introduction to Supervisor
Introduction of Python
Introduction to Tkinter 1: Introduction
[Introduction to Udemy Python3 + Application] 25. Dictionary-type method
[Introduction to Udemy Python3 + Application] 33. if statement
Introduction to Discrete Event Simulation Using Python # 1
[Introduction to Udemy Python3 + Application] 13. Character method
[Introduction to Python3, Day 17] Chapter 8 Data Destinations (8.1-8.2.5)
Python Django Tutorial (5)
Python Django Tutorial (2)
[Introduction to Udemy Python3 + Application] 55. In-function functions
[Introduction to Udemy Python3 + Application] 48. Function definition
[Introduction to Python3, Day 17] Chapter 8 Data Destinations (8.3-8.3.6.1)
A super introduction to Python bit operations
[Introduction to Udemy Python 3 + Application] 10. Numerical values
Introduction to Python Image Inflating Image inflating with ImageDataGenerator
Web-WF Python Tornado Part 3 (Introduction to Openpyexcel)
[Introduction to Udemy Python3 + Application] 21. Tuple type
Introduction to PyQt