File tree 1 file changed +15
-2
lines changed
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.
25
25
...
26
26
]
27
27
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
+
28
36
Create the necessary tables, like usual:
29
37
30
38
$ python manage.py syncdb
@@ -66,10 +74,15 @@ values on your code.
66
74
settings.FACEBOOK_APP_ID = '000000000000000'
67
75
68
76
# Retrieve the setting value from the database
69
- print(settings.FACEBOOK_ID )
77
+ print(settings.FACEBOOK_APP_ID )
70
78
71
79
# 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>
73
86
74
87
See? No mistery. :)
75
88
You can’t perform that action at this time.
0 commit comments