Django Environment setup in Windows environment
The premise is that the Windows machine already has the Python and MySQL installed
First we download these files: Python-mysql, Django
Mysql-python is an executable file that is installed directly.
1. Installing Django
Now we need to install Django. Unzip the downloaded package to any directory:
Django extracts to any directory
Open a command prompt (cmd) and go to the directory. and type the command as shown:
Python setup.py Install
After the carriage return executes, you will see the process of Django being installed. You can delete the extracted directory when you are finished.
2. Set the DJANGO environment variable:
So we can put Django in place.
Test
A good environment and nothing to do is actually not much of a sense of accomplishment. Let's get a sense of accomplishment, create a new project with Django and run:
First we open cmd, locate the directory that you want to create a new project, any directory can be. Then type the following command:
django-admin.py Startproject Hello
Where Hello is the name of the new project directory, Django created a new project for us after the execution. The Hello folder contains the Django framework-related files and the default configuration file. We don't care about the details first.
Next we will locate the cmd path to the Hello directory. and execute the following command:
Python manage.py runserver
The Django server opens successfully
Open the browser, visit: http://127.0.0.1:8000/. Just try it and see what's going to happen.
It is important to note that this server is a lightweight server that is built into Django and is not used in a product environment.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service