Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Development Methodologies Yuan Wang(yw2326). Basic Concepts Browser/Server (B/S) Structure Keywords: Browser, Server Examples: Websites Client/Server.

Similar presentations


Presentation on theme: "Web Development Methodologies Yuan Wang(yw2326). Basic Concepts Browser/Server (B/S) Structure Keywords: Browser, Server Examples: Websites Client/Server."— Presentation transcript:

1 Web Development Methodologies Yuan Wang(yw2326)

2 Basic Concepts Browser/Server (B/S) Structure Keywords: Browser, Server Examples: Websites Client/Server (C/S) Structure Keywords: Client, Server Examples: MSN, Skype

3 Model-View-Controller(MVC) Basic Process of a B/S application: A user wants to look at a page using a browser. He sends a request to the server, then logical co des on the server begin to execute based on th e user ’ s request. They get some data from data base and do some logical execution, then return a dynamic page to the web browser so that the user can see it. Page: View Logical Codes: Controller Model: Database

4 Technologies in B/S development Technologies in View tier: HTML, Javascript(JS), CSS, etc. JS: A scripting language, using in the browser-sid e Libraries: Yahoo User Interface, EXT, Prototype, J Query CSS: DIV+CSS instead of Clear, Easier to change an interface apperance

5 Frameworks Why it appears CGI, JSP, ASP Mix 3 tiers together Simple, easy to learn Not easy to extend There are really a lot of frameworks, which one we need to choose?

6 Frameworks 1. ASP.NET using C# Not totally free 2. Struts in J2EE platform using Java Difficult, too many codes to write 3. Some other frameworks using PHP, Perl Not very powerful

7 Is there a language and a framework Free Easy Powerful Python Python on Django http://www.djangoproject.com/

8 Python on Django Model-Template-View(MTV) Template: describes how the data is presented Template: View in MVC View: describes which data is presented View: Controller in MVC URL matches one controller in Django Other MVC matches one view, such as.asp,.jsp

9 How to use it Django-admin.py in Python site-packages Using django-admin.py startproject newproject to create a directory for your application Settings.py and urls.py Settings: configuration file tell Django where you put your pages in Template _ Dirs = {./templates } Helloworld.html---print helloworld--page Urls: tell Django Server which controller each url matches

10 How to use it Create a controller file called Helloworld.py From django.shortcuts import render_to_response def index(request): return render_to_response(“helloworld.html”) Add it into urls.py: Urlpatterns= patterns(‘’, (r’^helloworld/’, ‘newproject.helloworld.index’), ) Then when you input http://localhost:8080/helloworld/ It will match function index in helloworld.py

11 Test on Django Start Django Server In the command line, C:\python25\newproject>manage.py runserver http://localhost:8080/helloworld/

12 Remember Multidisciplinary field

13 Thank You!


Download ppt "Web Development Methodologies Yuan Wang(yw2326). Basic Concepts Browser/Server (B/S) Structure Keywords: Browser, Server Examples: Websites Client/Server."

Similar presentations


Ads by Google