Remove __future__ imports -- the future is here!
[mygpo.git] / INSTALL.md
blobf79d64e8d404124c559000818fe061a445343f36
1 Deployment instructions for mygpo
2 =================================
5 Dependencies
6 ------------
8 When no version number is indicated, it is advisable to install the current
9 development version from the repository.
11 * Python (>= 2.6) or PyPy (tested with 2.0 beta1)
12 * PostgreSQL
15 Basic setup
16 -----------
18 Here's how you start from scratch with a new mygpo install (assuming a
19 Ubuntu 12.04 x86 install, 'should work' with other versions/archs as well).
21 If you are on a Debian/Ubuntu system, do:
23     sudo apt-get install erlang git python-pip python-dev libevent-dev
25 For creating logo thumbnails, install libraries for the various image formats.
26 They are used by the pillow library.
28     sudo apt-get install libjpeg-dev zlib1g-dev libpng12-dev
30 Select a cozy place for the mygpo sources and clone it:
32     git clone git://github.com/gpodder/mygpo.git
33     cd mygpo
35 Now install additional dependencies locally (you could also use virtualenv or
36 some other fancy stuff):
38     pip install -r requirements.txt
40 That's it for the setup. Now to initialize the DB:
42     cd mygpo
43     python manage.py migrate
45 ..and here we go:
47     python manage.py runserver
49 Ok, so you need a user. This requires e-mails to be sent. If your machine is
50 configured to send e-mail, that should work out well. If not, you can use the
51 Django E-Mail File Backend to "send" mails to a local folder:
53     mkdir inbox
55 Now, edit mygpo/settings_prod.py (or create it) and add the following lines:
57     import os.path
59     EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
60     EMAIL_FILE_PATH = os.path.join(os.path.dirname(__file__), '..', 'inbox')
63 Accessing the dev server from other devices
64 -------------------------------------------
66 Sometimes you might want to access the server from another machine than
67 localhost. In that case, you have to pass an additional argument to the
68 runserver command of manage.py, like this:
70     python manage.py runserver 0.0.0.0:8000
72 Beware, though, that this will expose the web service to your all networks
73 that your machine is connected to. Apply common sense and ideally use only
74 on trusted networks.
77 Updating derived data
78 ---------------------
80 Certain data in the database is only calculated when you
81 run special commands. This is usually done regularly on
82 a production server using cron. You can also run these
83 commands regularly on your development machine:
85     cd mygpo
86     python manage.py update-categories
87     python manage.py update-toplist
88     python manage.py update-episode-toplist
90     python manage.py feed-downloader
91     python manage.py feed-downloader <feed-url> [...]
92     python manage.py feed-downloader --max <max-updates>
93     python manage.py feed-downloader --random --max <max-updates>
94     python manage.py feed-downloader --toplist --max <max-updates>
95     python manage.py feed-downloader --update-new --max <max-updates>
97 or to only do a dry run (this won't do any web requests for feeds):
99     python manage.py feed-downloader --list-only [other parameters]
102 Maintaining publisher relationships with user accounts
103 ------------------------------------------------------
105 To set a user as publisher for a given feed URL, use:
107     cd mygpo
108     python manage.py make-publisher <username> <feed-url> [...]
111 Settings
112 --------
114 Check the settings in mygpo/settings.py. If you want to change any settings,
115 add them to mygpo/settings_prod.py with the correct value. If you want to
116 avoid warning messages on startup, simply:
118     touch mygpo/settings_prod.py
122 Web-Server
123 ----------
125 Django comes with a development webservice which you can run from the mygpo
126 directory with
128     python manage.py runserver
130 If you want to run a production server, check out
132    https://docs.djangoproject.com/en/dev/howto/deployment/