Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add some initial installation instructions

  • Loading branch information...
commit 0dc3dc9f13a4353259eabd21f2c6a4528e54c8e7 1 parent a30667d
Raphaël Hertzog authored

Showing 1 changed file with 69 additions and 0 deletions. Show diff stats Hide diff stats

  1. +69 0 INSTALL
69 INSTALL
... ... @@ -0,0 +1,69 @@
  1 +Requirements
  2 +------------
  3 +
  4 +* Django (>= 1.4.1)
  5 +* South
  6 +* py-bcrypt
  7 +* The Python Imaging Library (PIL)
  8 +* feedparser
  9 +* django-debug-toolbar
  10 +* psycopg (>= 2) (for production setup with PostgreSQL)
  11 +* python-memcached + memcached (for production setup)
  12 +
  13 +Which can be summed up as this apt-get invocation:
  14 +$ apt-get install python-django python-django-south python-bcrypt \
  15 + python-imaging python-psycopg2 python-feedparser \
  16 + python-memcache python-django-debug-toolbar
  17 +
  18 +Running from the git checkout
  19 +-----------------------------
  20 +For quick tries, you can run the Django project directly from sources:
  21 +$ cd src/librement
  22 +$ ./manage.py syncdb --noinput --migrate
  23 +[…]
  24 +$ ./manage.py runserver
  25 +
  26 +Installing and running it on a server
  27 +-------------------------------------
  28 +To run it on a real server, I recommend you to install it as a Debian
  29 +package.
  30 +
  31 +$ dpkg-buildpackage -us -uc
  32 +$ sudo dpkg -i ../librement_<version>_all.deb
  33 +$ sudo apt-get -f install
  34 +
  35 +The production setup uses Postgresql and a librement account which owns the
  36 +librement database:
  37 +$ sudo adduser --system librement --group
  38 +$ sudo postgres createdb -O librement librement
  39 +$ sudo sh -c 'echo "local librement librement peer" >>/etc/postgresql/9.1/main/pg_hba.conf'
  40 +$ sudo service postgresql reload
  41 +
  42 +$ cd /usr/share/librement/librement
  43 +$ sudo -u librement ./manage.py syncdb --noinput --migrate
  44 +
  45 +TODO: document the apache/gunicorn/nginx setup
  46 +
  47 +Creating a superuser
  48 +--------------------
  49 +
  50 +You should register your first user through the website and then give
  51 +it admin right (and note its username at the same time):
  52 +
  53 + $ ./manage.py shell
  54 + […]
  55 + >>> from django.contrib.auth.models import User
  56 + >>> user = User.objects.get(pk=1)
  57 + >>> user.is_superuser = True
  58 + >>> user.is_staff = True
  59 + >>> user.save()
  60 + >>> user.username
  61 + u'raphaelhertzog'
  62 + >>> ^D
  63 +
  64 +or
  65 +
  66 + $ ./manage.py dbshell
  67 + […]
  68 + > UPDATE auth_user SET is_superuser = 1, is_staff = 1 WHERE id = 1;
  69 + > ^D

0 comments on commit 0dc3dc9

Please sign in to comment.
Something went wrong with that request. Please try again.