Skip to content

Commit 111fd30

Browse files
Evan MyllerEvan Myller
Evan Myller
authored and
Evan Myller
committed
Add info about our template context processor to the README file
1 parent 7428ce0 commit 111fd30

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ Django project's `INSTALLED_APPS` setting.
2525
...
2626
]
2727

28+
Also enable the SetMagic template context processor, if you want to use it on
29+
your templates, by adding it to the `TEMPLATE_CONTEXT_PROCESSORS` list:
30+
31+
TEMPLATE_CONTEXT_PROCESSORS = [
32+
...
33+
'setmagic.context_processors.load_setmagic',
34+
]
35+
2836
Create the necessary tables, like usual:
2937

3038
$ python manage.py syncdb
@@ -66,10 +74,15 @@ values on your code.
6674
settings.FACEBOOK_APP_ID = '000000000000000'
6775

6876
# Retrieve the setting value from the database
69-
print(settings.FACEBOOK_ID)
77+
print(settings.FACEBOOK_APP_ID)
7078

7179
# Deletes it from the database
72-
del settings.FACEBOOK_ID
80+
del settings.FACEBOOK_APP_ID
81+
82+
If you added the template context processor like described above, you can also
83+
use SetMagic values on your templates.
84+
85+
<p>My Facebook app ID is <code>{{ setmagic.FACEBOOK_APP_ID }}</code></p>
7386

7487
See? No mistery. :)
7588

0 commit comments

Comments
 (0)