Idea configure python and django development environment

Configure python:

1. First go to the official website to install python, here is version 3.7, portal: https://www.python.org/downloads/, after installation, there is no automatic configuration of environment variables under the manual configuration D:\Python\, Open the command line and enter python. If the prompt "is not an internal or external command, nor a runnable program
or batch file", it means that the configuration environment variable has failed and needs to be checked and reconfigured; open idea: File ->Settings ->Plugins, and input Python search, click the link search if you don’t find it, and click Install if you see Python. If the download fails, you can install it locally. Here is the download address: https://git.oschina.net/zidianqingshuang/python_tools/blob/master/idea -python-plugin-143.121.zip?dir=0&filepath=idea-python-plugin-143.121.zip&oid=9f5ce763cf0b315ee239558791d9567ef4d60b75&sha=883b899de1f1fbd85b05be39bf9fd5699fc626c2, if the address is too long, you can copy it under: https://zi_toolschinaqings.net/python_toolschina : idea-python-plugin.txt or idea-python-plugin-143.121.zip is   downloaded and click Install plugin from disk below to find the compressed package to install it. After the installation is successful, restart

2.File ->New->Proejct, find python, configure Project Sdk, which is the installation directory of your python, the default is C:\Python27\python.exe, click Next, you don’t need to click Create project from tempplte Next, I saw the Project name and Project location as well as the Module name, Content root, and Module file location below. Fill in this by yourself and click Finish

Configure Django:

1. First download the Django package, the portal: https://github.com/django/django, after downloading, it is best to unzip it under D:\Python\, enter the folder, and enter the command python setup.py install You can install it. After installation, open the command line and enter python, enter import django, enter django.get_version() to display the version number, which means the installation is successful

Or use

pip3 install Django installation method, but first install pip

2.File ->New->Proejct, find python, configure Project Sdk, then check Django, and enter the path of the template in the Template folder below, I am here: D:\Python\django-1.8.19\django \template, click Next, you don’t need to click Next when you see Create project from tempplte, then you see the Project name and Project location and the Module name, Content root and Module file location below, fill in this by yourself, click Finish, then the project is under The root directory will generate a folder and a file:

 

, After building File->Project Structure->Facts, find Django, configure Django project root (the project directory), settings (settings.py file in the picture above), Manager script (manage.py file in the picture above) )

Guess you like

Origin blog.csdn.net/fclwd/article/details/81587970