Source

django-server / README

Full commit
That's this?
============

This script configures linux machine to run django projects. You can use it
as template to develop your own installation script.

This script works with debian machine, it uses aptitude to install webserver,
database, python, gcc, virtualenv, pip, etc.

Webserver stack is nginx + uwsgi + django + postgres.


How to use it?
==============

1) Buy VPS. Get root SSH credentials. Setup RSA authorization::

    ssh-copy-id root@your-server

2) Log in as root

3) Download the script:

    wget --no-check-certificate -O ~/install.sh http://bitbucket.org/lorien/django-server/raw/tip/install.sh

4) Update /etc/apt/sources.list:
 * Add wheezy (testing) repository
 * Update security.debian.org line to use wheeze repo
 * Add mongodb repo.
 * Remove backports repository if it exists (becase we already use testing repo)

Your sources.list should looks like:

    deb     http://mirror.hetzner.de/debian/packages squeeze main contrib non-free
    deb     http://mirror.hetzner.de/debian/packages wheezy main contrib non-free
    deb     http://security.debian.org/  wheezy/updates  main contrib non-free

    deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen


To speed up things choose debian repo mirror which is close
to your geo location.

5) Update /etc/apt/preferences.d/01custom:

    Explanation: see http://www.argon.org/~roderick/apt-pinning.html
    Package: *
    Pin: release o=Debian,a=stable
    Pin-Priority: 500

    Package: *
    Pin: release o=Debian,a=testing
    Pin-Priority: 901

    Package: *
    Pin: release o=Debian,a=unstable
    Pin-Priority: 300

    Package: *
    Pin: release o=Debian
    Pin-Priority: -1

6) Run the script:

    $ bash ~/install.sh

During executing you'll need to answer aptitude questions how to resolve
package version issues.

That's all. Of course, you can and should adapt script for you taste.


Documentation?
==============

The script is self-documented, being the simple shell script.

Some extra comments in russian could be found here:
 * http://habrahabr.ru/blogs/django/120363/


Feedback?
=========

Create ticket on http://bitbucket.org/lorien/django-server/issues
or drop mail to lorien@lorien.name