23.03.2017 Views

wilamowski-b-m-irwin-j-d-industrial-communication-systems-2011

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Interactive Web Site Design Using Python Script 63-3<br />

FIGURE 63.3<br />

The process of creating a project.<br />

execute the command django-admin.py startproject paper _ system. Four files will be automatically<br />

generated and they are: manage.py, settings.py, urls.py, and __ init __ .py, each of<br />

which has specified functions:<br />

• manage.py: This is a command line that can help to interact with the Django project in various ways<br />

in format: manage.py [options]. For example, manage.py runserver<br />

is used to start running the server.<br />

• settings.py: This file is used to set/configure the Django project information, such as user<br />

name, password, and locations of the template resources.<br />

• urls.py: The URL declarations of the Django project.<br />

• __ init __ .py: An empty file specifying that the current directory should be considered as a<br />

Python package.<br />

63.3.2 run the Project<br />

The work above can be verified by running the project: (1) cd to the directory of the project and (2) run<br />

command manage.py runserver. If the project is successfully created, the result is shown as in<br />

Figure 63.4.<br />

Now the server is running and it can be locally visited by http://localhost:8000/ with the browser.<br />

Figure 63.5 shows the Web site information.<br />

The link address and port can be modified using commands such as manage.py runserver<br />

131.204.222.54:80.<br />

FIGURE 63.4<br />

Result of running the project.<br />

© <strong>2011</strong> by Taylor and Francis Group, LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!