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