23.03.2017 Views

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

63<br />

Interactive Web<br />

Site Design Using<br />

Python Script<br />

Hao Yu<br />

Auburn University<br />

Michael Carroll<br />

Auburn University<br />

63.1 Introduction.....................................................................................63-1<br />

Python. •. Django<br />

63.2 Software Installation.......................................................................63-2<br />

63.3 Database-Driven Web Site Design................................................63-2<br />

Create a Project. •. Run the Project. •. Setup Database. •. .<br />

Create Model. •. Activate Model. •. Activate the Admin Site. •. .<br />

Add the Application. •. Customize the Admin Site<br />

63.4 Conclusion........................................................................................63-7<br />

References....................................................................................................63-8<br />

63.1 Introduction<br />

With the development of Internet technology, more and more Web design languages such as Javascript,<br />

PHP, and CGI are developed to satisfy various online services. In this chapter, an open-source Web<br />

application framework, Django, which is developed in Python, will be introduced for database-driven<br />

Web site design.<br />

63.1.1 Python<br />

Python supports multiple programming paradigms, such as object oriented, imperative, and functional<br />

[F02]. Python features a fully dynamic-type system and automatic memory management. From the<br />

point of functions, python has very similar syntax to Perl, but it is simplified and more readable. Python<br />

is also flexible for programming, including both command line style, such as in MATAB • , and script<br />

style, such as in Perl.<br />

As a high-level language, Python can be operated on many different operating <strong>systems</strong>, such as<br />

Windows, MacOS, Unix, and OS/2. The Python software can be freely downloaded and used, or can<br />

be included in applications. Python can also be freely modified and redistributed, since the language is<br />

copyrighted under an open-source license.<br />

63.1.2 Django<br />

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic<br />

design [HM09]. It was originally developed to ease the creation of complex database-driven Web<br />

sites in 2005. Using Python as a script language, Django focuses on automation as much as possible.<br />

63-1<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!