| | 369 | Writing your own context processors |
|---|
| | 370 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| | 371 | |
|---|
| | 372 | A context processor has a very simple interface: It's just a Python function |
|---|
| | 373 | that takes one argument, an ``HttpRequest`` object, and returns a dictionary |
|---|
| | 374 | that gets added to the template context. Each context processor *must* return |
|---|
| | 375 | a dictionary. |
|---|
| | 376 | |
|---|
| | 377 | Custom context processors can live anywhere in your code base. All Django cares |
|---|
| | 378 | about is that your custom context processors are pointed-to by your |
|---|
| | 379 | ``TEMPLATE_CONTEXT_PROCESSORS`` setting. |
|---|
| | 380 | |
|---|