First Indico Workshop WEB FRAMEWORKS Adrian Mönnich 29-27 May 2013 CERN.

Slides:



Advertisements
Similar presentations
Presenter: James Huang Date: Sept. 29,  HTTP and WWW  Bottle Web Framework  Request Routing  Sending Static Files  Handling HTML  HTTP Errors.
Advertisements

Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
DT228/3 Web Development JSP: Directives and Scripting elements.
Direct Congress Dan Skorupski Dan Vingo. Inner workings Reminder: MVC design pattern Procedural view: From request to response o Request passed to a view.
Introduction Need: A dynamic, user controlled website Built in forums, security, and news support Work with existing OpenInsight application Seamless.
UNIT-V The MVC architecture and Struts Framework.
OMap By: Haitham Khateeb Yamama Dagash Under Suppervision of: Benny Daon.
Dataface API Essentials Steve Hannah Web Lite Solutions Corp.
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
CodeIgniter - [Overview]
ACM Web Development Workshop - PHP By Luis Torres.
9 Feb 2004Mikko Mäkinen & Saija Ylönen Joint UNECE/Eurostat/OECD work session on statistical metadata (METIS) Geneva, 9-11 February 2004, Topic (ii): Metadata.
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Cloud computing lectures: Programming with Google App Engine Keke Chen.
A data retrieval workflow using NCBI E-Utils + Python Part II: Jinja2 / Flask John Pinney Tech talk Tue 19 th Nov.
ASP.NET and Model View Control Jesper Tørresø ITNET2 F08.
Putting What We Learned Into Context – WSGI and Web Frameworks A290/A590, Fall /16/2014.
from SimpleHTTPServer import SimpleHTTPRequestHandler import SocketServer httpd = SocketServer.TCPServer((‘’, 8000), SimpleHTTPRequestHandler) httpd.serve_forever()
Data File Access API : Under the Hood Simon Horwith CTO Etrilogy Ltd.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
Who uses it? MichaelMoore.com What's it all about? Rapid Development Clean, Pragmatic Design.
First Indico Workshop INDICO SEARCH Adrian Mönnich May 2013 CERN.
Oracle Data Integrator Procedures, Advanced Workflows.
Associations INFO 2310: Topics in Web Design and Programming.
Graphing and statistics with Cacti AfNOG 11, Kigali/Rwanda.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
Apache JMeter By Lamiya Qasim. Apache JMeter Tool for load test functional behavior and measure performance. Questions: Does JMeter offers support for.
Frameworks CompSci 230 S Software Construction.
Python template engines and implementation in Indico Marius Damarackas (Vilnius University)
App Engine Web App Framework Jim Eng
 Registry itself is easy and straightforward in implementation  The objects of registry are actually complicated to store and manage  Objects of Registry.
Trunica Inc. 500 East Kennedy Blvd #300 Tampa, FL Cross Platform Mobile Apps With Cordova and Visual Studio 2015 © Copyright 2015.
UPortal 3 RC2 PreviewJA-SIG Conference, Summer 2007 uPortal RC2 Preview Moving on Up Reviewing current work and future plans Standardizing the framework.
Date : 3/04/2010 Web Technology Solutions Class: PHP Web Application Frameworks.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
CSC 2720 Building Web Applications Basic Frameworks for Building Dynamic Web Sites / Web Applications.
Ruby on Rails Controller of MVC. Routes How we map URIs like /tweets/1 to calling the show method of the Controller.
The road to Indico 2.0 On the way to a clean and extensible codebase.
First Indico Workshop HTTP API Adrian Mönnich May 2013 CERN.
Introduction  “M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER”. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
LECTURE 14 Web Frameworks. WEB DEVELOPMENT CONTINUED Web frameworks are collections of packages or modules which allow developers to write web applications.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
Ruby on Rails. Web Framework for Ruby Designed to make it easier to develop, deploy, and maintain web applications Design with Model-View-Controller –almost.
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016.
Submitted by: Moran Mishan. Instructed by: Osnat (Ossi) Mokryn, Dr.
/16 Final Project Report By Facializer Team Final Project Report Eagle, Leo, Bessie, Five, Evan Dan, Kyle, Ben, Caleb.
The Django Web Application Framework zhixiong.hong
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Comparative Display Technologies.
FILE I/O: Low-level 1. The Big Picture 2 Low-Level, cont. Some files are mixed format that are not readable by high- level functions such as xlsread()
J2EE vs Python for web development David
The Holmes Platform and Applications
Web Technology Solutions
Framework and Graph Visualization Tools
EOS WEBPAGE Collaborative work with: Ewa Lopienska (logo),
CARA 3.10 Major New Features
Testing Alfresco extensions (no, it’s not about jUnit)
Why API?.
Upnl 24th workshop kim jae chan
Recitation – Week 8 Pranut jain.
Development Changes in Dynamics 365 for Finance and Operations
Introduction to MVC PHP Web Development Ivan Yonkov Training Manager
Top 5 Front End Development Tools. 1. Sublime Text Sublime Text may be a super quick and have packed text and development editor. If you're about to be.
Principles of report writing
Flask Web Frameworks for Python
CS/COE 1520 Jarrett Billingsley
Presentation transcript:

First Indico Workshop WEB FRAMEWORKS Adrian Mönnich May 2013 CERN

Framework? What? Do we have one? Do we need one? A web application framework is a software framework that is designed to support the development of dynamic websites, web applications, web services and web resources. Wikipedia

Indico’s “framework” Completely self-made! That’s a good thing, right? It’s really old (almost ten years!) There were basically no Python Web Frameworks out there Five layers – some of them are obsolete! New things got added on top when necessary Bad legacy code was rarely refactored in the past

Indico’s “framework” Anyway, how does it look like? That’s the initial structure It was improved a bit ( mod_wsgi ) Still mod_python -like URLs and files Custom wrapper to emulate mod_python Uses exec (also known as eval (“evil”))

Indico’s “framework” htdocs/*.py We have 200 of those files. They just call some RH’s process method. Nothing else. URLs look like whatever.py/create def index(req, **params): return RHCategoryCreation(req).process(params) def create(req, **params): return RHCategoryPerformCreation(req).process(params)

Indico’s “framework” RH* Data validation Permission checks Application logic Pre-/Post-request operations (DB connection)

Indico’s “framework” WP* Can specify additional JS packages Handles non-AJAX tabbed navigation Does this need to be a framework layer?!

Indico’s “framework” W* Useful when templates could not contain any logic Now: Templates support loops, conditionals, etc. W* mostly pass variables from the RH/WP to the template W* matches WTF for a reason

Indico’s “framework” Templates We got rid of the our old template engines in 2011 Now there is Mako % if canEdit: % endif ${ fullName }

So…. How To improve it? COULD we add a modern framework?

What about… Django? It’s really popular! Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Full-Stack - ORM, Administration, Clean URLs, Templating, Caching, i18n Very useful for rather simple CRUD-style applications Indico is huge! We don’t want to rewrite everything! Indico does not use SQL but ZODB! Django uses a SQL DB by default.

Something Else… Flask! Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions. Small footprint, no bloat and not very intrusive Easy to extend – by subclassing or (if really necessary) forking RESTful request dispatching (includes clean URLs) Extensive documentation & active community on IRC Already in use for Indico Mobile

Flask How does it look like? Obviously this example is very basic It won’t be that easy to use Flask in Indico  from flask import Flask app = def hello(): return "Hello World!" if __name__ == "__main__": app.run()

Indico & Flask What are we going to do? Step 1 Get rid of the custom WSGI code and replace it with Flask/Werkzeug Werkzeug is the low-level Web/WSGI toolkit Flask is based on Replace the mod_python emulation with Flask’s routing system Use Flask’s URL generation instead of the custom URLHandler code

Indico & Flask What are we going to do? Step 2 Get rid of the htdocs/*.py files which only call RHs anyway Instead of routing requests to those files/functions make RHs usable as routing targets directly How? We’ll see! Most likely with a classmethod or a decorator.  Only internal changes so far  Let’s make sure things still work

Indico & Flask Speaking of decorators… In Flask it’s very common to use decorators when registering URL ") def event(eid): return "You are viewing event #%d" % eid That’s nice, especially for smaller applications! But in Indico it would be a major chaos and cause all kinds of trouble with circular dependencies… So we’ll use app.add_url_rule() directly

Indico & Flask What are we going to do? Step 3 Switch to clean URLs: /event/ or /event/ /timetable Instead of e.g. conferenceDisplay.py?confId= Setup 301 (permanent) redirects from the old URLs to the new ones. This is the first and most prominent change visible to users!

Indico & Flask Additional goals (possibly long-term) Directly access GET and POST data via the Flask APIs (esp. in new code) Integrate Indico sessions with the Flask session interface Get rid of the W* classes Clean up templates (remove actual Python code) Maybe convert templates from Mako to Jinja2 (better syntax)

Adrian Mönnich Questions?