NOTE: These instructions are are work in progress as I rebuild my development machine (an aging Dual G5) after a crash-n-wipe-n-new-OS. March 2, 2008

These are the steps for installing DJ Edna on a MacOSX 10.5 (Leopard) machine. Also, keep in mind that a large TODO on my list is to simplify and improve the installation process, so I apologize in advance for the haphazard organic instructions. Check this page for updates (and hopefully improvements) to the installation process.

  1. Install MacPorts
  2. Install Python 2.5
    sudo port install python25
    
    and/or
    sudo port install py25-ipython
    
  3. Install PostrgeSQL 8.2
    sudo port install postgresql82-server
    
    1. Create a default database instance.
      sudo mkdir -p /opt/local/var/db/postgresql82/defaultdb
      sudo chown postgres:postgres /opt/local/var/db/postgresql82/defaultdb
      sudo su postgres -c '/opt/local/lib/postgresql82/bin/initdb -D /opt/local/var/db/postgresql82/defaultdb'
      
    2. OPTIONAL: Tweak your DBMS
      • Consider increasing kern.sysv.shmmax by adding an increased kern.sysv.shmmax .. to /etc/sysctl.conf
  4. Start PostgreSQL
    1. Issue the postgresql82 start command.
      sudo -u postgres /opt/local/lib/postgresql82/bin/postmaster -D /opt/local/var/db/postgresql82/defaultdb
      
      or, if you want to launch it in the background:
      sudo -u postgres /opt/local/lib/postgresql82/bin/pg_ctl -D /opt/local/var/db/postgresql82/defaultdb -l logfile start
      
    2. If you wish to have postgresql82 start automatically on startup:
      sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql82-server.plist
      
  5. Install psycopg2
    sudo port install py25-psycopg2
    
  6. Install wget
    sudo port install wget
    
  7. Install py-tagger
    wget http://media.liquidx.net/static/pytagger/pytagger-0.5.tar.bz2
    bunzip2 pytagger-0.5.tar.bz2
    tar xvf pytagger-0.5.tar
    cd pytagger-0.5
    sudo python2.5 setup.py install
    
  8. Install the Python Imaging Library
    sudo port install py25-pil
    
  9. Install Django
    • DJ Edna uses Django pre-0.97 (i.e. the development/trunk version) You can see Django's more detailed instructions here.
      mkdir ~/Development
      mkdir ~/Development/django
      cd ~/Development/django
      svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk
      sudo ln -s ~/Development/django/django-trunk/django /opt/local/lib/python2.5/site-packages/django
      sudo ln -s ~/Development/django/django-trunk/django/bin/django-admin.py /opt/local/bin
      
  10. Install Django Logging Support Application
    mkdir ~/Development/django/thirdparty
    mkdir ~/Development/django/thirdparty/django-logging-trunk
    cd ~/Development/django/thirdparty/django-logging-trunk
    svn co http://django-logging.googlecode.com/svn/trunk/djangologging
    
  11. Install Django Registration Support Application
    mkdir ~/Development/django/thirdparty/django-registration-trunk
    cd ~/Development/django/thirdparty/django-registration-trunk
    svn checkout http://django-registration.googlecode.com/svn/trunk/registration
    
  12. Install DJ Edna
    mkdir ~/Development/djedna
    cd ~/Development/djedna
    mkdir djedna-trunk
    cd djedna-trunk
    svn co http://djedna.org/svn/djedna/trunk/djedna
    
  13. Create DJ Edna Site Installation Directories
    • NOTE: Replace {INSTALL_NAME} with a name to identify this DJ Edna installation by (e.g. nomads_with_homes would be a good choice for a band called Nomads With Homes). Just make sure the new name follows python module naming conventions.
      sudo mkdir /opt/local/var/log/djedna
      sudo chmod 777 /opt/local/var/log/djedna
      mkdir ~/Development/djedna/djedna-local
      mkdir ~/Development/djedna/djedna-local/{INSTALL_NAME}
      cd ~/Development/djedna/djedna-local/{INSTALL_NAME}
      touch __init__.py
      mkdir config
      touch config/__init__.py
      mkdir templates file cover zip media log
      
  14. Create DJ Edna Database User
    sudo -u postgres /opt/local/lib/postgresql82/bin/createuser -d -R -S -P djedna
    
    Remember the password you choose. You'll need it later for the DJ Edna config file.
  15. Create DJ Edna Database
    sudo -u postgres /opt/local/lib/postgresql82/bin/createdb -E utf8 -O djedna {INSTALL_NAME}_db
    
  16. Configure DJ Edna Site Installation For Running With Django Development Server
    1. Copy the sample DJ Edna configuration file djedna/config/sample.py into your {INSTALL_NAME}/config directory and rename it dev.py. This will be the configuration we will use when running DJ Edna in the Django development server.
      cp ~/Development/djedna/djedna-trunk/djedna/config/sample.py ~/Development/djedna/djedna-local/{INSTALL_NAME}/config/dev.py
      
    2. Copy the sample logging configuration file djedna/config/logging_sample.py into your {INSTALL_NAME}/log directory and rename it dev.cfg.
      cp ~/Development/djedna/djedna-trunk/djedna/config/logging_sample.py ~/Development/djedna/djedna-local/{INSTALL_NAME}/log/dev.cfg
      
    3. Edit the new dev.py configuration file.
      1. Change the INSTALL_HOSTNAME setting to 'localhost:8000'
      2. Change the DATABASE_NAME setting to '{INSTALL_NAME}_db'
      3. Change the DATABASE_PASSWORD setting to the password you assigned the djedna database user.
      4. Change the TIME_ZONE setting to the time zone of your server. Possible values can be obtained by looking in the directory /opt/local/share/postgreql82/timezone/. The default is America/Chicago which maps to the file /opt/local/share/postgreql82/timezone/America/Chicago.
      5. Change the SECRET_KEY setting to a random string. It doesn't matter what it is really, as long as it's not easy to guess.
  17. Update PYTHONPATH
    1. Add the following line to your ~/.bash_profile file:
      export PYTHONPATH=~/Development/django/thirdparty/django-logging-trunk:~/Development/django/thirdparty/django-registration-trunk:~/Development/djedna/djedna-local:~/Development/djedna/djedna-trunk
      
    2. Reload ~/.bash_profile:
      . ~/.bash_profile
      
  18. Initialize The DJ Edna Database
    cd ~/Development/djedna/djedna-trunk/djedna/
    python2.5 manage.py syncdb --settings={INSTALL_NAME}.config.dev
    
    As part of the syncdb process you'll be asked if you want to create a user by selecting a username and password. This user will be your initial administrator account. You'll need that info to log in to your DJ Edna install.
  19. Run DJ Edna With The Django Development Server
    cd ~/Development/djedna/djedna-trunk/djedna
    python2.5 manage.py runserver localhost:8000 --settings={INSTALL_NAME}.config.dev
    
  20. Check That DJ Edna Is Running
    1. Browse to http://localhost:8000/ and you should get the DJ Edna home page with no errors (and no albums... yet).
  21. Install Apache2 (prefork MPM)
    sudo port install apache2 +preforkmpm
    sudo cp /opt/local/apache2/conf/httpd.conf.sample /opt/local/apache2/conf/httpd.conf
    
  22. Install mod_python 3.1.1
    1. Install mod_python
      sudo port install mod_python25
      
    2. Enable mod_python
      1. Add the following line to the bottom of the apache config file you created above (/opt/local/apache2/conf/httpd.conf):
        LoadModule python_module modules/mod_python.so
        
  23. Start Apache
    1. IMPORTANT: Don't forget to disable Apple’s default Web Sharing in the System Preferences.
    2. Issue the apache2 start command.
      sudo /opt/local/apache2/bin/apachectl -k start
      
    3. Browse to http://localhost/ and you should get the "It works!" message.
    4. If you wish to have apache2 start automatically on startup:
      sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
      
  24. Configure DJ Edna Site Installation For Running With Apache
    1. Copy the dev.py configuration file you created above into your {INSTALL_NAME}/config directory and rename it apache.py.
      cp ~/Development/djedna/djedna-local/{INSTALL_NAME}/config/dev.py ~/Development/djedna/djedna-local/{INSTALL_NAME}/config/apache.py
      
    2. Edit the new apache.py configuration file.
      1. Change the INSTALL_HOSTNAME setting with the actual hostname you plan on running your site under (i.e. 'nomadswithhomes.com')
  25. Configure Apache Virtual Host
    1. Create the virtual host config file.
    2. Insert the following text into the myband_vhost file:
    3. Activate the new config.
    4. Change file permissions.
    5. Restart apache.
      sudo /opt/local/apache2/bin/apachectl -k restart
      
  26. Check That DJ Edna Is Running
    1. Browse to http://{MYBAND_URL}/ and you should get the DJ Edna home page with no errors (and no albums... yet).
  27. Add Albums
    1. Go to town. See PopulateDb.