Ticket #8704: request_context_global.diff

File request_context_global.diff, 871 bytes (added by programmerq, 6 years ago)

Added entry to the FAQ

  • docs/faq/usage.txt

    diff --git a/docs/faq/usage.txt b/docs/faq/usage.txt
    index 6e1f0da..49f4290 100644
    a b Using a :class:`~django.db.models.FileField` or an 
    6666       Django. For example, if your :class:`~django.db.models.ImageField` is
    6767       called ``mug_shot``, you can get the absolute URL to your image in a
    6868       template with ``{{ object.mug_shot.url }}``.
     69
     70How do I make a variable available to all my templates?
     71-------------------------------------------------------
     72
     73Sometimes your templates just all need the same thing. A common example would
     74be dynamically-generated menus. At first glance, it seems logical to simply
     75add a common dictionary to the template context.
     76
     77The correct solution is to use a ``RequestContext``. Details on how to do this
     78are here: :ref:`subclassing-context-requestcontext`.
Back to Top