Day 1: Python and Django project environment construction, preliminary preparation

Note: I started to contact the python programming language. On the first day of self-learning project framework construction, I used the current mainstream framework Django to build web projects.

Preliminary preparations:

	python 3.7
	Django 2.2
	Pycharm
	mysql
	navicat
  • Since I have a programming foundation, I am a Java development engineer, so I do n’t have much record of the installation process of the basic software. The current environment configuration only explains Django.

Installation of Django 2.2 environment

Open the cmd window, first make sure that the computer has python installed, and the environment has been configured well, then perform the following

pip install django==2.2 -i https://pypi.doubanio.com/simple

Note: The above command refers to the version of Django2.2 installed, the address is the domestic mirror address, the download is smooth, and the
installation will be successful:

Successfully installed django-2.2

You can also use the following command to view the current version of Django installed on the system

pip show django

Insert picture description here

Pycharm initial project creation

1.Pycharm If the community version is installed, there is no option below, the professional version refers to the operation below

Insert picture description here
1. Select Django option
2. Open Project Interpreter: Python 3.7-Existing interpreter-find the python launcher under the file directory of your python installation in Interpreter, which is python.exe
3. Fill in the name of the module in Application name, Click Create. The
Insert picture description here
initial structure has been successfully created, and then create some folders to get the general framework of Django. The
general framework is as follows:
Insert picture description here
New folder description:
1. static: static file resource directory, used to store css, js, html, etc.
2. media: a directory used to store resources such as pictures and videos uploaded and downloaded by the system
3. apps: create a package directory and place the original project package below to facilitate project management
4. extra_apps: create a package directory, It is convenient to place the source code of the third party under this directory.
5. requirements.txt: Create a requirements.txt file to record which packages the project depends on and the version of the project package

Published 90 original articles · 22 praises · 80,000 views

Guess you like

Origin blog.csdn.net/qq_32641813/article/details/105679672