I was asked just now how my got the Twitter Stream working in my new Camel based project and how I managed the credentials.
The Twitter endpoint works like a dream and this is essentially what my code looks like. All you need is a secrets.properties file in alongside your java file.
Friday, 23 November 2012
Saturday, 17 November 2012
Apache Camel - Connection Beans Without Spring
While writing some tests for an Apache Camel project, I just spent rather longer than I'd have liked trying to work out how to configure a connection bean for Mongo without using Spring.
Since I hide my embarrassments in public I thought I'd best share with anyone else with brain freeze.
Don't forget you need the camel-mongodb artifact in your pom.xml file. Good luck fellow travellers.
Since I hide my embarrassments in public I thought I'd best share with anyone else with brain freeze.
Don't forget you need the camel-mongodb artifact in your pom.xml file. Good luck fellow travellers.
Monday, 5 November 2012
Python Web Microframeworks - Take Your Pick
You may read my post "Top Python Web Frameworks - Today" in which I took a fresh look at what which Python Web Frameworks were still around and still maintained.
In this post I give a quick overview of about half of those which I have loosely designated as "Microframeworks" - regardless of what the authors have called them. Wikipedia doesn't have a definition for microframework - I just looked - so what I really mean here is anything which let's you get started without having to learn a whole bunch of syntax and convention. Right on sister!
Let's get going:
Now that's done a little code from each -
In this post I give a quick overview of about half of those which I have loosely designated as "Microframeworks" - regardless of what the authors have called them. Wikipedia doesn't have a definition for microframework - I just looked - so what I really mean here is anything which let's you get started without having to learn a whole bunch of syntax and convention. Right on sister!
Let's get going:
Now that's done a little code from each -
Bottle (v0.11.13)
Bottle doesn't rely on any other packages at all, which means it's a great framework to use if you want to see all the working parts as they're all in the one file. That being said it can offer client-side sessions and compression and even WebSockets straight out of the box so it's not just a toy by any means.
Flask is dependent on Werkzeug for all the WSGI stuff and upon Jinja2 as a template library. It comes with client-side sessions, a built in debugger and is totally unicode friendly. I love Flask and use it often as my other posts will testify.
The first of the new boys, kiss.py is certainly not package independent! It requires Werkzeug for WSGI, requests for http, Beaker for sessions, Elixir and SQLAlchemy for an ORM (PostgreSQL, MySQL and SQLite), Jinja2 for templates, gevent, pev and greenlet for events as well as compressinja, jsmin, jsonpickle, putils and pyScss which add various other niceties. Almost all well known and trusted libraries.
Again, web.py doesn't rely on any other packages at all, but to me it's not as useful as flask or kiss.py and not as simple to study as bottle, so I can't see the point, although according to the site, it's well used by others.
pip installs wheezy.web, wheezy.core, wheezy.caching, wheezy.html, wheezy.http, wheezy.routing, wheezy.security, wheezy.validation which to me looks like the developers have taken a sensible approach to the development cycle by splitting everything up into independent code units.
According to the site, functionality includes routing, model update/validation, authentication/authorization,content caching with dependency, xsrf/resubmission protection, AJAX+JSON, i18n (gettext), middlewares, and more.
Goo luck fellow traveller.
Flask (v0.9)
Flask is dependent on Werkzeug for all the WSGI stuff and upon Jinja2 as a template library. It comes with client-side sessions, a built in debugger and is totally unicode friendly. I love Flask and use it often as my other posts will testify.
kiss.py (v0.4.9)
The first of the new boys, kiss.py is certainly not package independent! It requires Werkzeug for WSGI, requests for http, Beaker for sessions, Elixir and SQLAlchemy for an ORM (PostgreSQL, MySQL and SQLite), Jinja2 for templates, gevent, pev and greenlet for events as well as compressinja, jsmin, jsonpickle, putils and pyScss which add various other niceties. Almost all well known and trusted libraries.
web.py (v0.37)
Again, web.py doesn't rely on any other packages at all, but to me it's not as useful as flask or kiss.py and not as simple to study as bottle, so I can't see the point, although according to the site, it's well used by others.
wheezy.web (v0.1.307)
pip installs wheezy.web, wheezy.core, wheezy.caching, wheezy.html, wheezy.http, wheezy.routing, wheezy.security, wheezy.validation which to me looks like the developers have taken a sensible approach to the development cycle by splitting everything up into independent code units.
According to the site, functionality includes routing, model update/validation, authentication/authorization,content caching with dependency, xsrf/resubmission protection, AJAX+JSON, i18n (gettext), middlewares, and more.
In Summary
No I haven't tested them to death and no I haven't even tried out kiss.py and wheezy.web in a real world app, although I will do. I certainly have not done either load or concurrency testing on them. You can do that and I'll read your blog.Goo luck fellow traveller.
Labels:
Flask,
Microframeworks,
Python,
Web application framework,
Web Design and Development,
web.py,
Web2py,
wheezy.web
Friday, 2 November 2012
CoffeeScript Love: Backbone.js Tutorials in CoffeeScript
Ahhhh enjoy the aroma, inhale the caffeine. If you're looking for a nice list of Backbone tutorials that use CoffeeScript then look no more - CoffeeScript Love: Backbone.js Tutorials in CoffeeScript.
Thursday, 1 November 2012
Top Python Web Frameworks - Today
example of Python language (Photo credit: Wikipedia) |
In my previous post "My Top Ten Python Web Frameworks" from about 18months ago, I gave you my opinion of what was hot, or not, at that time. Some of those seem to have stalled now - Tipfy, GAE framework, Weblayer; while others have appeared or matured - kiss.py, web.py, wheezy.web.
Below is an alphabetic list of the active (updated this year) which I know about. There may be others out there, so please let me know in the comments at the bottom.
- Bottle now on v0.11
- CubicWeb now on v3.15.5
- Django now on v1.4
- Flask now on v0.9
- kiss.py now on v0.4.9
- Nagare now on v0.4.1
- Pyramid now on v1.3
- TurboGears now on v2.2.0
- web.py now on v0.37
- web2py now on v2.2.1
- wheezy.web now on v0.1
In my next few posts I'll be giving you a run down of what state each of them is in and try to give you some idea of how they fit your requirements.
Good luck fellow traveller.
Labels:
AJAX,
CubicWeb,
Django,
Flask,
Python,
Python Web Frameworks,
TurboGears,
Web service,
web.py
Subscribe to:
Posts (Atom)