1 Deployment instructions for mygpo
2 =================================
8 When no version number is indicated, it is advisable to install the current
9 development version from the repository.
12 * [CouchDB](https://couchdb.apache.org/) (>= 1.2)
13 * [python-feedparser](https://github.com/kurtmckee/feedparser/)
14 * [python-dateutil](http://niemeyer.net/python-dateutil)
15 * [python-flup](http://trac.saddi.com/flup)
16 * [python-imaging](http://www.pythonware.com/products/pil/)
17 * [python-pybabel](http://babel.edgewall.org/)
18 * [python-gevent](http://www.gevent.org/)
19 * [couchdbkit](https://github.com/benoitc/couchdbkit)
20 * [Django](http://www.djangoproject.com/)
21 * [django-couchdb-utils](http://github.com/stefankoegl/django-couchdb-utils/)
22 * [pthon-markdown2](https://github.com/trentm/python-markdown2)
28 Here's how you start from scratch with a new mygpo install (assuming a
29 Ubuntu 12.04 x86 install, 'should work' with other versions/archs as well).
31 If you are on a Debian/Ubuntu system, do:
33 sudo apt-get install erlang python-feedparser python-dateutil python-flup \
34 python-imaging python-pybabel python-restkit \
37 sudo apt-get build-dep couchdb
39 [ install couchdb 1.2.0 from source ]
41 Select a cozy place for the mygpo sources and clone it:
43 git clone git://github.com/gpodder/mygpo.git
46 Now install additional dependencies locally (you could also use virtualenv or
47 some other fancy stuff, but for now, let's keeps things simple):
52 git clone https://github.com/benoitc/couchdbkit.git
53 mv couchdbkit couchdbkit-git
54 ln -s couchdbkit-git/couchdbkit
56 wget https://www.djangoproject.com/download/1.4/tarball/ -O Django-1.4.tar.gz
57 tar xvf Django-1.4.tar.gz
59 ln -s Django-1.4/django
61 git clone https://github.com/stefankoegl/django-couchdb-utils.git
62 ln -s django-couchdb-utils/django_couchdb_utils
64 That's it for the setup. Now to initialize the DB:
66 python manage.py sync_couchdb
67 python manage.py sync-design-docs
71 python manage.py runserver
73 Ok, so you need a user. This requires e-mails to be sent. If your machine is
74 configured to send e-mail, that should work out well. If not, you can use the
75 Django E-Mail File Backend to "send" mails to a local folder:
79 Now, edit mygpo/settings_prod.py (or create it) and add the following lines:
83 EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
84 EMAIL_FILE_PATH = os.path.join(os.path.dirname(__file__), '..', 'inbox')
87 Accessing the dev server from other devices
88 -------------------------------------------
90 Sometimes you might want to access the server from another machine than
91 localhost. In that case, you have to pass an additional argument to the
92 runserver command of manage.py, like this:
94 python manage.py runserver 0.0.0.0:8000
96 Beware, though, that this will expose the web service to your all networks
97 that your machine is connected to. Apply common sense and ideally use only
101 Installing database dumps (if you have any, that is)
102 ----------------------------------------------------
107 hg clone https://code.google.com/p/couchdb-python/
109 zcat /path/to/your.dump.gz | python couchdb/tools/load.py \
110 http://localhost:5984/mygpo
112 ..when you have created a dump like this:
114 python manage.py dump-sample --user=[username] | gzip > my.dump.gz
116 (where [username] is a specific user for which the data will be dumped)
118 Updating derived data
119 ---------------------
121 Certain data in the database is only calculated when you
122 run special commands. This is usually done regularly on
123 a production server using cron. You can also run these
124 commands regularly on your development machine:
127 python manage.py update-categories
128 python manage.py update-toplist
129 python manage.py update-episode-toplist
131 python manage.py feed-downloader
132 python manage.py feed-downloader <feed-url> [...]
133 python manage.py feed-downloader --max <max-updates>
134 python manage.py feed-downloader --random --max <max-updates>
135 python manage.py feed-downloader --toplist --max <max-updates>
136 python manage.py feed-downloader --update-new --max <max-updates>
138 or to only do a dry run (this won't do any web requests for feeds):
140 python manage.py feed-downloader --list-only [other parameters]
143 Maintaining publisher relationships with user accounts
144 ------------------------------------------------------
146 To set a user as publisher for a given feed URL, use:
149 python manage.py make-publisher <username> <feed-url> [...]
152 Resetting the database ("start from scratch")
153 ---------------------------------------------
157 curl -X DELETE http://127.0.0.1:5984/mygpo
158 curl -X DELETE http://127.0.0.1:5984/mygpo_sessions
160 Recreate the design documents:
163 python manage.py sync_couchdb
164 python manage.py sync-design-docs
167 Additional details on couchDB
168 -----------------------------
170 A source distribution of CouchDB can be obtained from
172 http://couchdb.apache.org/downloads.html
174 Build and installation instructions can be found at
176 http://wiki.apache.org/couchdb/Installation
178 Here are some rough instructions on how to build CouchDB 1.2.0 from source
179 and setting it up with a local user account:
181 (assuming you have downloaded and extracted the CouchDB 1.2.0 source)
182 sudo apt-get build-dep couchdb
183 export COUCHDB_HOME=~/pkg/apache-couchdb-1.2.0/
184 ./configure --prefix=$COUCHDB_HOME
185 make -j4 && make install
186 sudo useradd -d $COUCHDB_HOME/var/lib/couchdb couchdb
187 sudo chown -R couchdb: $COUCHDB_HOME
188 sudo chown -R root:couchdb $COUCHDB_HOME/etc/couchdb
189 sudo chmod 664 $COUCHDB_HOME/etc/couchdb/*.ini
190 sudo chmod 775 $COUCHDB_HOME/etc/couchdb/*.d
193 If you want to avoid installing a CouchDB server yourself, you can use a free
194 CouchDB hosting service, for example from
196 http://www.iriscouch.com/service
198 Please note, however, that hosted CouchDB services generally do not provide
199 security or authentication mechanisms, so this might only be useful for
202 If you don't use a local database, you need to update the COUCHDB_DATABASES
203 setting (see the "Settings" section below).
207 1. Initializing an empty Database
209 To create the database, execute the following on the commandline
211 curl -X PUT http://127.0.0.1:5984/mygpo
213 To initialize the views, execute from the mygpo directory
215 python manage.py sync_couchdb
220 To import a CouchDB dump, execute the following from the commandline
222 gunzip -c <dumpfile.couch.gz> | couchdb-load http://127.0.0.1:5984/mygpo
230 Check the settings in mygpo/settings.py. If you want to change any settings,
231 add them to mygpo/settings_prod.py with the correct value. If you want to
232 avoid warning messages on startup, simply:
234 touch mygpo/settings_prod.py
241 Django comes with a development webservice which you can run from the mygpo
244 python manage.py runserver
246 If you want to run a production server, check out
248 https://docs.djangoproject.com/en/dev/howto/deployment/