All posts tagged ‘python’

File Under: Programming

Video: Parsing Horrible Things with Python

The “horrible thing” in developer Erik Rose’s talk from this year’s PyCon is the Mediawiki syntax, but that’s just a jumping off point for one of the best overviews of data parsing that I’ve run across. If you’ve got a project that involves parsing, or are, like me, considering one, this talk is a must-watch.

This is PyCon, so much of the talk focuses on parsing in Python, but there’s plenty of broader, dare I say, “parsing philosophy” that make it well worth a watch even if you don’t end up using the specific Python parsing libraries Rose mentions.

File Under: Web Services

Amazon’s ‘Elastic Beanstalk,’ Now With Python Power

Elastic Beanstalk, making easier to get your Python apps to the cloud. Image: Karin Dalziel/Flickr.

Python developers, there’s a new way to get your apps running in the cloud — Amazon’s Elastic Beanstalk service now supports Python. Elastic Beanstalk previously supported PHP, Java and .NET apps.

The new Python support means that popular web frameworks like Django (which powers Instagram, Everyblock and other popular sites) are easier to deploy across Amazon’s suite of cloud services.

It also means that Amazon and Google App Engine are once again going head to head, this time over Google App Engine’s territory. Thanks to its Python-friendly environment, App Engine has been a favorite with Python developers looking to deploy apps on hosted services.

While it’s always been possible to host Python apps on Amazon, setting up and configuring apps can be a pain. That’s where Beanstalk comes in. For those who haven’t tried it, Elastic Beanstalk greatly simplifies the process of deploying your app to Amazon’s various cloud services, including setting up new EC2 instances, load balancing with Elastic Load Balancing, as well as scaling and managing your app after it’s deployed. Beanstalk also integrates with Git and virtualenv.

Originally Beanstalk had a distinctly Java bias to it, but since then it has expanded to handle Java, .NET and now Python as well. For more details on exactly how Beanstalk’s new Python support works, check out the Beanstalk overview page. Django developers should also read through Amazon’s guide to deploying a Django application to AWS Elastic Beanstalk.

File Under: APIs

Using the Twitter API

The microblogging site with the funny name is one of the hottest web services around.

Twitter is one of those websites with very little room for functional nuance. Its limit of 140 characters per post forces users to be succinct, something that makes many people feel over-constrained and leads them to view the service as too simple to actually be useful. Others see unbridled freedom inside such a unique limitation and embrace it like a poetic device. The lesson: You either get Twitter or you don’t.

Regardless of how you feel about it, if you’re looking to try out an API for the first time, Twitter is a great place to start.


Continue Reading “Using the Twitter API” »
File Under: Frameworks

Get Started With Django

Django is a web framework designed to help you build complex web applications simply and quickly. It’s written in the Python programming language.

Django takes it name from the early jazz guitarist Django Reinhardt, a gypsy savant who managed to play dazzling and electrifying runs on his instrument even though two of the fingers on his left hand were paralyzed in an accident when he was young.

Thus, it’s a fitting name for the framework: Django can do some very complex things with less code and a simpler execution than you’d expect. It doesn’t take a heavy hand to build with Django. The framework does the repetitive work for you, allowing you to get a working website up quickly and easily.


Continue Reading “Get Started With Django” »
File Under: Frameworks, Programming

Use URL Patterns and Views in Django

Last time around, we installed Django and started building a blog application. We got Django’s built-in admin system up and running and explored some third-party libraries like the django-tagging project.

So far we have some cool administrative tools, but no website for the rest of the world to see. This time around, we’ll work on displaying our content to the world by building the URL patterns and constructing some “views” — a term with a very specific meaning within the Django framework.

Everything we’re going to do will make more sense if you understand how Django processes your visitor’s request. We went over some of this in our introduction, but here’s a quick refresher course.

Continue Reading “Use URL Patterns and Views in Django” »