[Django Learning 0-1] Django + Eclipse Basic Environment

Source: Internet
Author: User
Tags install django

1. Installing Django

If you do not have Python installed, you need to install python,django1.6 for 2.6,2.7,3.2 or 3.3, which is python2.7.8

Then install Django, the release version has been updated to 1.6.6, download in https://www.djangoproject.com/(if the old version is installed, you need to delete the old version first)

Installation method win, first unpack the Django package, and then run the Python setup.py install wait for the installation is ready (you need to set the Python environment variable, setup.py in the directory after Django decompression, you can go to this directory and then install or give setup.py the available path. PS: can also be installed quickly with PIP or Eazy_install)

Some of the other non-absolutely necessary: database-Related: MySQL + mysql-python. Development environment Eclipse + Pydev

2. Create the Project

Create a project you can enter Python manage.py startproject on the command line Port Project_Name

Create an app to enter Python manage.py startapp on the command line Port app_name

Run Test server can enter Python manage.py runserver port on command line ports

These methods can be easily executed under eclipse. Pydev comes with the creation of a Django project. Adding apps can also be done by right-clicking on the project name and in the Django options, which is a lot easier.

3. Django Basic files and configuration

After the project is created, manage.py, nichijou/__init__.py, nichijou/settings.py, nichijou/urls.py, and nichijou/wsgi.py are automatically generated. Nichijou is a project name I built.

Settings.py is the Django configuration information

MySQL Database configuration:

The variables in settings.py are configured in the database as:

    

1 DATABASE = {2     ' default ' = {3         ' ENGINE ': ' Django.db.backends.mysql ', 4         ' NAME ': ' Nichijou ', 5         ' USER ': ' meamin9** ', 6     ' PASSWORD ': ' ******* ' }10}     

Name is the database name. It's almost like this today.

  

  

[Django Learning 0-1] Django + Eclipse Basic Environment

Related Article

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.