web frameworks design comparison draft - please help me improve it focus on Model-View-Controller frameworks

Size: px
Start display at page:

Download "web frameworks design comparison draft - please help me improve it focus on Model-View-Controller frameworks"

Transcription

1 web frameworks design comparison draft - please help me improve it focus on Model-View-Controller frameworks

2 Controllers In Rails class MyTestController < ApplicationController def index render_text Hello World end end The name of the class has to match the name of the controller file.

3 Controllers In Django from django.http import HttpResponse def index(request): return HttpResponse("Hello World ) Django is explicit, you need to import all functions you use.

4 Controllers In Cherrypy and TurboGears 1.0 import cherrypy class def index(self): return "Hello World" Cherrypy, Turbogears, and Pylons are also explicit. You need to import all functions you want to use.

5 Controllers In web2py def index(): return "Hello World" web2py is similar to Rails. It imports for you all the web2py keyword. Often, like in this case, you do not need any.

6 Get/Post requests In Rails class MyTestController < ApplicationController def index render_text Hello +params[:who] end end GET and POST variables are passed via params but other request parameters (client ip for example) are passed via a different mechanism.

7 Get/Post requests In Django from django.http import HttpResponse def index(request): return HttpResponse("Hello World %s % \ request.request[ who ]) Nice, simple. The request contains all the info. You can use.get or.post instead of.request to be more specific.

8 Get/Post requests In Cherrypy and TurboGears 1.0 import cherrypy class def index(self,who): return "Hello %s" % who GET and POST variables are passed via arguments of the action, but other request parameters (client ip for example) are passed via a different mechanism.

9 Get/Post requests In web2py def index(): return "Hello %s" % request.vars.who Similar to Django. All request data is in one place. You can use.get_vars and.post_vars instead of.vars to be more specific.

10 Dispatching In Rails URL gets mapped into class MyTestController < ApplicationController def index render_text Hello World end end By default Rails does not allow running multiple apps without running multiple copies of Rails, since the name of the app is not in the URL, only the controller name (MyTest) and the action name (index) appear. This can be changed by configuring routes.

11 Dispatching In Django you need to edit url.py to map URLs into actions from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^index$', myapp.mycontroller.index), ) This is the equivalent of Rails routes and it requires using regular expressions. There is no default. You need one entry in url.py for every action.

12 Dispatching In Cherrypy and TurboGears 1.0 import cherrypy class def index(self,who): return "Hello %s" % who Works very much like Rails and default mapping between URL and action can be overwritten.

13 Dispatching In web2py a URL like calls def index(): return "Hello %s" % request.vars.who Similar to Rails and Charrypy but, by default the URL requires that you specify the name of the app. This allows web2py to run multiple apps without using routes. Web2py has its own version of routes that supports two different syntaxes (with and without regular expression) to overwrite the mapping and reverse mapping as well.

14 Calling Views In Rails class MyTestController < ApplicationController def Hello World end end It calls the default view (MyTest/index) which renders the page. The variables marked are global vars and are passed to the view. Notice that if the view is not defined, this results in an error message.

15 Calling Views In Django from django.shortcuts import render_to_response def index(request): return render_to_response("index.html, { message : Hello World }) This is the short way of doing it in Django. You have to specify the view name index.html since there is no default. Parameters are passed via a dictionary. You get an error message if the view is not defined. Notice that in Django a view is called a template and a controller is called a view.

16 Calling Views In TurboGears 1.0 with Cherrypy import turbogears from turbogears import controllers, expose class def index(self): return dict(message= Hello World ) The view is specified in the expose decorator.

17 Calling Views In web2py def index(): return dict(message= Hello World ) The last line works like Cherrypy but by default it looks for a view called mycontroller/index.html in myapp. If this view does not exist it uses a generic view to show all variables returned in the dictionary. The default can be overwritten with response.view= filename.html

18 Views In Rails <table> do recipe %> <tr> <td><%= recipe.name %></td> </tr> <% end %> </table> It allows full Ruby in views but: - it does not escape strings by default (unsafe) - <% %> requires a special editor since < > are special in HTML

19 Views In Django <table> {% for recipe in recipes %} <tr> <td>{{recipe.name}}</td> </tr> {% endfor %} </table> The choice of {% %} and {{ }} tags is good because any HTML editor can deal with them. The code looks like Python code but it is not (notice the endfor which is not a python keyword. This limits what you can do in views.

20 Views Kid or Genshi in TurboGears 1.0 or Cherrypy <html xmlns=" xmlns:py=" <table> <tr py:for="recipe in recipes" > <td py:content= recipe.name > </td> </tr> </table> This allows full Python quotes py:for=... but it can only be used to generate HTML/XML views, not dynamical JavaScript for example.

21 Views In web2py <table> {{for recipe in recipes:}}> <tr> <td>{{=recipe.name}}</td> </tr> {{pass}} </table> Similar to Django but full Python in the code (notice pass is a Python keyword) without indentation requirements (web2py indents the code for you at runtime). Only one type of escape sequence {{ }} which is transparent to all HTML editors. All string are escaped (unless otherwise specified, like in Django and Kid). It can be used to generate JavaScript (like Django and Rails).

22 Escaping in Views In Rails <%%= message> The double %% indicate the text has to be escaped. This is off by default, hence unsafe. Should be the opposite.

23 Escaping in Views In Django {% filter safe %} {{ message }} {% endfilter %} Since Django 1.0 all text is escaped by default. You mark it as safe if you do not want it to be escaped.

24 Escaping in Views Kid or Genshi in TurboGears 1.0 or Cherrypy <div py:content= XML(recipe.name) ></div> Text is escaped by default. If text should not be escaped it has to be marked with XML

25 Escaping in Views In web2py {{=XML(recipe.name,sanitize=False)}} Text is escaped by default. If text should not be escaped it has to be marked with XML. The optional sanitize option perform XML sanitization by selective escaping some tags and not others. Which tags have to be escaped and which tag attributes can be specified via arguments of XML.

26 Views Hierarchy In Rails <title>layout Example</title> <body> <%= yield %> </body> </html> and in controller: render :layout= filename.html.erb The rendered page is inserted in the <%= yield %> tag in the layout. One can include other views with <%= render... %> Notice that also :layout follow a naming convention and there is a default.

27 Views Hierarchy In Django <title>layout Example</title> </head> <body> {% block main %} {% endblock %} </body> </html> and in view: {%block main%}body{%endblock%} Views can be extended and included using blocks that have names.

28 Views Hierarchy Kid or Genshi in TurboGears 1.0 or Cherrypy <html xmlns=" xmlns:py=" py:extends="'master.kid'">...

29 Views Hierarchy In web2py <title>layout Example</title> <body> {{include}} </body> </html> and in view: {{extend layout.html }} body Notation similar to Rails but called like in Kid. The body replaces {{include}} in the layout. layouts can extend other layouts. Views can include other views.

30 Forms In Rails <%= form_tag :action => "update" dp %> Name: <%= text_field "item", "name" %><br /> Value: <%= text_field "item", "value" %><br /> <%= submit_tag %> <%= end %> Rails has helpers to create forms but that s it. As far as I know there is no standard mechanism to automatically create forms from models (database tables). Perhaps there are Rails add-on to do this. There is a mechanism to validate submitted forms.

31 Forms In Django # in model class ArticleForm(ModelForm): class Meta: model = Article # in controller def contact(request): if request.method == 'POST': form = ContactForm(request.POST) if form.is_valid(): return HttpResponseRedirect('/thanks/') else: form = ContactForm() # An unbound form return render_to_response('contact.html', { 'form': form,}) In Django, you can create a Form (ArticleForm) from a model (Article). The Form knows how to serialize itself and validate the input on selfsubmission, but the errors are not automatically inserted in the form.

32 Forms Kid or Genshi in TurboGears 1.0 or Cherrypy? I believe you need to use a library like ToscaWidgets. Sorry, I am not familiar with them. If you know how to fill this page please let me know.

33 Forms In web2py def contact(request): form = SQLFORM(Article) if form.accepts(request.vars): redirect('thanks') return dict(form=form) This is the same as the previous Django form (generated from the Article) model, except that when the form is serialized, if there are errors, they are displayed in the form itself (unless specified otherwise). Web2py forms can also prevent double submission.

34 Validation In Rails ActiveForm::Definition::create :article do f f.section :details do s s.text_element : ,:class => 'required' do e e.validates_as_ msg => 'not ' end end Rails defines validators like requires, , etc. You can associate validators to a form. In your controllers you need to check if a form is valid, and, on error, alter the page to include the errors generated by validation.

35 Validation In Django from django.core.validators import * class Article(models.Model): = models. field( validator_list=[isvalid ]) Very much like Rails but more validators. Validators are specified in models and/or forms.

36 Validation In web2py db.define_table( Article,SQLField( )) db.article. .requires=is_ () Similar to Django and Rails because validators are attached to table fields and form fields but validators are classes not objects. This means they must be instantiated with (). You can pass arguments to the validators to change their behavior (for example the error message). The presence of validators affects the way a field is rendered in a form. For example IS_IN_SET() renders the field with a dropbox.

37 Models and Migrations In Rails class Article < ActiveRecord::Migration def self.up create_table :articles do t t.column :name, :string t.column :description, :text end end end In Rails there is a place to define tables that need to be created/deleted/ altered (migrations) and a different place to establish relations between tables (one to many, many to many, etc)

38 Models and Migrations In Django class Article(models.Model): name = models.stringfield() description = models.textfield() In Django there is one place where models are defined. If the tables do not exist they are created. Django does not do migrations (i.e. it does not alter or drop tables if the models change). For many to many relations, it creates the intermediate link table for you.

39 Models and Migrations In SQLAlchemy (used in TG and Pylons) from turbogears.database import metadata, mapper sqlalchemy import Table, Column, Integer mytable = Table('mytable', metadata, Column('id', Integer, primary_key=true)) class MyTable(object): pass mapper(mytable, mytable) SQLAlchemy makes a distinction between what tables are in the database and how they are mapped into Python objects. This is because SQLAchemy can deal with legacy databases. Rails, Django and web2py can but with limitations (in the case of web2py for example, tables must have an integer auto-increment key field called id ).

40 Models and Migrations In web2py Article=db.define_table( Article, SQLField( , string ), SQLField( description, text ) The syntax is a little different but the functionality is similar to Rails. If the the table in the model above does not exist it is created. If the model changes, web2py alters the table accordingly. One to many ad many to many relations are implied by reference fields.

41 Select Query In Rails Article.find(:first,:conditions => [ "id > :id AND name = :name", {:id => 3, :name => "test" }]) This is the most common notation for a select. The conditions argument is basically a SQL statement but the parameters are passed as additional arguments.

42 Select Query In Django Article.objects.filter(id gt=3,name= test ) id gt=3 reads id greater than 3. Django queries are lazy-evaluated.

43 Select Query In SQLAlchemy (used in TG and Pylons) query(article).filter_by(id>3, name= test )

44 Select Query In web2py db(article.id>3 and Article.name== test ).select() In web2py you always need to specify which db you are acting on because you can have multiple db connections in the same code.

45 Transcations In Rails class MyTestController < ApplicationController def index Record.transaction do... end end end

46 Transactions In Django from django.http import HttpResponse from django.db import def index(request):... return HttpResponse("Hello World ) There are multiple decorators: autocommit (commits always), commit_on_success (commit only if not Exception), commit_manually (requires calling) transaction.commit() or transaction.rollback()

47 Transactions In TurboGears import turbogears from turbogears import controllers, expose class def index(self):... return dict(message= Hello World ) By default all actions are enclosed in a transaction that commits on success and rollsback on exception.

48 Transactions In web2py def index()... return dict(message= Hello World ) By default all actions are enclosed in a transaction that commits on success and rollsback on exception.

49 Internationalization In Rails Rails currently doesn t offer any explicit support for internationalization. Perhaps it should, perhaps it s too app specific to generalize. Thinks will change in Rails 2.2 but here we talk about present, not future.

50 Internationalization In Django from django.http import HttpResponse from django.utils.translation import ugettext as _ def my_view(request): message = _("Hello World") return HttpResponse(message) Using _ is the common convention. Requires a few shell commands to build and edit the dictionaries.

51 Internationalization In TurboGears import turbogears from turbogears import controllers, expose class def index(self): message=_( Hello World ) return dict(message=message) As in the case of Django, this requires some shell commands to build and edit the dictionaries.

52 Internationalization In web2py def index() message=t( Hello World ) return dict(message=message) T is the web2py command to mark strings for translations and it differs from the others because it is not based on i18n. Dictionaries can be created and edited via the web based admin interface of web2py.

53 Helpers In Rails <%= link_to "Profile", :controller => "profiles", :action => "show", :id %> # => <a href="/profiles/show/1">profile</a>

54 Helpers In Django <a href="{%url appname.views.show_profile profile%}">profile</a> Django does not have helpers like in Rails but you can find some here:

55 Helpers In web2py {{=A( Profile,_href=URL( myapp, profile, show, args=[profile]))}} web2py has helpers but they are very different than in Rails. They are objects not functions, have the same names as the corresponding HTML tags, and can be nested as in: DIV(H1( hello,span( world ),_class= logo )) They are automatically serialized in views. _ marks tag attributes.

The Django Web Framework Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013

The Django Web Framework Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013 The Django Web Framework Part II Hamid Zarrabi-Zadeh Web Programming Fall 2013 2 Outline Overview Making the Front Page Creating the Template Creating View Functions Configuring URL Patterns Finishing

More information

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright. TurboGears

About the Tutorial. Audience. Prerequisites. Disclaimer & Copyright. TurboGears About the Tutorial TurboGears is a Python web application framework, which consists of many modules. It is designed around the MVC architecture that are similar to Ruby on Rails or Struts. TurboGears are

More information

Course Title: Python + Django for Web Application

Course Title: Python + Django for Web Application Course Title: Python + Django for Web Application Duration: 6 days Introduction This course offer Python + Django framework ( MTV ) training with hands on session using Eclipse+Pydev Environment. Python

More information

Django: Views, Templates, and Sessions

Django: Views, Templates, and Sessions Django: Views, Templates, and Sessions CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene Agichtein and the Internets) CS 370, Günay (Emory) Django Views/Templates Spring 2014 1 / 7 Agenda

More information

Webdev: Building Django Apps. Ryan Fox Andrew Glassman MKE Python

Webdev: Building Django Apps. Ryan Fox Andrew Glassman MKE Python Webdev: Building Django Apps Ryan Fox Andrew Glassman MKE Python What Django is Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced

More information

CSC 405 Computer Security. Web Security

CSC 405 Computer Security. Web Security CSC 405 Computer Security Web Security Alexandros Kapravelos akaprav@ncsu.edu (Derived from slides by Giovanni Vigna and Adam Doupe) 1 The XMLHttpRequest Object Microsoft developers working on Outlook

More information

Rapid Development with Django and App Engine. Guido van Rossum May 28, 2008

Rapid Development with Django and App Engine. Guido van Rossum May 28, 2008 Rapid Development with Django and App Engine Guido van Rossum May 28, 2008 Talk Overview This is not a plug for Python, Django or Google App Engine Except implicitly :) Best practices for using Django

More information

widgets, events, layout loosely similar to Swing test browser, or plugin for testing with real browser on local system

widgets, events, layout loosely similar to Swing test browser, or plugin for testing with real browser on local system Web [Application] Frameworks conventional approach to building a web service write ad hoc client code in HTML, CSS, Javascript,... by hand write ad hoc server code in [whatever] by hand write ad hoc access

More information

Django Part II SPARCS 11 undead. Greatly Inspired by SPARCS 10 hodduc

Django Part II SPARCS 11 undead. Greatly Inspired by SPARCS 10 hodduc Django Part II 2015-05-27 SPARCS 11 undead Greatly Inspired by SPARCS 10 hodduc Previously on Django Seminar Structure of Web Environment HTTP Requests and HTTP Responses Structure of a Django Project

More information

HOW TO FLASK. And a very short intro to web development and databases

HOW TO FLASK. And a very short intro to web development and databases HOW TO FLASK And a very short intro to web development and databases FLASK Flask is a web application framework written in Python. Created by an international Python community called Pocco. Based on 2

More information

7401ICT eservice Technology. (Some of) the actual examination questions will be more precise than these.

7401ICT eservice Technology. (Some of) the actual examination questions will be more precise than these. SAMPLE EXAMINATION QUESTIONS (Some of) the actual examination questions will be more precise than these. Basic terms and concepts Define, compare and discuss the following terms and concepts: a. HTML,

More information

Accelerating Information Technology Innovation

Accelerating Information Technology Innovation Accelerating Information Technology Innovation http://aiti.mit.edu/program/philippines-summer-2012/ Philippines Summer 2012 Lecture 4 Django Views and Templates June 28, 2012 Agenda Django Views Django

More information

Building a Rails Application

Building a Rails Application Building a Rails Application Let s get started! Use MySQL to create a depot_development database Create a new Ruby on Rails project called depot Make sure root password is included in Configuration/database.yml

More information

Without Django. applying django principles to non django projects

Without Django. applying django principles to non django projects Without Django applying django principles to non django projects I Love Django Using Django since the very first release I love the templates (so much that I rewrote the templating engine twice) Often

More information

MIT AITI Python Software Development Lab DJ1:

MIT AITI Python Software Development Lab DJ1: MIT AITI Python Software Development Lab DJ1: This lab will help you get Django installed and write your first application. 1 Each person in your group must complete this lab and have it checked off. Make

More information

generates scaffolding/framework for models, views

generates scaffolding/framework for models, views Django by Adrian Holovaty and Jacob Kaplan-Moss (released July 2005) a collection of Python scripts to create a new project / site generates Python scripts for settings, etc. configuration info stored

More information

Ruby on Rails. Brian McCallister Ning, Inc. Philadelphia Emerging Technology Conference 06

Ruby on Rails. Brian McCallister Ning, Inc. Philadelphia Emerging Technology Conference 06 Ruby on Rails Brian McCallister Ning, Inc. Philadelphia Emerging Technology Conference 06 Smalltalk Robert Tinney www.tinney.net + Lisp Conrad Barski www.lisperati.com + Perl O Reilly www.perl.com Without

More information

Quick housekeeping Last Two Homeworks Extra Credit for demoing project prototypes Reminder about Project Deadlines/specifics Class on April 12th Resul

Quick housekeeping Last Two Homeworks Extra Credit for demoing project prototypes Reminder about Project Deadlines/specifics Class on April 12th Resul CIS192 Python Programming Web Frameworks and Web APIs Harry Smith University of Pennsylvania March 29, 2016 Harry Smith (University of Pennsylvania) CIS 192 March 29, 2016 1 / 25 Quick housekeeping Last

More information

Courslets, a golf improvement web service. Peter Battaglia

Courslets, a golf improvement web service. Peter Battaglia Courslets, a golf improvement web service Peter Battaglia Discussion Project Overview Design and Technologies Utilized Rails and REST URLs, URLs, URLs Rails and Web Services What s s exposed as a service?

More information

CDM.DEPAUL.EDU MASSIMO DI PIERRO

CDM.DEPAUL.EDU MASSIMO DI PIERRO CDM.DEPAUL.EDU 90 full time faculty 300 courses/quarter 1858 graduate students in 20 programs (CS, IS,...) 1763 undergraduate students in 16 programs DHS and NSA center of excellence MASSIMO DI PIERRO

More information

Strategies for Rapid Web Prototyping. Ruby on Rails. Clemens H. Cap

Strategies for Rapid Web Prototyping. Ruby on Rails. Clemens H. Cap Strategies for Rapid Web Prototyping Ruby on Rails Strategies for Rapid Web Prototyping DRY: Don't repeat yourself Convention over Configuration Separation of Concern Templating MVC: Model View Controler

More information

Implementing a Numerical Data Access Service

Implementing a Numerical Data Access Service Implementing a Numerical Data Access Service Andrew Cooke October 2008 Abstract This paper describes the implementation of a J2EE Web Server that presents numerical data, stored in a database, in various

More information

Quoting Wikipedia, software

Quoting Wikipedia, software Developers How To Django When Python Bites the Web WWW.WWW.WWW. Here s how to start using Django for Web application development. Quoting Wikipedia, software frameworks aim to facilitate software development

More information

django-xross Documentation

django-xross Documentation django-xross Documentation Release 0.6.0 Igor idle sign Starikov Jan 14, 2018 Contents 1 Description 3 2 Requirements 5 3 Table of Contents 7 3.1 Quickstart................................................

More information

Are you using Ruby on Rails?

Are you using Ruby on Rails? Are you using Ruby on Rails? Should you? Come have a seat, and we ll figure it out Learn how to create happy programmers, and 10 real world benefits to using Rails Talk begins at 5 PM Warning Warning I

More information

web.py Tutorial Tom Kelliher, CS 317 This tutorial is the tutorial from the web.py web site, with a few revisions for our local environment.

web.py Tutorial Tom Kelliher, CS 317 This tutorial is the tutorial from the web.py web site, with a few revisions for our local environment. web.py Tutorial Tom Kelliher, CS 317 1 Acknowledgment This tutorial is the tutorial from the web.py web site, with a few revisions for our local environment. 2 Starting So you know Python and want to make

More information

Transactions for web developers

Transactions for web developers Transactions for web developers Aymeric Augustin - @aymericaugustin DjangoCon Europe - May 17th, 2013 1 Transaction management tools are often made to seem like a black art. Christophe Pettus (2011) Life

More information

Accelerating Information Technology Innovation

Accelerating Information Technology Innovation Accelerating Information Technology Innovation http://aiti.mit.edu Ghana Summer 2012 Lecture DJ04 Django Views Simple Diagram HTTP Request Browser urls.py HTTP Request Model/Database Data Request Data

More information

Linguistic Architecture

Linguistic Architecture Linguistic Architecture Modeling Software Knowledge SoftLang Team, University of Koblenz-Landau Prof. Dr. Ralf Lämmel Msc. Johannes Härtel Msc. Marcel Heinz Outline Motivating Software Documentation Classic

More information

Rails: Views and Controllers

Rails: Views and Controllers Rails: Views and Controllers Computer Science and Engineering College of Engineering The Ohio State University Lecture 18 Recall: Rails Architecture Wiring Views and Controllers A controller is just an

More information

Lecture 4. Ruby on Rails 1 / 49

Lecture 4. Ruby on Rails 1 / 49 Lecture 4 Ruby on Rails 1 / 49 Client-Server Model 2 / 49 What is it? A client (e.g. web browser, phone, computer, etc.) sends a request to a server Request is an HTTP request Stands for HyperText Transfer

More information

Bricks Documentation. Release 1.0. Germano Guerrini

Bricks Documentation. Release 1.0. Germano Guerrini Bricks Documentation Release 1.0 Germano Guerrini January 27, 2015 Contents 1 Requirements 3 2 Contents 5 2.1 Getting Started.............................................. 5 2.2 Basic Usage...............................................

More information

welcome to BOILERCAMP HOW TO WEB DEV

welcome to BOILERCAMP HOW TO WEB DEV welcome to BOILERCAMP HOW TO WEB DEV Introduction / Project Overview The Plan Personal Website/Blog Schedule Introduction / Project Overview HTML / CSS Client-side JavaScript Lunch Node.js / Express.js

More information

Building Web Applications

Building Web Applications Building Web Applications Ambient intelligence Fulvio Corno Politecnico di Torino, 2017/2018 Goal Create simple web applications In Python For interactive interfaces For server-side components Learn a

More information

Functional Programming & Web Frameworks

Functional Programming & Web Frameworks Functional Programming & Web Frameworks Independent Study Report Justin Cady February 22, 2011 This report summarizes an independent study on web frameworks by Justin Cady, advised by Professor Matthew

More information

Ruby on Rails. Rails Released 1.0 Yesterday! Brian McCallister. ApacheCon US 2005

Ruby on Rails. Rails Released 1.0 Yesterday! Brian McCallister. ApacheCon US 2005 Ruby on Rails Rails Released 1.0 Yesterday! Brian McCallister ApacheCon US 2005 Smalltalk Robert Tinney www.tinney.net + Lisp Conrad Barski www.lisperati.com + Perl O Reilly www.perl.com Without the...

More information

CIS192 Python Programming

CIS192 Python Programming CIS192 Python Programming Web Servers and Web APIs Raymond Yin University of Pennsylvania November 12, 2015 Raymond Yin (University of Pennsylvania) CIS 192 November 12, 2015 1 / 23 Outline 1 Web Servers

More information

CSE 115. Introduction to Computer Science I

CSE 115. Introduction to Computer Science I CSE 115 Introduction to Computer Science I Road map Review Limitations of front-end sites Web servers Examples Review

More information

정재성

정재성 건전지로달리는 쟝고세미나 정재성 Django Web Framework CGI #!/usr/bin/env python import MySQLdb print "Content-Type: text/html\n" print "books" print "" print "books" print

More information

Graphene Documentation

Graphene Documentation Graphene Documentation Release 1.0.dev Syrus Akbary Nov 09, 2017 Contents 1 Introduction tutorial - Graphene and Django 3 1.1 Set up the Django project........................................ 3 1.2 Hello

More information

Flask-Genshi Documentation

Flask-Genshi Documentation Flask-Genshi Documentation Release 0.1 Dag Odenhall September 14, 2011 CONTENTS i ii Flask-Genshi Documentation, Release 0.1 Flask-Genshi is an extension to Flask that allows you to easily use Genshi

More information

Ruby on Rails. SITC Workshop Series American University of Nigeria FALL 2017

Ruby on Rails. SITC Workshop Series American University of Nigeria FALL 2017 Ruby on Rails SITC Workshop Series American University of Nigeria FALL 2017 1 Evolution of Web Web 1.x Web 1.0: user interaction == server roundtrip Other than filling out form fields Every user interaction

More information

CE419 Web Programming. Session 15: Django Web Framework

CE419 Web Programming. Session 15: Django Web Framework CE419 Web Programming Session 15: Django Web Framework Web Applications & Databases In modern Web applications, the arbitrary logic often involves interacting with a database. Behind the scenes, a database-driven

More information

Django. Jinja2. Aymeric Augustin DjangoCong 2016

Django. Jinja2. Aymeric Augustin DjangoCong 2016 Django Jinja2 Aymeric Augustin DjangoCong 2016 Jardin des Plantes, Avranches, 9 avril 2016 I m Aymeric Amalfi Core Developer since 2011 Chief Technical Officer since 2015 Time zones Python 3 Transactions

More information

Django urls Django Girls Tutorial

Django urls Django Girls Tutorial Django urls Django Girls Tutorial about:reader?url=https://tutorial.djangogirls.org/en/django_urls/ 1 di 6 13/11/2017, 20:01 tutorial.djangogirls.org Django urls Django Girls Tutorial DjangoGirls 6-8 minuti

More information

Web Security: Vulnerabilities & Attacks

Web Security: Vulnerabilities & Attacks Computer Security Course. Song Dawn Web Security: Vulnerabilities & Attacks Cross-site Scripting What is Cross-site Scripting (XSS)? Vulnerability in web application that enables attackers to inject client-side

More information

South Africa Templates.

South Africa Templates. South Africa 2013 Lecture 15: Django Database Intro + Templates http://aiti.mit.edu Database Interaction Managers Manager is a class It's the interface between the database and django Various methods,

More information

Technology modeling. Ralf Lämmel Software Languages Team University of Koblenz-Landau

Technology modeling. Ralf Lämmel Software Languages Team University of Koblenz-Landau Technology modeling Ralf Lämmel Software Languages Team University of Koblenz-Landau Technologies are at the heart of software development. Let s model them for understanding. 1 Different kinds of software

More information

L6 Application Programming. Thibault Sellam Fall 2018

L6 Application Programming. Thibault Sellam Fall 2018 L6 Application Programming Thibault Sellam Fall 2018 Topics Interfacing with applications Database APIs (DBAPIS) Cursors SQL!= Programming Language Not a general purpose programming language Tailored for

More information

LECTURE 14. Web Frameworks

LECTURE 14. Web Frameworks LECTURE 14 Web Frameworks WEB DEVELOPMENT CONTINUED Web frameworks are collections of packages or modules which allow developers to write web applications with minimal attention paid to low-level details

More information

CSC Web Programming. Introduction to JavaScript

CSC Web Programming. Introduction to JavaScript CSC 242 - Web Programming Introduction to JavaScript JavaScript JavaScript is a client-side scripting language the code is executed by the web browser JavaScript is an embedded language it relies on its

More information

Lecture 10(-ish) Web [Application] Frameworks

Lecture 10(-ish) Web [Application] Frameworks Lecture 10(-ish) Web [Application] Frameworks Minimal Python server import SocketServer import SimpleHTTPServer class Reply(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_get(self): # query arrives

More information

Hue Application for Big Data Ingestion

Hue Application for Big Data Ingestion Hue Application for Big Data Ingestion August 2016 Author: Medina Bandić Supervisor(s): Antonio Romero Marin Manuel Martin Marquez CERN openlab Summer Student Report 2016 1 Abstract The purpose of project

More information

Json Parse Error - No Json Object Could Be Decoded Django Rest Framework

Json Parse Error - No Json Object Could Be Decoded Django Rest Framework Json Parse Error - No Json Object Could Be Decoded Django Rest Framework It supports REST framework's flexible request parsing, rather than just supporting form data. ParseError: JSON parse error - No

More information

Django-CSP Documentation

Django-CSP Documentation Django-CSP Documentation Release 3.0 James Socol, Mozilla September 06, 2016 Contents 1 Installing django-csp 3 2 Configuring django-csp 5 2.1 Policy Settings..............................................

More information

Tomasz Szumlak WFiIS AGH 23/10/2017, Kraków

Tomasz Szumlak WFiIS AGH 23/10/2017, Kraków Python in the Enterprise Django Intro Tomasz Szumlak WFiIS AGH 23/10/2017, Kraków Going beyond Django is a Web framework very popular! It is not the only one, and cannot do wonders There are many others:

More information

django-precise-bbcode Documentation

django-precise-bbcode Documentation django-precise-bbcode Documentation Release 1.0.x Morgan Aubert Aug 12, 2018 Contents 1 Features 3 2 Using django-precise-bbcode 5 2.1 Getting started.............................................. 5 2.2

More information

ABSOLUTE FORM PROCESSOR ADMINISTRATION OPTIONS

ABSOLUTE FORM PROCESSOR ADMINISTRATION OPTIONS ABSOLUTE FORM PROCESSOR ADMINISTRATION OPTIONS The Absolute Form Processor is very easy to use. In order to operate the system, you just need the menu at the top of the screen. There, you ll find all the

More information

django-ajax-form-mixin Documentation

django-ajax-form-mixin Documentation django-ajax-form-mixin Documentation Release 0.0.1 Jonas Geiregat Sep 27, 2017 Contents 1 Usage 3 2 Serving Ajax Validation With Your Static Media Server 7 i ii django-ajax-form-mixin Documentation, Release

More information

Django starting guide

Django starting guide Django starting guide (and much more ) Alessandro Bucciarelli Outline Lesson 1 Intro to versioning systems (Git) Intro to Python and basic data structures Django Lesson 2 Interaction between Django and

More information

web2py tutorial

web2py tutorial web2py tutorial massimo.dipierro@gmail.com web2py start in 2007 one of the most popular web frameworks 2011 Bossie Award 2012 Technology of the Year Award 2 books about 8000+ registered users How did we

More information

A Rails / Django Comparison

A Rails / Django Comparison The Python Papers, Volume 2, Issue 2 44 A Rails / Django Comparison Ben Askins and Alan Green This paper was originally presented at the Open Source Developer's Conference, which ran 5-8 December, 2006

More information

micawber Documentation

micawber Documentation micawber Documentation Release 0.3.4 charles leifer Nov 29, 2017 Contents 1 examples 3 2 integration with web frameworks 5 2.1 Installation................................................ 5 2.2 Getting

More information

Ruby on Rails TKK, Otto Hilska

Ruby on Rails TKK, Otto Hilska Ruby on Rails intro @ TKK, 25.5.2009 Otto Hilska 1 Today s agenda 1. The Ruby programming language 2. Ruby on Rails framework 3. An example project 2 About me Started Nodeta Oy in 2004 10+ employees always

More information

Python Schema Generator Documentation

Python Schema Generator Documentation Python Schema Generator Documentation Release 1.0.0 Peter Demin June 26, 2016 Contents 1 Mutant - Python code generator 3 1.1 Project Status............................................... 3 1.2 Design..................................................

More information

CS1 Lecture 3 Jan. 18, 2019

CS1 Lecture 3 Jan. 18, 2019 CS1 Lecture 3 Jan. 18, 2019 Office hours for Prof. Cremer and for TAs have been posted. Locations will change check class website regularly First homework assignment will be available Monday evening, due

More information

Typical PHP Code Everything shoved into one file. Not Good!

Typical PHP Code Everything shoved into one file. Not Good! MVC in Trax Typical PHP Code Everything shoved into one file. Not Good!

More information

DJOAuth2 Documentation

DJOAuth2 Documentation DJOAuth2 Documentation Release 0.6.0 Peter Downs Sep 27, 2017 Contents 1 Important Links 1 2 What is DJOAuth2? 3 3 Why use DJOAuth2? 5 4 What is implemented? 7 5 Quickstart Guide 9 5.1 Requirements...............................................

More information

Google App Engine Using Templates

Google App Engine Using Templates Google App Engine Using Templates Charles Severance and Jim Eng csev@umich.edu jimeng@umich.edu Textbook: Using Google App Engine, Charles Severance Unless otherwise noted, the content of this course material

More information

Authentication in Rails

Authentication in Rails Authentication in Rails Aaron Mulder CTO Chariot Solutions Philly on Rails, October 2007 1 Agenda The problem Plugins in Rails, and the (many) solutions acts_as_authenticated Generated Code Custom Code

More information

Lecture 4. Ruby on Rails 1 / 52

Lecture 4. Ruby on Rails 1 / 52 Lecture 4 Ruby on Rails 1 / 52 Homeworks 2 & 3 Grades were released for homework 2 Homework 3 was due last night Everyone got a style freebie since my default setup ignores spec files and I didn't change

More information

django-rest-framework-datatables Documentation

django-rest-framework-datatables Documentation django-rest-framework-datatables Documentation Release 0.1.0 David Jean Louis Aug 16, 2018 Contents: 1 Introduction 3 2 Quickstart 5 2.1 Installation................................................ 5

More information

CS1 Lecture 3 Jan. 22, 2018

CS1 Lecture 3 Jan. 22, 2018 CS1 Lecture 3 Jan. 22, 2018 Office hours for me and for TAs have been posted, locations will change check class website regularly First homework available, due Mon., 9:00am. Discussion sections tomorrow

More information

Ruby on Rails 3 March 14th, 2011 Ken Li Allison Pon Kyra Leimert Matt Delaney Edward Bassett

Ruby on Rails 3 March 14th, 2011 Ken Li Allison Pon Kyra Leimert Matt Delaney Edward Bassett CMPUT 410 Ruby on Rails 3 March 14th, 2011 Ken Li Allison Pon Kyra Leimert Matt Delaney Edward Bassett Introduction - What is Ruby on Rails? Ruby on Rails is an open source web application development

More information

django-slim Documentation

django-slim Documentation django-slim Documentation Release 0.5 Artur Barseghyan December 24, 2013 Contents i ii django-slim Contents 1 2 Contents CHAPTER 1 Description Simple implementation of multi-lingual

More information

django-report-tools Documentation

django-report-tools Documentation django-report-tools Documentation Release 0.2.1 Evan Brumley Jul 20, 2017 Contents 1 Contents 3 1.1 Getting Started.............................................. 3 1.2 Charts...................................................

More information

Web Applications. Software Engineering 2017 Alessio Gambi - Saarland University

Web Applications. Software Engineering 2017 Alessio Gambi - Saarland University Web Applications Software Engineering 2017 Alessio Gambi - Saarland University Based on the work of Cesare Pautasso, Christoph Dorn, Andrea Arcuri, and others ReCap Software Architecture A software system

More information

Django File Picker Documentation

Django File Picker Documentation Django File Picker Documentation Release 0.5 Caktus Consulting Group LLC Oct 31, 2017 Contents 1 Dependencies 3 1.1 Required................................................. 3 1.2 Optional.................................................

More information

Convention over Configuration

Convention over Configuration Convention over Configuration The Universal Remote: Powerful, but requires too much configuring Intent Design a framework so that it enforces standard naming conventions for mapping classes to resources

More information

Django EL(Endless) Pagination Documentation

Django EL(Endless) Pagination Documentation Django EL(Endless) Pagination Documentation Release 2.1.0 Oleksandr Shtalinberg and Francesco Banconi December 07, 2015 Contents 1 Changelog 3 1.1 Version 2.1.0...............................................

More information

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted Announcements 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted 2. Campus is closed on Monday. 3. Install Komodo Edit on your computer this weekend.

More information

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective-

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective- UNIT -II Style Sheets: CSS-Introduction to Cascading Style Sheets-Features- Core Syntax-Style Sheets and HTML Style Rle Cascading and Inheritance-Text Properties-Box Model Normal Flow Box Layout- Beyond

More information

CSCI 1320 Creating Modern Web Applications. Content Management Systems

CSCI 1320 Creating Modern Web Applications. Content Management Systems CSCI 1320 Creating Modern Web Applications Content Management Systems Brown CS Website 2 Static Brown CS Website Up since 1994 5.9 M files (inodes) 1.6 TB of filesystem space 3 Static HTML Generators Convert

More information

Creating HTML files using Notepad

Creating HTML files using Notepad Reference Materials 3.1 Creating HTML files using Notepad Inside notepad, select the file menu, and then Save As. This will allow you to set the file name, as well as the type of file. Next, select the

More information

esperanto-cms Documentation

esperanto-cms Documentation esperanto-cms Documentation Release 0.2 Gerhard Seidel July 02, 2015 Contents 1 Contents 1 1.1 Installation................................................ 1 1.2 AdminBundle..............................................

More information

django-dajaxice Documentation

django-dajaxice Documentation django-dajaxice Documentation Release 0.7 Jorge Bastida Nov 17, 2017 Contents 1 Documentation 3 1.1 Installation................................................ 3 1.2 Quickstart................................................

More information

The Pyramid Web Application Development Framework

The Pyramid Web Application Development Framework The Pyramid Web Application Development Framework www.pylonsproject.org Martin Geisler Dealini July 4th, 2013 1 / 20 Outline Introduction Handling a Request Routes Views Renderers Mako Templates Conclusion

More information

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted Announcements 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted 2. Install Komodo Edit on your computer right away. 3. Bring laptops to next class

More information

Let s Talk About Templates. Armin

Let s Talk About Templates. Armin Let s Talk About Templates Armin Ronacher @mitsuhiko Templates why are we discussing templates in 2014? In 2011 we all thought single page applications are the future Cloud Performance > Phone Performance

More information

CHAPTER 1: GETTING STARTED WITH HTML CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

CHAPTER 1: GETTING STARTED WITH HTML CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY) CHAPTER 1: GETTING STARTED WITH HTML EXPLORING THE HISTORY OF THE WORLD WIDE WEB Network: a structure that allows devices known as nodes or hosts to be linked together to share information and services.

More information

wagtailtrans Documentation

wagtailtrans Documentation wagtailtrans Documentation Release 0.1.0 LUKKIEN Jul 27, 2018 Contents 1 Table of contents 3 1.1 Getting started.............................................. 3 1.2 Migrate your existing Wagtail site....................................

More information

spaste Documentation Release 1.0 Ben Webster

spaste Documentation Release 1.0 Ben Webster spaste Documentation Release 1.0 Ben Webster May 28, 2015 Contents 1 Application Overview 3 1.1 Snippets................................................. 3 1.2 Contact Form...............................................

More information

This allows us to use the cookbook code that was downloaded with InstantRails, instead of a new copy of that code. Why is this important?

This allows us to use the cookbook code that was downloaded with InstantRails, instead of a new copy of that code. Why is this important? The Cookbook Application, cont. To bring up the Cookbook application, create a new Ruby project (rightclick in Package Explorer view, then New Project. We name the project cookbook and then deselect the

More information

Ruby: Introduction, Basics

Ruby: Introduction, Basics Ruby: Introduction, Basics Computer Science and Engineering College of Engineering The Ohio State University Lecture 4 Ruby vs Java: Similarities Imperative and object-oriented Classes and instances (ie

More information

Lecture 7. Action View, Bootstrap & Deploying 1 / 40

Lecture 7. Action View, Bootstrap & Deploying 1 / 40 Lecture 7 Action View, Bootstrap & Deploying 1 / 40 Homeworks 5 & 6 Homework 5 was graded Homework 6 was due last night Any questions? 2 / 40 How would you rate the di culty of Homework 6? Vote at http://pollev.com/cis196776

More information

Clojure. The Revenge of Data. by Vjeran Marcinko Kapsch CarrierCom

Clojure. The Revenge of Data. by Vjeran Marcinko Kapsch CarrierCom Clojure The Revenge of Data by Vjeran Marcinko Kapsch CarrierCom Data Processing is what we do Most programs receive, transform, search, and send data Data is raw, immutable information In its essence,

More information

Eliminating XSS: Context-Sensitive Auto-Sanitization in PHP

Eliminating XSS: Context-Sensitive Auto-Sanitization in PHP Eliminating XSS: Context-Sensitive Auto-Sanitization in PHP Joseph Connor @josconno Jared M. Smith @jaredthecoder Howdy! I am Jared Smith I do R&D at Oak Ridge National Laboratory. You can find me at @jaredthecoder

More information

Release Notes for ExtraView Date: Sep 5, 2017

Release Notes for ExtraView Date: Sep 5, 2017 Release Notes for ExtraView 11.2 Date: Sep 5, 2017 Module: Add & Edit 349107 Autosizing of HTML Area fields When entering multiple lines of text into an HTML Area field, the height of the field will grow

More information

COM401 Software Engineering Laboratory

COM401 Software Engineering Laboratory Computer Engineering Department COM401 Software Engineering Laboratory November 04, 2014 LAB-3: Rails Introduction Time: 2 lab hours Objectives: Practice with Ruby Symbols Routes MVC pattern CRUD operations

More information

django-telegram-login Documentation

django-telegram-login Documentation django-telegram-login Documentation Release 0.2.3 Dmytro Striletskyi Aug 21, 2018 Contents 1 User s guide 3 1.1 Getting started.............................................. 3 1.2 How to use widgets............................................

More information