django a custom processor context processor function 200 318

Here Insert Picture Description

Context processor arrangement position

Here Insert Picture Description

The definition file for a processing context

Here Insert Picture Description

Write code

Here Insert Picture Description
It defines a view function

Returns a dictionary

Processor configuration context

Here Insert Picture Description

应用名.文件名.视图函数名

The effect of

Normal view in some of the original do gymnastics

If the context of the process

It can be commented out

Here Insert Picture Description

note

Context processor must return a dictionary

Published 298 original articles · won praise 1 · views 4009

Guess you like

Origin blog.csdn.net/whalecode/article/details/104961795