Eclipse web development based on Python and Django

Source: Internet
Author: User
First, copy the created testdemo project directory/in C:/python25/lib/Site-packages/Django/bin to your working directory, and then start eclipse, click "file"-> "new"-> "project ...", The following figure is displayed:

 

Select "pydev project" and click "Next"

 

Create a project with testdemo and direct the path to your native project directory. Select version 2.5 for grammar version, and select python25 for interpreter to cancel the src directory generated by the system, click "finish" to complete the creation. Right-click the project directory and select "refresh". You will be directed to the native file.

 

Now let's perform some tests to create a subset first.

 

Refresh the project directory.

 

 

Delete the useless models. py and tests. py files in the hello directory and write the following code to hello/views. py.

 

 

 

Edit URLs. py in the testdemo directory. The content is as follows:

 

From Django. conf. URLs. defaults import *

Urlpatterns = patterns ('',

(R' ^ $ ', 'testdemo. Hello. Views. Index '),

)

 

 

Save the file and run the service. If the service is successful, the effect is as follows:

 

 

 

 

From Django import HTTP

Def index (request ):

R = http. httpresponse ('

Return R

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.