Files
postgres-web/docs/dev_install.rst
Magnus Hagander 8f0b7e6b50 Switch email sending go through a queue table in the database
Import the code from the PostgreSQL Europe website to handle this, since it's
well proven by now.

Any points that send email now just write them to the database using the
functions in queuedmail.util. This means we can now submit notification
emails and such things within transactions and have them properly roll bcak
if something goes wrong (so no more incorrect notifications when there is
a database error).

These emails are picked up by a cronjob that runs frequently (typically
once per minute or once every 2 minutes) that submits them to the local
mailserver. By doing it out of line, this gives us a much better way of
dealing with cases where mail delivery is really slow.

The submission from the cronjob is now done with smtp to localhost instead
of opening a pipe to the sendmail command - though this should have no
major effects on anything.

This also removes the setting SUPPRESS_NOTIFICATIONS, as no notifications
are actually ever sent unless the cronjob is run. On development systems
they will just go into the queuedmail table, and can be deleted from there.
2014-01-11 12:33:06 +01:00

64 lines
2.5 KiB
ReStructuredText

Development install
===================
So, you're ready to contribute to pgweb, and you want to set up a
local working copy of the website code, so you have something to work
with. Here's a quick step-by-step on how to do that:
#. Make sure you have downloaded and installed django *version 1.4*
You will also need the dependencies *psycopg2*, *yaml*
and *markdown* (these are python libraries, so prefix python- for Debian
packages, for example). There is a `requirements.txt` file available
for pip installs.
#. Make sure you have downloaded and installed PostgreSQL (tested only
with *version 9.0* and later, but doesn't use any advanced
functionality so it should work with other versions)
#. Create a database in your PostgreSQL installation called pgweb
(other names are of course possible, but that's the standard one)
#. Create a file called settings_local.py, located in the pgweb
directory (next to settings.py). This file will contain any settings
you override from the main settings one. Normally, you will want to
override the following::
DEBUG=True
TEMPLATE_DEBUG=DEBUG
SITE_ROOT="http://localhost:8000"
NO_HTTPS_REDIRECT=True
SESSION_COOKIE_SECURE=False
SESSION_COOKIE_DOMAIN=None
DATABASE_NAME="pgweb"
#. In the pgweb directory run the following command to create all
tables and indexes, as well as create a superuser for your local
installation::
./manage.py syncdb
#. A few functions are required, or at least recommended in order to
test all of the system. The SQL scripts in the directory sql/ needs
to be run in the database. Note that for a local dev install
without varnish frontends, you should use the *varnish_local.sql*
script, and not use the *varnish.sql* script.
#. To load some initial data for some tables (far from all at this
point), in the pgweb directory, run the following command::
./load_initial_data.sh
#. At this point, you're ready to get started. Start your local server
by running::
./manage.py runserver
#. Now load up the website by going to http://localhost:8000
Future improvements
-------------------
The plan is to make it possible to get a good snapshot of the actual
PostgreSQL website to do development work on, including parts from the
database. However, there are a number of privacy issues that need to
be figured out before we can do that (we don't want to put a
database-dump containing thousands of well confirmed email addresses
easily available for download, for example). Any suggestions on
exactly how to get this done are much appreciated.