About a three days ago I thought up of a very simple use case to tackle as a personal project: a URL "minifying", "shrinking" service. It so happened that my head was fresh-hot on web2py that I had been using for a work-related project. So, I took on the task to implement it as fast as I could -- given the natural time constraints that come with being a father of two rambunctious kids and a full-time job :) So, having which framework to use figured out, I moved to the next question: where to host it? AWS was a natural choice given that I've been using their services for about one-and-half year with very little problems. However, I thought I'd give GAE (Google App Engine) a try given than web2py has built-in GAE deployment (including database layer for their data store). But, as it turns out, GAE doesn't offer what's, in my opinion, very basic options (like providing/renting IP addresses and assigning it to an app so that one can have DNS A-records pointing to it), as well as lack of SSL for custom domains. So, after bumping my head against their wall, I went with AWS -- and yes, it was as easy as pie to setup: fire up the instance, associate elastic IP, point Route 53 to that address and presto! That out of the way, I tackled the code aspect. After, say, couple of hours I was done with that. About forty lines of python (although I'm sure hard-core pythonistas could compress it further through conventions and idioms) and a few tweaks to their routing it was all it took to have the whole service completed -- with error handling and all that jazz. Then came my least favorite part of the process: dealing with the presentation layer (i.e. HTML/CSS). Even though I'm using most of web2py's default layout and CSS, it was still rather annoying adding my own dash html/css to it. But that's done.
So without fanfare I present you RDZR: Yet Another URL ReDuZR. Which can be reached through http://rdzr.co (or its SSL flavor, if you prefer https://rdzr.co)
Technologies used: Python, Web2Py, SQLite, Apache + mod_wsgi + mod _ssl
Showing posts with label web2py. Show all posts
Showing posts with label web2py. Show all posts
Friday, March 23, 2012
Saturday, March 3, 2012
web2py: an MVC framework that will rock your socks
Living under the shadow of the venerable and much more famous Django (and outside the view of Rails' unwavering zealots), is an amazing MVC framework called web2py. Let me tell you why I find this framework to be absolutely great and why you should give it a try.
First: it's completely self-contained and self-dependent. All it requires to run is python (2.6+) installed in your computer.
Second: Documentation, documentation, documentation. Of all the MVC frameworks out there (including some that are much older and "mature"), I've never seen so much care and effort put into documentation as with web2py. The documentation is not just a collection of half-assed tutorials with a few code snippets here and there with some commentary and whatnot. No, web2py's documentation is actually a full-fledged and very well written book which you can read online or download and print via PDF. But don't be fooled thinking that just because it's a book that it will be a "slow" book or that it will be full of technical platitudes. On the contrary, its focus in the few chapters is to get you up and running fast without neglecting very useful technical side notes and leaving the thick of deep technical explanation for later chapters. The documentation leaves the likes of django's and rail' in the dust.
Third: Meta-admin interface included. That's right, if you thought django's "freebie" admin interface was rad, wait till you see web2py's. It's not just an app-specific admin panel (like django's), it's also a panel to admin all of your available apps their contents and settings. It's a really awesome feature, specially if you are developing/maintaining more than one web app.
Fourth: Built-in web-based IDE? Yes, web-based built-in IDE. When was the last time that, out of the box, you could have a rather complete web-based IDE to get your scaffolding, code generators, models and views and get you started with all the rest of your coding (Zen Conding included) with Rails --or django for that matter? Hmmm I'm guessing never. You could, theoretically, never have to run a shell command (other than to start the web2py driver app) to develop your app. I'd like to emphasize, it's not just a gimmick for "ooo's and ahhh's". It's a very powerful and time-saving tool.
Fifth: Adhering to standards and very well suited for RESTful apps. Classic and elegant /noun/verb (corresponding to controller/action) URLs makes app design straight forward.
Sixth: Built-ins. Web2py has an incredible collection of built-in widgets, forms, validators, types, and so forth. These are great for turn-key proof-of-concepts (or production-ready apps, if these do what you need).
Seventh: top-notch security. This is something the team who developed web2py worked hard to tackle. Web2py addresses OWASP's top ten security issues/vectors throughout their apps. That way you can focus on coding functionality and much less time worrying about the plethora of security risks web applications can have.
There's a lot more I could talk about, for instance its powerful database abstraction layer, it's intuitive templating engine , its form generators, its WSGI-compliance (which is almost a requirement to run in production environments), but I leave that as an exercise to the reader :)
First: it's completely self-contained and self-dependent. All it requires to run is python (2.6+) installed in your computer.
Second: Documentation, documentation, documentation. Of all the MVC frameworks out there (including some that are much older and "mature"), I've never seen so much care and effort put into documentation as with web2py. The documentation is not just a collection of half-assed tutorials with a few code snippets here and there with some commentary and whatnot. No, web2py's documentation is actually a full-fledged and very well written book which you can read online or download and print via PDF. But don't be fooled thinking that just because it's a book that it will be a "slow" book or that it will be full of technical platitudes. On the contrary, its focus in the few chapters is to get you up and running fast without neglecting very useful technical side notes and leaving the thick of deep technical explanation for later chapters. The documentation leaves the likes of django's and rail' in the dust.
Third: Meta-admin interface included. That's right, if you thought django's "freebie" admin interface was rad, wait till you see web2py's. It's not just an app-specific admin panel (like django's), it's also a panel to admin all of your available apps their contents and settings. It's a really awesome feature, specially if you are developing/maintaining more than one web app.
Fourth: Built-in web-based IDE? Yes, web-based built-in IDE. When was the last time that, out of the box, you could have a rather complete web-based IDE to get your scaffolding, code generators, models and views and get you started with all the rest of your coding (Zen Conding included) with Rails --or django for that matter? Hmmm I'm guessing never. You could, theoretically, never have to run a shell command (other than to start the web2py driver app) to develop your app. I'd like to emphasize, it's not just a gimmick for "ooo's and ahhh's". It's a very powerful and time-saving tool.
Fifth: Adhering to standards and very well suited for RESTful apps. Classic and elegant /noun/verb (corresponding to controller/action) URLs makes app design straight forward.
Sixth: Built-ins. Web2py has an incredible collection of built-in widgets, forms, validators, types, and so forth. These are great for turn-key proof-of-concepts (or production-ready apps, if these do what you need).
Seventh: top-notch security. This is something the team who developed web2py worked hard to tackle. Web2py addresses OWASP's top ten security issues/vectors throughout their apps. That way you can focus on coding functionality and much less time worrying about the plethora of security risks web applications can have.
There's a lot more I could talk about, for instance its powerful database abstraction layer, it's intuitive templating engine , its form generators, its WSGI-compliance (which is almost a requirement to run in production environments), but I leave that as an exercise to the reader :)
Subscribe to:
Posts (Atom)