Django:django Installation

Source: Internet
Author: User
Tags windows download django website install django

One, Python installation (Windows)1. Considering that Django does not yet support the large number of non-backward compatibility changes introduced by Python3.0, This tutorial recommends selecting Python2.6;2. Visit the official website of https://www.python.org/downloads/and download the corresponding version of Python for installation;3. Add patch installation path to the environment variable path;4. Verify the installation is successful; Second, Django installation1. Install Django using source code;Clone the Django source code using the command git clone git://github.com/django/django.git; go to the source directory git tags to view the corresponding version of the tag, and use the git checkout tag-name command to switch to the version you want to install (this tutorial uses the 1.1 version explained); execute the command python setup.py install; Verify that Django is installed successfully using the above authentication method; Third, Python interactive interpreter1.Python Interactive Interpreter is a command-line window program, through which you can interactively write Python programs;2. Three greater than sign (>>>) to distinguish the sample, identify the interactive prompt, multi-line declaration with three points (... ) to fill;
Iv. Installation Database (PostgreSQL database)1. Under the official website (http://www.enterprisedb.com/products-services-training/pgdownload#windows), now the Windows download the installation package and click Install directly; v. Start a project1. Before creating the project, check that your%django_patch%/scripts is set in PATCH;2. Use the command django‐admin.py startproject MySite to create the first Django project;3. Look under the project folder you just created, with 4 files:_init_.py: Let Python treat the directory as a required file for a development package (that is, a set of modules). This is an empty file and you do not need to modify it. manage.py: A command-line tool that allows you to interact with the Django project in a number of ways. Type Python manage.py help to see what it can do;setting.py: Setup or configuration of the Django project;The URL configuration of the Urls.py:Django project can be viewed as the directory of your Django website; Vi. running the development server1.Django Development services are available during development, a built-in, lightweight web service;2. Provide this server in order to quickly develop the site, the product-level Web server (such as Apache) should not be configured before the product is ready for release;3. The development server detects your code and automatically loads it without restarting the service;4. Go to your project directory and run the command:python manage.py runserver start service; 5. In the browser, enter http://127.0.0.1:8000 access;      6. Other IP and port settings commands such as: Python manage.py runserver 0.0.0.0:8000

Django:django Installation

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.