Django on Gentoo (DoG) Image (Eminent)

items>Django on Gentoo (DoG) Image (Eminent)
Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

Django on Gentoo (DoG) Linux image. This is built on the base Gentoo image that I posted about previously. I added a whole bunch of goodness to run Django. Included are a whole set of startup scripts that build up the system and initialize the application. Although this is a long post, please be sure to read the Special Instructions if you want to get maximum benefit from this image.


Submitted By: Trier Family
US East AMI ID: ami-29947140
AMI Manifest: eminent-ami/django/10/image.manifest.xml
Operating System: Other
Created On: June 2, 2007 2:40 AM GMT
Last Updated: January 3, 2009 11:31 PM GMT

About this AMI

  • Published by Eminent Consulting Group ([]).
  • Django on Gentoo (DoG) Linux System
  • This image contains a Gentoo Linux 2007.0 installation with Django application support.
  • Gentoo Linux
    • dhcpcd,
    • logrotate,
    • all packages are recent and updated,
    • AMI tools have been installed and are fully working even for volume imaging,
    • EC2 meta-data is fetched from into /var/spool/ec2/meta-data,
    • EC2 meta-data and user-data include files in /var/spool/ec2/meta-data and /var/spool/ec2/user-data respectively,
    • Disabled password authentication in /etc/ssh/sshd_config
    • Modifications to startup according to Amazon documentation
    • the portage tree has been bind-mounted to /mnt/usr/portage to preserve space on the root file system,
    • the /tmp directory has been bind-mounted to /mnt/tmp to preserve space,
    • the /var/lib/postgresql directory has been bind-mounted to /mnt/var/lib/postgresql,
    • the root home directory contains a dev-copy directory that is needed to build the volume images,
    • all packages have been recompiled to correctly respect the Xen environment.
  • Django
    • Apache 2.2.4 installed (not in startup) and configured with Python support,
    • Python 2.5.1,
    • mod_python,
    • Postgresql 8.2.4 (not in startup),
    • psycopg2
    • Subversion 1.4.3 (no repositories are setup)
    • Django trunk version checked out into /home/django/django and installed as normal into the Python site-packages directory ( copied to /usr/local/bin/),
    • Support packages: libjpgeg, zlib, freetype2, zip, and unzip,
    • Python packages: PIL 1.1.6, FeedParser 4.1, Markdown 1.6, Unipath 0.1,
  • This image contains the following daemons / services:
    • local
    • net.eth0 / net.eth1
    • netmount
    • dhcpcd
    • sshd
    • syslog-ng
    • vixie-cron
    • apache 2 (disabled by default)
    • postgresql (disabled by default)

Special Instructions

Sample Application

The instance can accept a set of user data parameters for setting up an application. I've provided a default application to indicate the process for creating your own application setup scripts. If you run the instance with the following parameters it will startup a complete running default application based on the Django Vote tutorial.

ec2-run-instances ami-29947140 -k gsg-keypair -d "app=mysite-setup&url="

Once the server is up and running you should be able to to enter the public hostname (starts with ec2) into your browser and view the application. The Admin section of the application is in the location /admin. Credentials are:

Username: admin
Password: password

The default application will be installed into the /home/django/mysite directory. The setup scripts for the application will get installed into /opt/mysite-setup. The Admin media directory and the mysite media directory are both symbolically linked to the /var/www/mysite/htdocs directory.

Postgresql Configuration

Postgresql is installed but there is no database setup and the service is not started by default. The database directory /var/lib/postgresql is bind mounted to /mnt/var/lib/postgresql. The configuration files have been configured according to the Gentoo Postgresql How-To ( document with the included logging changes. Configuration files are symbolically linked in from /etc/postgresql for those that like that sort of thing. A sample of creating and restoring the database can be found in the mysite-setup scripts for the Sample Application. Write Ahead Logging (WAL) is not implemented, but would be necessary implementation detail for most sites.

Creating an Application Setup Package

The mysite-setup package ( is the base requirements for your own application setup package. At a minimum you are required to have a bin directory with a file in it called Within the script you are free to put any setup instructions you need or pass those tasks off to other scripts written in the language of your choice.

Currently the configuration of this image requires that the application setup package is publicly available and downloadable via curl (see the script). I plan to add security implementation details in the future.

What's New?

The following changes were made on 2007-06-01.
  • Initial release


Grateful thanks to Geert Bevin for his initial Gentoo image.

Special thanks to RightScale for ideas and guidance provided by their startup scripts


th AMI doesn't start correclty
Hi Ttrier family, I like very much the ami you build. I try to use it following your special instruction but when i run ec2-run-instances command i get an error about the "url" that is not a valid command (-d "app=mysite-setup&url=http://s3...) so ehrn the instance start django doesn't work. Sny ideas ? or there is another way to build django ? thanx in advance
sinedita on September 5, 2007 7:44 AM GMT
We are temporarily not accepting new comments.
©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved.