Entradas

Django and web apps 101

Imagen
If you're getting started with Django or you're willing to do so, you might find this post useful. I'll try to cover the main aspects of the framework while keeping it as brief as possible. I believe the following diagram describes the basic aspects of Django's data flow pretty accurately. After covering the details of each node, I’ll describe what would be in my opinion the basic recommended background, as well as some basic aspects about web development. HttpRequest Django will construct an HttpRequest object containing the data of the http request received from the web server. You can access all the information received in the request through the object attributes, e.g. request.method will contain the http method used to send it. URLconfs URLconfs are Python files matching url patterns (regular expressions) with views, so they are pretty much “telling” Django to what view they should send an http request, depending on what was the requested URL. They can

Polls on steroids 01

This tutorial is an attempt to add some extra content to the original Django polls tutorial , explore additional features of the framework and even make the app look and respond better with some front-end tools on future chapters. It will be assumed that you’ve completed Django's official tutorial and you are already quite comfortable with Python. I’ll be using Python 3.3 and Django 1.6 under a Debian based OS. I’ll keep the code for this tutorial in this GitHub repository . The master branch contains the code of the original Django tutorial in almost the exact same state as if you’ve just completed it. The other branches are named with the format ‘XXPOS’, where XX is a two digit number indicating what part of the POS tutorial the code belongs to (so by the time you finish this first chapter, your code will look like the one contained on the 01POS branch). Notice that if you’re going to work with my GitHub repository, you’ll also get the sqlite3.db f