forked from qgis/QGIS-Django
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
170 lines (80 loc) · 3.43 KB
/
INSTALL
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
QGIS Django Project
This document describes the procedure for setting up the QGIS Django Project.
Tim Sutton 2010
------------------------------------------------------------------------
1. For the terminally lazy
2. Deploying a live site using wsgi
3. Updating the search indexes
4. Cache setup
5. Feedjack Update
------------------------------------------------------------------------
1. For the terminally lazy
==========================
For a readonly checkout do:
sudo apt-get install libldap2-dev libsasl2-dev python-gdal
git clone git@github.com:qgis/qgis-django.git
cd qgis-django
sudo easy_install virtualenv
virtualenv --no-site-packages python
source python/bin/activate
easy_install pip
pip install -r REQUIREMENTS.txt
Install some manual dependencies needed for django-snippets (make sure your
virtual env is active):
git clone https://github.com/coleifer/django-amazon-resources.git
cd django-amazon-resources/
python setup.py install
cd ..
Now install qgis snippets (a fork of django snippets)
git clone git@github.com:qgis/qgis-snippets.git
cd qgis-snippets
python setup.py install
cd ..
sudo apt-get install postgresql-8.4-postgis
Copy the settings template:
cd qgis
cp settings_local.py.templ settings_local.py
Then run the createdb script:
./createdb.sh
''Note:'' If you already have postgis installed in your template1 db,
just do the following command rather than running the createdb script:
createdb qgis-trunk
''Note:'' Remember to source the activate script to enabled the python
virtual environment:
source python/bin/activate
Modify settings_local.py to include the correct username and pwd for the
db connection.
cd qgis
python manage.py syncdb
Then run the project using the embedded test server:
python manage.py runserver
Then point your browser at:
http://localhost:8000
2. Deploying a live site using wsgi
===================================
cd /etc/apache/sites-available
sudo cp <path to qgis-django>/apache/apache.virtenv.conf.example qgis-django.conf
Now modify qgis-django.conf to your needs (making sure paths and web url are correct) then:
sudo a2ensite qgis-django.conf
sudo /etc/init.d/apache2 reload
3. Updating the search indexes
==============================
The haystack search indexes should be created after initial install:
python manage.py create_index
There after they should be updated regularly e.g. using a 5 min cron job:
python manage.py update_index
4. Cache setup
==============
We will use database based caching here (see http://docs.djangoproject.com/en/dev/topics/cache/ | django (caching)).
Make sure your virtual env is set up and then create a cache table:
python manage.py createcachetable cache_table
NOTE: The cache backend is required for the planet / feedjack to work properly
5. Feedjack Update
==================
The Blog Planet requires feedjack_update.py to run at regular intervals to keep
the site fresh. The update_planet.sh shell script sets up the environment and
runs feedjack_update.py.
The script requires you to set SITE_DIR to point at the Django site directory prior to first use.
The script must be run by a user that has permissions to the site directory.
To install as a cron, use the following (adjust the paths for your site):
*/2 * * * * /home/web/qgis-django/update_planet.sh 1>>/tmp/planet_update.log 2>>/tmp/planet_update.err