. 2 3 4 5 6 >> django-admin.py startproject mysite /mysite __init__.py manage.py settings.py urls.py.

Slides:



Advertisements
Similar presentations
The Important Thing About By. The Important Thing About ******** The important thing about ***** is *****. It is true s/he can *****, *****, and *****.
Advertisements

Django The Web Framework for Perfectionists with Deadlines By: Udi h Bauman, BeeTV.
{ Django Deployment Tips, Tricks and Best Practices Erik LaBianca, WiserTogether, Inc.
Rapid Web Development with Python/Django Julian Hill.
건전지로 달리는 쟝고 세미나. 정재성 Django Web Framework CGI.
Presenter: James Huang Date: Sept. 29,  HTTP and WWW  Bottle Web Framework  Request Routing  Sending Static Files  Handling HTML  HTTP Errors.
(define (f x) (if (< x 0) (lambda (y) (- y x)) (lambda (y) (- x y)))) GE f: P1 para:x body:(if … )
Def f(n): if (n == 0): return else: print(“*”) return f(n-1) f(3)
Chapter 5: Objects and Classes class Point(Object): def __init__(x, y): self.x = initx self.y = inity def move(dx, dy): x += dx; y += dy; p = Point(10,
M. Grigorieva, M. Golosova.  Separates data access layer and visualization  Built around common key PanDA objects: jobs, resources, etc.  BigPanDAMon.
Django Deployment & Tips daybreaker. We have covered… ▶ Django Basics  Concept of MVC  Templates  Models  Admin Sites  Forms  Users (authentication)
Using GeoDjango for user participation in enriching web GIS systems Bo Zhao University of Florida July 15 th, 2009.
1 04/03/02 01:30 utc IR. 2 04/03/02 02:00 utc IR.
Web frameworks design comparison draft - please help me improve it.
Geographic Web Applications for Perfectionists with Deadlines
Web Development Methodologies Yuan Wang(yw2326). Basic Concepts Browser/Server (B/S) Structure Keywords: Browser, Server Examples: Websites Client/Server.
Web Frameworks: Django Department of Biomedical Informatics University of Pittsburgh School of Medicine
A pro-Django presentation: Brandon W. King SoCal Piggies - May 2007.
Django Web Framework 김형용, 이정민 Framework 2.1. Django High-level Python Web Framework Develop fast Automate the repetitive stuff Follow best practices.
Dj(T)ango with Python Ritika Virmani. What is Django? It’s not a Hawaiian dance Developed by Adrian Holovaty and Simon Willison Rapid Web Development.
UVa cs1120 David Evans Lecture 34: Djustifying Django.
건전지로 달리는 쟝고 세미나. 파트2 Last time MVC Views and URLconfs.
Googe App Engine Codelab Marzia Niccolai May 28-29, 2008.
Cloud computing lectures: Programming with Google App Engine Keke Chen.
SelfDiagnose “who is to blame” ernest micklei, April 2007.
Django 101 By: Jason Sumner. Django Overview Django was started in 2003, released under BSD in 2005, and the Django Software Foundation was established.
Functions. Built-in functions You’ve used several functions already >>> len("ATGGTCA")‏ 7 >>> abs(-6)‏ 6 >>> float("3.1415")‏ >>>
Google App Engine Data Store ae-10-datastore
CSE 154 LECTURE 5: INTRO TO PHP. URLs and web servers usually when you type a URL in your browser: your computer looks up the.
VENUE FINDER. This application provide up to date information of locations where particular music events are taking place on an specific date. The application.
App Engine Web App Framework Jim Eng
D JANGO Leo Wang Daniel South Philip Kim. Introduction Open Source web application framework Released in 2005 Python is used throughout Speed of development.
Caching Willem Visser RW334. Overview AppEngine Datastore No Caching Naïve Caching Caching invalidation Cache updating Memcached Beyond your code.
Introduction to Django #2Introduction to Django #2 SPARCS `08 서우석 (pipoket) `09 Summer SP ARCS Seminar`09 Summer SP ARCS Seminar.
Servers- Apache Tomcat Server Server-side scripts- Java Server Pages.
CS2021- Week 10 – Models and Views Web Development Model, Views, Controller Templates Databases.
LECTURE 14 Web Frameworks. WEB DEVELOPMENT CONTINUED Web frameworks are collections of packages or modules which allow developers to write web applications.
LECTURE 2 Python Basics. MODULES So, we just put together our first real Python program. Let’s say we store this program in a file called fib.py. We have.
The Django Web Application Framework zhixiong.hong
Machine Language Computer languages cannot be directly interpreted by the computer – they are not in binary. All commands need to be translated into binary.
Intro to Django Peter Krenesky OSU Open Source Lab slides:
Ratnadeep Debnath Testing your Django App.
Videolösungen © DResearch 2009 The web framework for perfectionists with deadlines Pony Logo credits: Bryan Veloso;
PyDoc Strings >>> def foo(a) :... "This the Foo function"... return str(a+1)... >>> help(foo) or from command line, pydoc module.foo.
Google App Engine An Example!. Schedule Today: AppEngine and Python Wednesday: Review and CES! Friday Quiz!!! Next week: – DEMO MADNESS!!! – Approx 20.
Hello Educational presentation.
Creating dynamic tools with Galaxy ProTo
Lecture 2 Python Basics.
Upnl 24th workshop kim jae chan
PyCon Taiwan 2013 Tutorial Justin Lin
MapServer In its most basic form, MapServer is a CGI program that sits inactive on your Web server. When a request is sent to MapServer, it uses.
Website URL
Polls and Voting Script - Php Poll Script - Polls and Voting Script
Django in the real world
Introduction to Django
Singleton Pattern Damian Gordon.
CSCE 590 Web Scraping – Scrapy II
National Central University, Taiwan
Python Modules.
Digital Signage Strategy
Lecture 21 More On Django.
Praktyczne wprowadzenie do WebSockets za pomocą Django-Channels
General Computer Science for Engineers CISC 106 Lecture 03
Query Interface using Django
Data Modelling Many to Many
Python Classes In Pune.
Model View Controller (MVC)
IoT System Development with Raspberry Pi and Django
CGT 215 Computer Graphics Programming I
Presentation transcript:

2

3

4

5

6 >> django-admin.py startproject mysite /mysite __init__.py manage.py settings.py urls.py

7 >> python manage.py syncdb >> python manage.py runserver «port number»

8

9

from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^polls/$', 'polls.views.index'), (r'^polls/(?P \d+)/$', 'polls.views.detail'), (r'^polls/(?P \d+)/results/$', 'polls.views.results'), (r'^polls/(?P \d+)/vote/$', 'polls.views.vote'), (r'^admin/', include(admin.site.urls)), ) 10

11 >> django-admin.py startapp myapp /myapp __init__.py models.py tests.py views.py

12

13

14

from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(max_length=200) votes = models.IntegerField() 15

16

17

18

19

20

21

22

def example_view: template = get_template(”mytemplate.html”) #1 data = Context({ ’foo’: ’hello’, ’bar’: ’world’ }) #2 output = template.render(data) #3 return HttpResponse(output) #4 23

24

25

26

27

28

30

31

32

33 Application: mysite

34 >> django-admin.py startapp myapp

from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(max_length=200) votes = models.IntegerField() from appengine_django.models import BaseModel from google.appengine.ext import db class Poll(BaseModel): question = db.StringProperty() pub_date = db.DateTimeProperty('date published') class Choice(BaseModel): poll = db.ReferenceProperty(Poll) choice = db.StringProperty() votes = db.IntegerProperty() 35

36

37 - url: /static static_dir: static

38 - url: /.* script: main.py

39 DATABASE_ENGINE = 'appengine' DEBUG = True INSTALLED_APPS = ['appengine_django'] MIDDLEWARE_CLASSES = () ROOT_URLCONF = 'urls' ### SETTINGS_MODULE = 'mysite.settings' ### SITE_ID = 1 ### TEMPLATE_DEBUG = True TIME_ZONE = 'UTC'

40

41

 42