Installing Markdown (Python)

I’m having some trouble getting Markdown installed for use in a Django app. Has anyone done this before? I downloaded the source from and attempted to install. I used python install --prefix=$HOME to no avail.

Any help would be great!


Well, I figured it out - thought I’d post my answer for the next guy trying to do the same thing*.

(I assume you already have Django up and running on your domain, and you have already added ‘django.contrib.markup’ to your INSTALLED_APPS and applied the filter to your template)

Follow the instructions to install virtualenv (here): wget tar xzf virtualenv-1.4.5.tar.gz python2.4 virtualenv-1.4.5/ $HOME/local

Then go ahead and install Markdown: easy_install Markdown

Check (via the command line) to make sure markdown installed. Start python and run: import markdown

Once you have everything configured cd into your domain directory and open up in your favorite editor.

Add these two lines under the second line:myPath = os.environ['HOME'] + '/lib/python2.5/site-packages/' sys.path.insert(0, myPath)

The file should look like this:import sys, os sys.path.append(os.getcwd()) myPath = os.environ['HOME'] + '/lib/python2.5/site-packages/' sys.path.insert(0, myPath) os.environ['DJANGO_SETTINGS_MODULE'] = "mysite.settings" import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()

Then open up your browser and everything should be ready to go.

  • If you follow these directions and something breaks - DH support won’t be able to help you. So make sure you’re prepared to troubleshoot.