The document is a project report submitted to Bharati Vidyapeeth University by Akash Raj guru. It contains information on three web development frameworks - Django, QT, and Web2py. For the Django framework section, it provides an introduction to Django including what it is, its prerequisites, downloading and installing Django, creating projects and applications in Django, and building Django applications. It also includes project snapshots and source code for a Django project.
Cloud-Native Streaming and Event-Driven MicroservicesVMware Tanzu
MARIUS BOGOEVICI SPRING CLOUD STREAM LEAD
Join us for an introduction to Spring Cloud Stream, a framework for creating event-driven microservices that builds on on the ease of development and execution of Spring Boot, the cloud-native capabilities of Spring Cloud, and the message-driven programming model of Spring Integration. See how Spring Cloud Stream’s abstractions and opinionated primitives allow you to easily build applications that can interchangeably use RabbitMQ, Kafka or Google PubSub without changing the application logic. Finally, we will show how these applications can be orchestrated and deployed on different modern runtimes such as Cloud Foundry, Kubernetes or Mesos using Spring Cloud Data Flow.
SpringOne Platform 2017
Mark Fisher, Pivotal
This live coding session will introduce Spring Cloud Function, from the basic programming model all the way to multicloud deployments. Along the way, we'll explore the current state of Java across Function-as-a-Service providers and demonstrate what role Spring can play in the Serverless world.
Slide deck to give some theoretical background before stepping into the hands-on tutorial at http://sdnhub.org/tutorials/opendaylight. Compared to earlier version of this slide deck, this tutorial slide deck has been updated to focus more on MD-SAL and YANG modeled app development.
SpringOne Platform 2017
Juergen Hoeller, Pivotal
"Spring Framework 5.0 brings a lot of refinements all across the framework: some of rather obvious elements of our major programming model themes (functional & reactive)... but also some less prominent and less commonly presented features.
This brief session highlights a few personal favorites beyond the major themes."
Cloud-Native Streaming and Event-Driven MicroservicesVMware Tanzu
MARIUS BOGOEVICI SPRING CLOUD STREAM LEAD
Join us for an introduction to Spring Cloud Stream, a framework for creating event-driven microservices that builds on on the ease of development and execution of Spring Boot, the cloud-native capabilities of Spring Cloud, and the message-driven programming model of Spring Integration. See how Spring Cloud Stream’s abstractions and opinionated primitives allow you to easily build applications that can interchangeably use RabbitMQ, Kafka or Google PubSub without changing the application logic. Finally, we will show how these applications can be orchestrated and deployed on different modern runtimes such as Cloud Foundry, Kubernetes or Mesos using Spring Cloud Data Flow.
SpringOne Platform 2017
Mark Fisher, Pivotal
This live coding session will introduce Spring Cloud Function, from the basic programming model all the way to multicloud deployments. Along the way, we'll explore the current state of Java across Function-as-a-Service providers and demonstrate what role Spring can play in the Serverless world.
Slide deck to give some theoretical background before stepping into the hands-on tutorial at http://sdnhub.org/tutorials/opendaylight. Compared to earlier version of this slide deck, this tutorial slide deck has been updated to focus more on MD-SAL and YANG modeled app development.
SpringOne Platform 2017
Juergen Hoeller, Pivotal
"Spring Framework 5.0 brings a lot of refinements all across the framework: some of rather obvious elements of our major programming model themes (functional & reactive)... but also some less prominent and less commonly presented features.
This brief session highlights a few personal favorites beyond the major themes."
Reactive Microservices with Spring 5: WebFlux Trayan Iliev
On November 27 Trayan Iliev from IPT presented “Reactive microservices with Spring 5: WebFlux” @Dev.bg in Betahaus Sofia. IPT – Intellectual Products & Technologies has been organizing Java & JavaScript trainings since 2003.
Spring 5 introduces a new model for end-to-end functional and reactive web service programming with Spring 5 WebFlow, Spring Data & Spring Boot. The main topics include:
– Introduction to reactive programming, Reactive Streams specification, and project Reactor (as WebFlux infrastructure)
– REST services with WebFlux – comparison between annotation-based and functional reactive programming approaches for building.
– Router, handler and filter functions
– Using reactive repositories and reactive database access with Spring Data. Building end-to-end non-blocking reactive web services using Netty-based web runtime
– Reactive WebClients and integration testing. Reactive WebSocket support
– Realtime event streaming to WebClients using JSON Streams, and to JS client using SSE.
Implementing Microservices with Jakarta EE and MicroProfileKevin Sutter
My half of the presentation at Devoxx BE 2018 (@DevoxxBE). I give brief histories of both MicroProfile and Jakarta EE, and then discuss ways that the two platforms might come together at some point. The associated recording is here: https://www.youtube.com/watch?v=VqMs6a3nv_0
Stream Processing with CompletableFuture and Flow in Java 9Trayan Iliev
Stream based data / event / message processing becomes preferred way of achieving interoperability and real-time communication in distributed SOA / microservice / database architectures.
Beside lambdas, Java 8 introduced two new APIs explicitly dealing with stream data processing:
- Stream - which is PULL-based and easily parallelizable;
- CompletableFuture / CompletionStage - which allow composition of PUSH-based, non-blocking, asynchronous data processing pipelines.
Java 9 will provide further support for stream-based data-processing by extending the CompletableFuture with additional functionality – support for delays and timeouts, better support for subclassing, and new utility methods.
More, Java 9 provides new java.util.concurrent.Flow API implementing Reactive Streams specification that enables reactive programming and interoperability with libraries like Reactor, RxJava, RabbitMQ, Vert.x, Ratpack, and Akka.
The presentation will discuss the novelties in Java 8 and Java 9 supporting stream data processing, describing the APIs, models and practical details of asynchronous pipeline implementation, error handling, multithreaded execution, asyncronous REST service implementation, interoperability with existing libraries.
There are provided demo examples (code on GitHub) using Completable Future and Flow with:
- JAX-RS 2.1 AsyncResponse, and more importantly unit-testing the async REST service method implementations;
- CDI 2.0 asynchronous observers (fireAsync / @ObservesAsync);
Presentation from BGOUG conference Nov 17, 2017.
Since September 2017, Java 9 is generally available. It offers many enhancements:
• Modularity – provides clear separation between public and private APIs, stronger encapsulation & dependency management.
• JShell – using and customizing Java 9 interactive shell by example
• Process API updates – feature-rich, async OS process management and statistics
• Reactive Streams, CompletableFuture and Stream API updates
• Building asynchronous HTTP/2 and WebSocket pipelines using HTTP/2 Client and CompletableFuture composition
• Collection API updates
• Stack walking, and other language enhancements (Project Coin)
Discussed topics are accompanied by live demos available for further review @ github.com/iproduct.
DevNexus 2019: MicroProfile and Jakarta EE - What's Next?Kevin Sutter
Presentation used at DevNexus 2019 in Atlanta. "What happens to MicroProfile now that Jakarta EE has been created?" is one of the most common questions I get. This presentation discusses that topic.
In this presentation I will go through latest features being added in Spring 3.1/3.2 one more time and also will try to look behind the scene on what new features are comming in Spring 4 which should be released at the end of this year.
Our previous talk "Intro to Reactive Programming" defined reactive programming and provided details around key initiatives such as Reactive Streams and ReactiveX. In this talk we'll focus on where we are today with building reactive web applications. We'll take a look at the choice of runtimes, how Reactive Streams may be applied to network I/O, and what the programming model may look like. While this is a forward looking talk, we'll spend plenty of time demoing code built with with back-pressure ready libraries available today.
Ingress? That’s So 2020! Introducing the Kubernetes Gateway APIVMware Tanzu
SpringOne 2021
Session Title: Ingress? That’s So 2020! Introducing the Kubernetes Gateway API
Speakers: Abhinav Rau, Principal Architect at Google; Madhav Sathe, Cloud Customer Engineer at Google
This is your one stop shop introduction to get oriented to the world of reactive programming. There are lots of such intros out there even manifestos. We hope this is the one where you don't get lost and it makes sense. Get a definition of what "reactive" means and why it matters. Learn about Reactive Streams and Reactive Extensions and the emerging ecosystem around them. Get a sense for what going reactive means for the programming model. See lots of hands-on demos introducing the basic concepts in composition libraries using RxJava and Reactor.
Micronaut: A new way to build microservicesLuram Archanjo
Over the years microservices architecture has been widely adopted in conjunction with Spring Boot. But recently, we are witnessing the rise of microframeworks such as Micronaut, which has innovated the way we build microservices by providing low memory consumption, fast startup, non-blocking, and other important features that I will demonstrate and conceptualize in this talk.
Ever wondered what makes a cloud-native application “cloud-native”? Ever wondered what the unique challenges are and how best to address them on fully-open Java technologies? In this workshop, you’ll learn what it means to be cloud-native and how that impacts application development. You’ll learn about Eclipse MicroProfile, an industry collaboration defining technologies for the development and management of cloud-native microservices. With a full set of MicroProfile workshop modules available to you, you’ll be able to start with the basics of REST services and progress to more advanced topics, or you can jump right in and develop secure, fault tolerant, configurable and monitorable microservices.
Once you’ve developed your microservice, you’ll learn how to package it in a Docker container and deploy it to a Kubernetes cluster. Finally, you’ll learn the role OpenShift the hybrid cloud enterprise container platform. You'll deploy your application, scale it up and create routes that allow you to manage traffic to and from your deployments.
Reactive Microservices with Spring 5: WebFlux Trayan Iliev
On November 27 Trayan Iliev from IPT presented “Reactive microservices with Spring 5: WebFlux” @Dev.bg in Betahaus Sofia. IPT – Intellectual Products & Technologies has been organizing Java & JavaScript trainings since 2003.
Spring 5 introduces a new model for end-to-end functional and reactive web service programming with Spring 5 WebFlow, Spring Data & Spring Boot. The main topics include:
– Introduction to reactive programming, Reactive Streams specification, and project Reactor (as WebFlux infrastructure)
– REST services with WebFlux – comparison between annotation-based and functional reactive programming approaches for building.
– Router, handler and filter functions
– Using reactive repositories and reactive database access with Spring Data. Building end-to-end non-blocking reactive web services using Netty-based web runtime
– Reactive WebClients and integration testing. Reactive WebSocket support
– Realtime event streaming to WebClients using JSON Streams, and to JS client using SSE.
Implementing Microservices with Jakarta EE and MicroProfileKevin Sutter
My half of the presentation at Devoxx BE 2018 (@DevoxxBE). I give brief histories of both MicroProfile and Jakarta EE, and then discuss ways that the two platforms might come together at some point. The associated recording is here: https://www.youtube.com/watch?v=VqMs6a3nv_0
Stream Processing with CompletableFuture and Flow in Java 9Trayan Iliev
Stream based data / event / message processing becomes preferred way of achieving interoperability and real-time communication in distributed SOA / microservice / database architectures.
Beside lambdas, Java 8 introduced two new APIs explicitly dealing with stream data processing:
- Stream - which is PULL-based and easily parallelizable;
- CompletableFuture / CompletionStage - which allow composition of PUSH-based, non-blocking, asynchronous data processing pipelines.
Java 9 will provide further support for stream-based data-processing by extending the CompletableFuture with additional functionality – support for delays and timeouts, better support for subclassing, and new utility methods.
More, Java 9 provides new java.util.concurrent.Flow API implementing Reactive Streams specification that enables reactive programming and interoperability with libraries like Reactor, RxJava, RabbitMQ, Vert.x, Ratpack, and Akka.
The presentation will discuss the novelties in Java 8 and Java 9 supporting stream data processing, describing the APIs, models and practical details of asynchronous pipeline implementation, error handling, multithreaded execution, asyncronous REST service implementation, interoperability with existing libraries.
There are provided demo examples (code on GitHub) using Completable Future and Flow with:
- JAX-RS 2.1 AsyncResponse, and more importantly unit-testing the async REST service method implementations;
- CDI 2.0 asynchronous observers (fireAsync / @ObservesAsync);
Presentation from BGOUG conference Nov 17, 2017.
Since September 2017, Java 9 is generally available. It offers many enhancements:
• Modularity – provides clear separation between public and private APIs, stronger encapsulation & dependency management.
• JShell – using and customizing Java 9 interactive shell by example
• Process API updates – feature-rich, async OS process management and statistics
• Reactive Streams, CompletableFuture and Stream API updates
• Building asynchronous HTTP/2 and WebSocket pipelines using HTTP/2 Client and CompletableFuture composition
• Collection API updates
• Stack walking, and other language enhancements (Project Coin)
Discussed topics are accompanied by live demos available for further review @ github.com/iproduct.
DevNexus 2019: MicroProfile and Jakarta EE - What's Next?Kevin Sutter
Presentation used at DevNexus 2019 in Atlanta. "What happens to MicroProfile now that Jakarta EE has been created?" is one of the most common questions I get. This presentation discusses that topic.
In this presentation I will go through latest features being added in Spring 3.1/3.2 one more time and also will try to look behind the scene on what new features are comming in Spring 4 which should be released at the end of this year.
Our previous talk "Intro to Reactive Programming" defined reactive programming and provided details around key initiatives such as Reactive Streams and ReactiveX. In this talk we'll focus on where we are today with building reactive web applications. We'll take a look at the choice of runtimes, how Reactive Streams may be applied to network I/O, and what the programming model may look like. While this is a forward looking talk, we'll spend plenty of time demoing code built with with back-pressure ready libraries available today.
Ingress? That’s So 2020! Introducing the Kubernetes Gateway APIVMware Tanzu
SpringOne 2021
Session Title: Ingress? That’s So 2020! Introducing the Kubernetes Gateway API
Speakers: Abhinav Rau, Principal Architect at Google; Madhav Sathe, Cloud Customer Engineer at Google
This is your one stop shop introduction to get oriented to the world of reactive programming. There are lots of such intros out there even manifestos. We hope this is the one where you don't get lost and it makes sense. Get a definition of what "reactive" means and why it matters. Learn about Reactive Streams and Reactive Extensions and the emerging ecosystem around them. Get a sense for what going reactive means for the programming model. See lots of hands-on demos introducing the basic concepts in composition libraries using RxJava and Reactor.
Micronaut: A new way to build microservicesLuram Archanjo
Over the years microservices architecture has been widely adopted in conjunction with Spring Boot. But recently, we are witnessing the rise of microframeworks such as Micronaut, which has innovated the way we build microservices by providing low memory consumption, fast startup, non-blocking, and other important features that I will demonstrate and conceptualize in this talk.
Ever wondered what makes a cloud-native application “cloud-native”? Ever wondered what the unique challenges are and how best to address them on fully-open Java technologies? In this workshop, you’ll learn what it means to be cloud-native and how that impacts application development. You’ll learn about Eclipse MicroProfile, an industry collaboration defining technologies for the development and management of cloud-native microservices. With a full set of MicroProfile workshop modules available to you, you’ll be able to start with the basics of REST services and progress to more advanced topics, or you can jump right in and develop secure, fault tolerant, configurable and monitorable microservices.
Once you’ve developed your microservice, you’ll learn how to package it in a Docker container and deploy it to a Kubernetes cluster. Finally, you’ll learn the role OpenShift the hybrid cloud enterprise container platform. You'll deploy your application, scale it up and create routes that allow you to manage traffic to and from your deployments.
Rapid web application development using django - Part (1)Nishant Soni
This slide contains deatils about Django Framework which is based in Python. Beginners to this technology can first learn about the technology and its uses and than start building their project. Popular website like Pinterest, Instagram, Nasa are examples of web application built in Django Framework. This is part 1 .
Django is a free and open source web application framework, written in Python, which follows the Model–View–Controller architectural pattern.
It focuses on automating as much as possible and adhering to the DRY principle
Learn Django Tips, Tricks & Techniques for DevelopersMars Devs
Django is a free, open-source Python framework meant to make back-end development easier. It allows developers to design complex, secure, and scalable apps swiftly. So, you have chosen to learn Python or Django You may be already familiar with the language and framework So, MarsDevs presents you with some Django tips and tricks that a beginner developer like you should know! Let’s dig in.
Click here to know more: https://www.marsdevs.com/blogs/learn-django-tips-tricks-techniques-for-developers
Django is a free and open source web application framework written in Python. A framework is nothing more than a collection of modules that make development easier. Read More: https://www.andolasoft.com/blog/django-workflow-and-architecture.html
This session is about Django, which is a web framework build in python. It has several features like admin interface and ORM. The architecture of Django has Model, View, and template and it's ORM saves the pain of writing database queries.
STIX CyBox Creator Application
STIX is a language developed for specify, capture, characterize and communicate the Cyber Threat Information. More information can be found on: http://stixproject.github.io/about/
About application: STIX CyBox Creator application is developed using python as a back end programming language. Is a client based application which allows user (e.g. Cyber Security Analyst) to connect with IMAP server (e.g. gmail sever) using email account credentials and also enables to create a STIX CyBox document for selected email.
Welcome, this is a project on the study of network Intrusion Detection System, how prevention can be achieved and how Honeypot concept can be used to make network more secured. It explains the research done while developing the application software. The major research done was about understanding how intrusion detection works and how it can be implemented in my application using java as development programming language.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
1. 1 | P a g e
PROJECT REPORT
SEMESTER - V
Submitted to:
BHARATI VIDYAPEETH UNIVERSITY
Amplify DITM, Pune
Submitted by:
Akash Raj guru, B.Sc. IT III year
BVU Amplify DITM, Pune
2. 2 | P a g e
TABLEOF CONTENTS
1. Django Framework
i) introduction
ii) Project Snapshot
iii) Source code
2. QT framework
(i) introduction
(ii) project snapshot
(iii) source code
3. Web2py framework
i) Introduction
ii) Project Snapshot
iii) Source code
4. References
3. 3 | P a g e
1 DJANGOFRAMEWORK
1.1 INTRODUCTION
DJANGO IS A HIGH-LEVEL PYTHON WEB FRAMEWORK THAT ENCOURAGES
RAPID DEVELOPMENT AND CLEAN, PRAGMATIC DESIGN.
Developed by a fast-moving online-news operation,
Django was designed to handle two challenges: the
intensive deadlines of a newsroom and the stringent
requirements of the experienced Web developers
who wrote it. It lets you build high-performing,
elegant Web applications quickly.
Because Django was developed in a fast-paced
newsroom environment, it was designed to make
common Web-development tasks fast and easy.
Here’s an informal overview of how to write a
database-driven Web app with Django.
High level web framework
Basic modules, classes, and tools to quickly develop
and deploy web apps
Contains an ORM (Object-Relational Mapper) that
allows for the use of standard Python language
syntax when interfacing with a back-end database.
Developer need not learn SQL, DDL, etc!
4. 4 | P a g e
Provides a template framework that allows HTML,
XML, and other “documents” to be converted
into “templates”, which can then be converted to
“output” via a wide range of substitution
techniques.
Elegant URL support (fancy, beautiful URL's, no
“?blah=blah”, etc.)
Multi-lingual
Fast and easy to use, robust, flexible, and lots of
contributed components available!
Built in administrative interface to manage data
models.
Built-in authentication/access control components
Contributed geospatial support components
(GeoDjango)
Extensible!
Django Pre-Requisites
Python 2.3 or higher
No Python 3.0 support (yet)
Database drivers for the database you wish to use
PostgreSQL, Oracle, SQLite, MySQL
Web Server
5. 5 | P a g e
Django has a built-inweb server for development
Handles a single connectionat a time.
Not security-tested
By default listens only for “local” connections.
Apache, IIS, etc. for deployment
Downloading& Installing Django
Django can be downloadedfrom
http://www.djangoproject.com/download
Unpack and installDjango
Unpack the sources and run the command below from
the Django source directory as the root user:
python setup.py install
This command works the same on Windows as it does in
the Linux environment,you just need to make sure you
call the correct interpreter.
Choosing a Database
Current version of Django provide support for three databases:
PostgreSQL using the psycopg and psycopg2 drivers .
Unix versions can be downloadedfrom
http://initd.org/pub/software/psycopg/
Windows version are availableat
http://stickpeople.com/projects/python/win-psycopg/
MySQL using the MySQLdb package.
6. 6 | P a g e
This package is availableat http://sf.net/projects/mysql-
python/ .
SQLite 3 using the pysqlite package.
This package is availableat
http://trac.edgewall.org/wiki/PySqlite.
SQLite support is included in Python version 2.5 and newer.
Django supports all of these databases in the same
manner, so which you choose to use here makes little
difference, since everything is coded in the same
way.
When you move to your own developmentsystem,
you'll need to choose a database based on your
needs and the software deployedin your enterprise.
Creating a New Project
The django-admin.py toolis used to create a directory and
create “default” files for a new
Django project.
A project is generally made up of one or more “apps”
Functionalcode is containedwithin the apps.
Use the django-admin.pyscript to create the
new project files.
django-admin.pystartproject name
The startproject argument tells the command that we
need it to initializea new Django project.
7. 7 | P a g e
The name argument allows us to specify the name of
the project to be created.
When the command runs, it will create a new
directory called name in the current directory, and
populateit with a few files:
__init__.py: A file that causes Python to treat the directory as a
package.
manage.py:A command line utility to communicate with
Django.
settings.py: Configurationsettings for the project.
urls.py: URL declarationsfor the project. The URL's tell Django
what to do when certain URL's
are put into the browser.
1.2 STARTING THE TEST SERVER
Once you've created your project, you can test it by starting up
the Django development
server.
You can start the server using the command:
python manage.py runserver
This command will start up the server and listen on port 8000
of your system.
You can use your web browser to connect to the server using
the URL the command returns.
8. 8 | P a g e
Creating a New Application
Once you've created a project, you'll need to create an
application.
Django models and views are handledthrough the application
itself – not the project, which
consists of primarily the controller and base settings (such as
data store information)
You can begin a new app by openinga shell
window in your project directory and issuing
the 'startapp' command.
Like projects, you should avoidusing reserved words for your
app name, otherwise you might
run into problems later.
Once you've created a new app (or installedan app from a third
party), you'll want to add it
to the list of INSTALLED_APPS in your projects 'settings.py' file.
Apps are not actuallyused until they are installed,so you'll
want to make sure you install your
app, or it won't be usable in your project.
9. 9 | P a g e
Building Django Applications
Overview of A Typical Django Request
When a request comes in for a Django applicationviathe web,
it typicallyfollows a specific
path:
1. Django uses a set of regular expression matching patterns
based on the URL.
Each expression is tied to a function (called a “view” in Django
parlance), when a match is found the
view is executed.
2. Views are passed a HTTPRequest object (and possibly other
information) - which represents the
“state” of the inboundrequest (meta-parameters, GET, POST,
COOKIE, etc. are all containedin
the request object)
3. The view may make a request for data using the ORM, and
uses the informationobtainedto
populatea dictionarywith parameters that can be used to
compose the response.
4. A template is chosen, and used along with the information in
(3) above to substitute data and
10. 10 | P a g e
generate some output data.
5. The output data (4) is made part of an HTTPResponse object,
which also containsHTTP headers
that shouldbe sent to the client.
6. The HTTPResponse object is returned by the view function,
and Django uses it to generate the
response back to the client.
Setting up URL Patterns
When requests come in to
Django via the web, they come
in via a request for a particular
URL.
That URL (the portionafter the
'/' after the host name) is
matched against a set of regular
expressions to determine the
view to call.
The URL patterns are processed
in the order that they are
entered, so “specific” expressions should
11. 11 | P a g e
appearbefore generic expressions.
Regular expressions can also be used to
pass named parameters to view
functions(the first argument to the view
will alwaysbe the HttpRequest object, the others can be passed
based on the URL, such as in
the example here)
from django.conf.urls.defaultsimport *
from project.appname.viewsimport welcome, date_view
urlpatterns= patterns('',
(r'^$','welcome'),
(r'^(?P<mon>w+)/(?P<year>d{4})', 'date_view')
)
A sample URL pattern. In this case when the URL is empty, the
project.appname.views.welcome
function is called and passed a HTTPRequest object.
The second URL pattern grabs the month and year from the
URL and calls the date view with named
arguments of 'mon' and 'year'
21. 21 | P a g e
BLOG.HTML
{%extends"base.html"%}
{%blockcontent%}
{% forpost inobject_list%}
<h3><a href="/blog/{{post.id}}">{{ post.title}}</a></h3>
<divclass = "post_meta">
on {{ post.date }}
</div>
<div class = "post_body">
{{ post.body|safe|linebreaks}}
</div>
{%endfor%}
{% endblock%}
POST.HTML
{%extends"base.html"%}
{%blockcontent%}
<h3><a href="/blog/{{post.id}}">{{ post.title}}</a></h3>
<divclass = "post_meta">
on {{ post.date }}
22. 22 | P a g e
</div>
<divclass = "post_body">
{{ post.body|safe|linebreaks}}
</div>
{% endblock%}
2 QT
3 INTRODUCTIONTO QT QUICK
Qt Quick is a collectionof technologies that are designed to help
developers create the kind of intuitive, modern,and fluid user interfaces
that are increasingly used on mobile phones, media players, set-top boxes,
and other portable devices.Qt Quick consists of a rich set of user
interface elements,a declarative language for describing user interfaces,
and a language runtime. A collectionof C++ APIs is used to integrate these
high level features with classic Qt applications. Version 2.1 of the Qt
Creator integrated developmentenvironment (IDE) introduces tools for
developing Qt Quick applications.
23. 23 | P a g e
3.1 THE QML LANGUAGE
QML is a high level, scripted language. Its commands,more
correctly elements,leverage the power and efficiencyof the Qt libraries to
make easy to use commands that perform intuitive functions. Drawing a
rectangle, displaying an image, and application events -- all are possible
with declarative programming.
The language also allows more flexibility of these commands by
using JavaScript to implementthe high level user interface logic.
A QML element usually has various propertiesthat help define the element.
For example, if we created an element called Circle then the radius of the
circle would be a property. Building user interfaces by importing these
elements is one of the great feature of QML and Qt Quick.
24. 24 | P a g e
3.2 QTDECLARATIVE MODULE
To make Qt Quick possible,Qt introduces the QtDeclarative module. The
module creates a JavaScript runtime that QML runs under with a Qt based
backend. Because QtDeclarative and QML are built upon Qt, they inherit
many of Qt's technology, namely the signals and slots mechanism and
the meta-object system.Data created using C++ are directly accessible
from QML and QML objects are also accessible from C++ code.
In conjunction with the QML language, the QtDeclarative module separates
the interface logic in QML from the application logic in C++.
3.3 CREATOR TOOLS
Qt Creator is a complete integrated development environment (IDE) for creating applications with Qt
Quick and the Qt application framework.
25. 25 | P a g e
The main goal for Qt Creator is meeting the developmentneeds of Qt
Quick developerswho are looking for simplicity, usability, productivity,
extendibility and openness,while aiming to lower the barrier of entry for
newcomers to Qt Quick and Qt. The key features of Qt Creator allow UI
designers and developers to accomplishthe following tasks:
Get started with Qt Quick application development quickly and
easily with examples, tutorials, and project wizards.
Design application user interface with the integrated editor, Qt
Quick Designer, or use graphics software to design the user
interface and use scripts to export the design to Qt Quick
Designer.
Develop applications with the advanced code editor that provides
new powerful features for completing code snippets, refactoring
code, and viewing the element hierarchy of QML files.
Build and deploy Qt Quick applications that target multiple
desktop and mobile platforms, such as Microsoft Windows, Mac
OS X, Linux, Symbian, and Maemo.
Debug JavaScript functions and execute JavaScript expressions in
the current context, and inspect QML at runtime to explore the
object structure, debug animations, and inspect colors.
Deploy applications to mobile devices and create application
installation packages for Symbian and Maemo devices that can be
published in the Ovi Store and other channels.
Easily access information with the integrated context-sensitive Qt
Help system.
26. 26 | P a g e
3.4 WHERE TO GO FROM HERE
The Qt Quick page has links to various Qt Quick topics such as QML features, addons, and tools.
The QML Examples and Demos page has a gallery of QML applications
28. 28 | P a g e
SOURCECODE
importsys
fromPySide.QtCore import*
fromPySide.QtGui import*
importtime
app = QApplication(sys.argv)
try:
due = QTime.currentTime()
message = "Alert!"
29. 29 | P a g e
if len(sys.argv) <2:
raise ValueError
hours,minutes= sys.argv[1].split(":")
due = QTime(int(hours),int(minutes))
if not due.isValid():
raise ValueError
if len(sys.argv) >2:
message =" ".join(sys.argv[2:])
exceptValueError:
message = "usage:myalaram.pyHH:MM[optional message]"
while QTime.currentTime() <due:
time.sleep(10)
label = QLabel("<fontcolor=redsize=72><b>"+ message +"</b></font>")
label.setWindowFlags(Qt.SplashScreen)
label.show()
QTimer.singleShot(20000,app.quit)
app.exec_()
30. 30 | P a g e
SOURCECODE
importsys
fromPySide.QtCore import*
fromPySide.QtGui import*
frommath import*
classForm(QDialog):
def __init__(self,parent=None):
31. 31 | P a g e
super(Form,self).__init__(parent)
self.browser=QTextBrowser()
self.lineedit=QLineEdit("Typeanexpressionandpressenter")
self.lineedit.selectAll()
layout= QVBoxLayout()
layout.addWidget(self.browser)
layout.addWidget(self.lineedit)
self.setLayout(layout)
self.lineedit.setFocus()
self.connect(self.lineedit,SIGNAL("returnPressed()"),self.updateUi)
self.setWindowTitle("PYTHON_CALCULATOR")
def updateUi(self):
try:
text= self.lineedit.text()
self.browser.append("%s<b>%s</b>"%(text,eval(text)))
except:
self.browser.append("<fontcolor=red>%sisinvalid</font>"%text)
app = QApplication(sys.argv)
form= Form()
form.show()
app.exec_()
32. 32 | P a g e
3 WEB2PY FRAMEWORK
4 1.1 INTRODUCTION TO WEB2PY
web2py was created by Massimo Di Pierrro in 2008. Since its debut it has got a lot of track in
the Python and web develpment community. Projects developed with web2py
include http://rockiger.com, http://www.globaleaks.org, http://www.tenthrow.com.
Why is web2py so great for you or an aspiring internet billionair like John. web2py is 100% open-
source and licensed under the LGPL, this means you are allowed to use, copy und distribute web2py
for free, you can view and change the code as you wish, as long as you redistribute it under the
GPLv2 license. There is one exception to this limitation: all applications developed with web2py can
distributed under any license - including closed-source and commercial license. This way John is
able to hide his secret tuker app.
Another great advantage is the ease of use of web2py. It get's you started in no time and helps you to
get things done. web2py stands on the shoulders of giants (like Python and incorporates new trends
in web development very fast. Nonetheless web2py has not broken backwards compatibility since it's
first release in 2008 - a major feature of web2py.
Finally web2py has a helpful und very enthusiastic community that answers question on the web2py
mailinglist very fast and provides free applications, plugins for web2py andrecipes to common
web2py problems at a high rate.
33. 33 | P a g e
WHAT IS WEB2PY?
Created by a community of professionals and University professors in Computer Science and
Software Engineering.
Always backward compatible. We have not broken backward compatibility since version 1.0 in
2007, and we pledge not to break it in the future.
Easy to run. It requires no installation and no configuration.
Runs on Windows, Mac, Unix/Linux, Google App Engine, Amazon EC2, and almost any web
hosting via Python 2.5/2.6/2.7, or Java with Jython.
Runs with Apache, Lighttpd, Cherokee and almost any other web server via CGI, FastCGI,
WSGI, mod_proxy, and/or mod_python. It can embed third party WSGI apps and middleware.
Talks to SQLite, PostgreSQL, MySQL, MSSQL, FireBird, Oracle, IBM DB2, Informix, Ingres,
and Google App Engine.
Secure It prevents the most common types of vulnerabilities including Cross Site Scripting,
Injection Flaws, and Malicious File Execution.
Enforces good Software Engineering practices (Model-View-Controller design, Server-side
form validation, postbacks) that make the code more readable, scalable, and maintainable.
Speaks multiple protocols HTML/XML, RSS/ATOM, RTF, PDF, JSON, AJAX, XML-RPC,
CSV, REST, WIKI, Flash/AMF, and Linked Data (RDF).
Includes an SSL-enabled and streaming-capable web server, a relational database, a web-
based integrated development environment and web-based management interface, a Database
Abstraction Layer that writes SQL for you in real time, internationalization support, multiple
authentication methods, role based access control, an error logging and ticketing system,
multiple caching methods for scalability, the jQuery library for AJAX and effects, and
a scaffolding application to jumpstart development.
The best way to understand web2pyis to tryit. You can try it online here (this online version is identical
to the actual web2py although some functions are disabled for security reasons).
web2py was inspired by Ruby on Rails and, as Rails, it focuses on rapid development and follows a
Model View Controller design. web2py differs from Rails because it is based on Python (thusit is faster
and more scalable), because it provides a comprehensive web-based administrative interface (thus
there is no need to ever type shell commands unless you wish), includes libraries to handle more
protocols (for example XML-RPC and RSS feeds), and can run on the Google App Engine.
web2py was also inspired by Django and, as Django,it has the ability to generate formsfrom database
tables and it includes an extensive set of validators. web2py differs from Django because it is more
compact, easier to learn and does not have any project-level configuration files.
34. 34 | P a g e
web2py is less verbose than Java-based frameworks and its syntax is much cleaner than PHP-based
frameworks. This makes applications simpler to develop, and easier to read and maintain.
Here is a features comparison of web2py vs other popular web frameworks.
web2py comes in source code version (for any Operating System that runs Python) and in binary
versions for OSX and Windows. web2py does not need to be installed. You unzip it, click on it, and
choose a one-time administrator password. It then opens the browser for you and directs you to the
administrative interface. Everything it needs to make this happen (the Python interpreter, the web -
server, the relational database, etc.) is already packaged with web2py. If you need more power you
customize your applicationsto use your preferred web-server (for example Apache) and your preferred
database engine (for example PostgreSQL or Oracle).
Via the admin interface you can upload a packed application, create a new application, design an
application, maintain an existing application, bytecode-compile an application, pack and download an
application. Everything can be done via the web-based admin interface, including editing the files that
comprise your applications, clearing temp files, browsing past tickets/errors,run tests,interact with the
database. If you so choose, it is also possible to interact with web2py via the Operating System shell
or the Python shell.
Any web2py application is comprised of Models (files that contain a description of the data
representation), Views (files that contain a description of the data presentation), Controllers (files that
contain a description of the business logic and workflow), Cron Jobs (tasks that need to be executed
regularly in background), Modules (collections of reusable classes and functions), and Static Files
(images, scripts, stylesheets, etc.).
Controllers consist of functions that are associated to a URL and are called when the associated URL
is visited. Models are executed before the function is called, independently on the visited URL (for
each app). Views are called when the function returns data other than a string, and renders the data
in the proper format (for example html).
A web2py application can be as simple as a single file (controllers/default.py) containing:
def index(): return "Hello World"
When http://localhost:8000/app/default/index is visited the function is called and it displays the
message "Hello World".
Here is a more complex complete application that lets the visitor upload images into a database:
In Model
1.
2.
3.
4.
db=DAL('sqlite://storage.db')
db.define_table('image',
Field('name', notnull=True),
Field('file','upload'))
35. 35 | P a g e
In Controller
1.
2.
3.
4.
5.
def index():
form = SQLFORM(db.image).process()
if form.accepted:
response.flash = 'image uploaded'
return locals()
In View
1.
2.
3.
{{extend 'layout.html'}}
<h1>Image upload form</h1>
{{=form}}
Uploaded images are safely renamed to avoid directory traversal vulnerabilities, stored on the
filesystem (or database) and a corresponding entry is inserted in the database, linking the file. A built-
in mechanism prevents involuntary double form submission. All DB IO is transaction safe by default.
Any exception in the code causes the transaction to rollback.
5 START YOUR ENGINES
To start download web2py from the download page and extracts the zip archive to your folder of
choice and open the web2py folder.
Now start web2py
on Windows double click on web2py.exe
on OS X double click on web2py.app
on Ubuntu (and any other Linux distro) double click on web2py.py and if there is an warning
message click on execute
36. 36 | P a g e
web2py shows you a splash screen and opens a little controll GUI, that asks you to choose an admin
password - then press "Start Server"
web2py opens your default web browser and you see the following screen
37. 37 | P a g e
Now click on Administrative interface, put your password in the form and submit.
38. 38 | P a g e
You then see admin interface: let's head over to the New simple application form and
insert first and click create.
After you created the application, you see the edit interface your first. It shows the: * the models *
the controllers * the views * the languages * the static files * the modules
39. 39 | P a g e
5.1.1 Say hello to the world
If you go to http://127.0.0.1:8000/first/default/index now you will see the welcome screen of
web2py again. "What. That's all?", you might say. web2py has created a new welcome app
for you - now let's customize it.
In the admin panel (http://127.0.0.1:8000/admin/default/design/first) click on the edit button left
beside "default.py" in the controllers section.
40. 40 | P a g e
Now you see the internal edit view of web2py, it show the default controller of our
application. Later we will use a real text editor to write code, but it's good to know, that you
can make quick changes via the admin interface.
Look out for:
1.return dict(message=T('Hello World'))
Change it to:
1.return dict(message=T('Hello World. I'm John. How are you?'))
Notic the Backslash () behind the I - this is important because Python uses ticks to
encapsulate Strings. Go on with clicking on the little disk symbol on the top or
pressing Ctrl + S.
41. 41 | P a g e
Let's look at our app. Go to http://127.0.0.1:8000/first/default/index. Notice the new headline.
Now let's go and edit the view: In the admin panel click on the edit button left beside the
"default/index.html" view. The same like with the controller you see the view now. Mind out
for:
1.<h1>{{=message}}</h1>
Here web2py renders our message from the controller, now look out for the Readme part
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
<h2>{{=T("Readme")}}</h2>
<ul>
<li>{{=T('Youare successfully running web2py')}}</li>
<li>{{=T('This is a copy of the scaffolding application')}}</li>
<li>{{=T('Youcan modify this application andadapt it to your needs')}}</li>
<li>{{=A(B(T("Administrative interface")),
_href=URL('admin','default','index'))}}</li>
<li>{{=A(T("Online examples"), _href=URL('examples','default','index'))}}</li>
<li><a href="http://web2py.com">web2py.com</a></li>
<li><a href="http://web2py.com/book">
{{=T('Documentation')}}</a></li>
</ul>
<ol>
<li>{{=T('Youvisited the url')}} {{=A(request.env.path_info,
_href=request.env.path_info)}}</li>
<li>{{=T('Which called the function')}} {{=A(request.function+'()',
_href='#')}} {{=T('locatedin the file')}}
{{=A('web2py/applications/%(application)s/controllers/
%(controller)s.py'%request,_href=URL('admin','default',
'peek', args=request.application,'controllers',
request.controller+'.py')))}}</li>
<li>{{=T('The output of the file is a dictionary that was rendered by the view')}}
{{=A('web2py/applications/%(application)s/views/%(controller)s/
index.html'%request,_href=URL('admin','default','peek',
args=(request.application,'views',request.controller,
'index.html')))}}</li>
</ol>
Delete everything from <ul> to </ol> then replace it with a text about John and his plans
to change the world:
1.
2.
3.
<h2>{{=T("Readme")}}</h2>
<p>Hi, I'm John. This is our first finger crunching on developing the
next killer website on the internet. Stay tuned for more information.</p>
Again save it and reload the page at http://127.0.0.1:8000/first/default/index.
6 DEPLOYING YOUR FIRST APP
Now with our great first app, it's time to deploy. This step is optional, but it's good practice to deploy
often, to check for problems early in the development process. There a many ways to deploy a
web2py app, at the moment my favorite is to use fluxflex.com. But you can use any web server with
Python installed and even use Google's App Engine. Look for the deployment recipies in the web2py
documentation.
42. 42 | P a g e
First we have to package first: Go to http://127.0.0.1:8000/admin/default/site (and eventually login),
click on Pack all in the first section, download the w2p-package.
Go to pythonanywhere.com, sign-up,
go to the Web tab, klick on the New Web2py App button, fill in your admin password and click on
the Next button. pythonanywhere creates your new project.
In the project overview click on Setup and on the Featured tab, search for web2py and clickInstall. It
takes a view seconds and web2py is installed. You can now click on the link at the top, to see your
installation.
43. 43 | P a g e
Now go to the website's admin interface
athttps://YOUR_USER_NAME.pythonanywhere.com/admin, notice the https - for security reasons
web2py doesn't let you log in without SSL-certification. Login with your admin password.
To install our first app, got to the Upload and install packed application section on the right side, give
your app a name (first), click the Choose File, select the w2p-file youdownloaded and click Install.
Tada, your first application is online, go tohttp://YOUR_USER_NAME.pythonanywhere.com to see
if everything looks alright - now you are done, your first website is online. John is proud of you.
7 ONE EDITOR TO RULE THEM ALL
A text editor is a program to write software source code. It is a bit like Word for computer
programms. There are plenty of great text editors and IDEs out there. For the sake of simplicity we
will use gedit. It works the same across all operating systems, has good Python and HTML support
(e.g. code highlighting) and it's easy to use.
44. 44 | P a g e
You can download gedit for Windows and OS X:
1. gedit for Windows
2. gedit for OS X
On Ubuntu (and most other Linux distros) gedit is already installed. If it is not installed use the
package manager of your distro to install it.
After Installation of gedit, go to Edit > Settings in the menu. In the View tab check all checkmarks;
in the Editor tab reduce tab width to 4 and again check all checkmarks; close the settings window.
45. 45 | P a g e
If you have choosen another editor or an IDE for your development work that is totally fine. But if
you are new to programming use gedit, it is a really powerful editor, that is easy to use.
7.1 INSTALLING PYTHON (OPTIONAL)
You don't need a Python installation to use web2py, but it helps if you want to use Python outside of
the web2py context.
Go to the download page on Python.org and download the newest Python 2.7.x installer for your
architecture (2.7.2 at the ti me of writing) and install it.
8 BROWSER WARS
As a browser we will use Firefox. For our purposes we will need the Firebug-Extension. Firebug
allows us to analyse webpages and inspect certain HTML elements.
Got to http://getfirebug.com an click the Install Firebug button, a few seconds later Firefox will
show you a warning, accept with Install Now.
You can toggle Firebug with F12 key. With Firebug you can now inspect the install button.
Press Ctrl-Shift-C and click the Install Firebug button. You should see this information about
the button:
the button is an a-Element (anker), that points to https://getfirebug.com/downloads
the styles of the button (color: #ffffff, etc.)
46. 46 | P a g e
Most other web browsers come with similar development tools build in, but no one measures up to
Firefox + Firebug in comfort and features.
There are several Firebug plugins for special web development purposes available, but for now the
basic setup is just fine.