Entradas

Mostrando entradas de abril, 2014

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