background preloader

Django

Facebook Twitter

Tomchristie/django-auto-api. Django database migration tool: south, explained. If you are using Django for production level application, you will need to use south.

Django database migration tool: south, explained

Requirement changes, and therefore your data model will change over time. South is a great tool, but it is complicated. You do not want to make a mistake when migrating an application in production. This is a detail look at how it interacts with your application so that you can understand and use it better. South interacts (reads and writes) with four different items in an application. Models.py — South reads this to determine your current data model.migrations/*.py — South creates a sub directory inside your app, and creates for you a migration file for each database migration generation.

Different commands in south interacts with these items differently: Let is start with a normal database schema migration, from generation N to generation N+1. 1. This diagram shows what are the inputs and outputs to each step. Let’s add the very first step when using south on a new applicatoin. 1. 1. 1. Diagram: Pennersr/django-allauth - GitHub. Django-mediafiles. Django Pluggables Beta. Index — Django Design Patterns. Built-in template tags and filters. This document describes Django’s built-in template tags and filters.

Built-in template tags and filters

It is recommended that you use the automatic documentation, if available, as this will also include documentation for any custom tags or filters installed. Built-in tag reference autoescape Controls the current auto-escaping behavior. This tag takes either on or off as an argument and that determines whether auto-escaping is in effect inside the block.

When auto-escaping is in effect, all variable content has HTML escaping applied to it before placing the result into the output (but after any filters have been applied). The only exceptions are variables that are already marked as “safe” from escaping, either by the code that populated the variable, or because it has had the safe or escape filters applied. Sample usage: {% autoescape on %} {{ body }}{% endautoescape %} block Defines a block that can be overridden by child templates. Cycle Produces one of its arguments each time this tag is encountered. Would output: debug filter. The Web framework for perfectionists with deadlines. Adjax. Adjax is Ajax for Django Adjax is a small framework to streamline the building of ajax-based sites using the Django web development framework .

The library can be used: in Django views to explicitly update html elements, display messages. in Django templates to mark values as being updatable in unobtrusive Javascript to turn links and forms into ajax request triggers The gory details Adjax looks to keep the development of common ajax tasks more organised and clean. Adjax's mostly attainable goals are: Help developers Don't Repeat Themselves Provide a straightforward, consistent predictable API Automate as much as possible Graceful degredation, full functionality without javascript Allow developers to define program functionality completely within the view Allow developers to easily install completely customised HTML/CSS/javascript Allow developers to use different javascript frameworks (ie other than jQuery) Have a look at the API to see if it implements these goals, and is useful for you.