Make sure that:
We happen to think our template engine is the best thing since chunky bacon, but we recognize that choosing a template language runs close to religion. There’s nothing about Django that requires using the template language, so if you’re attached to ZPT, Cheetah, or whatever, feel free to use those.
Nope. Just like the template system, the model/database layer is decoupled from the rest of the framework.
The one exception is: If you use a different database library, you won’t get to use Django’s automatically-generated admin site. That app is coupled to the Django database layer.
Using a FileField or an ImageField in a model takes a few steps:
Dans votre fichier de réglages, vous devez indiquer dans MEDIA_ROOT le chemin d’accès absolu vers un répertoire où Django enregistrera les fichiers téléversés (pour des raisons de performance, ces fichiers ne sont pas stockés en base de données). Indiquez dans MEDIA_URL l’URL publique de base correspondant à ce répertoire. Assurez vous que ce répertoire est accessible en écriture par l’utilisateur du serveur Web.
Sometimes your templates just all need the same thing. A common example would be dynamically-generated menus. At first glance, it seems logical to simply add a common dictionary to the template context.
The correct solution is to use a RequestContext. Details on how to do this are here: Subclassing Context: RequestContext.
Jan 13, 2016