File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff 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+
2836Create 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
7487See? No mistery. :)
7588
You can’t perform that action at this time.
0 commit comments