Use Anaconda to create a virtual environment and build a Django project, anacondadjango
1. Create a virtual environment
1) Open the cmd command window
2) create a virtual environment conda create-n mydjango_env
3) view the virtual environment conda env list
* Indicates the current environment
4) activate the created virtual environment activate mydjango_env
2. Install Django
Is Django installed when the new environment is activated?
Conda install django
3. Create a project
1) enter the file directory of the project to be created
2) create a project django-admin startproject project name
At this time, the Django project has been created, and the project file is automatically generated under the DjangoWeb directory.
4. Set the runtime environment in PyCharm
Setting --> Project: Python --> Project Interpreter --> show all --> Add Local Python Interpreter
Find the new virtual environment in the installation directory of Anaconda and add it
5. Start the service
1) enter the project folder
2) Start the python manage. py runserver 8080 service.
Enter localhost: 8080 in the browser to access