forked from saschwarz/django-stw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathINSTALL.txt
More file actions
56 lines (40 loc) · 1.76 KB
/
Copy pathINSTALL.txt
File metadata and controls
56 lines (40 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Installation:
Using easy_install:
easy_install django-stw
Using pip:
pip install django-stw
If you checked out from github:
python setup.py install
Configuration:
1. Add 'stw' to your INSTALLED_APPS tuple.
2. Define a SHRINK_THE_WEB dict in settings.py:
SHRINK_THE_WEB = {
'stwaccesskeyid' : 'your STW access key id' - required',
'stwu' : 'your STW secret - only required by STW for PRO features',
}
where the dict keys match parameter names in the STW documentation:
http://www.shrinktheweb.com/content/shrinktheweb-pagepix-documentation.html
If you want to have the same settings for either tag on a site wide
basis you can specify additional STW URL parameters and values
in the settings.SHRINK_THE_WEB_DEFAULTS dictionary. Individual
template tags can then override the default values.
i.e.
SHRINK_THE_WEB = {
'stwaccesskeyid' : 'your STW access key id' - required',
'stwu' : 'your STW secret - only required by STW for PRO features',
'stwdelay' : 10, # wait 10 sec for page to load before STW captures image
'stwsize' : 'xlrg', # default to xlrg image size
}
then this template tag shortens the delay to 5 sec and adds the stwinside parameter,
the stwsize is taken from the defaults: 'xlrg':
{% stwimage "http://example.com/internalpage.html" "The author website" "stwdelay=5 stwinside=1" %}
Example Site:
The template directory contains a sample template that demonstrates more uses.
Make sure TEMPLATE_LOADERS contains:
'django.template.loaders.app_directories.load_template_source'
Add the template to your project's urls.py:
urlpatterns = patterns('',
(r'^stw/', include('stw.urls')),
# the rest of your urls
)
Start django server and go to http://localhost:8000/stw/ to view the page