I’m working on a new site for my church (rosemontbaptist.com) and after doing some work on another project with the Django framework I thought it would be the perfect tool for the site. I like Heroku also so I decided to follow through their tutorial for a Django web-app.
One of the requirements was to install the
django-toolbelt package. I was a little surprised at the difficulty of doing this on Debian, so I wanted to document it and leave it up in case someone else has the same difficulty.
Postresql Development Files
The first thing
pip complained about was:
Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'
I had already installed the postgresql server so this surprised me a bit but after searching through the packages I found the package they were looking for:
sudo aptitude install postgresql-server-dev-all
Python Development Files
This was particularly shocking. After I installed the postresql development files, I re-attempted my package installation and
pip complained again:
In file included from psycopg/psycopgmodule.c:27:0:
./psycopg/psycopg.h:30:20: fatal error: Python.h: No such file or directory
error: command 'i586-linux-gnu-gcc' failed with exit status 1
This had to be satisfied. I again searched the repository and sure enough, there are Python development packages as well!:
sudo aptitude install python3-dev python-dev
Because my Django installation was using Python 3 I went ahead and installed both for good measure–in case I ever switched my mind.
pip again and:
Successfully installed dj-database-url-0.3.0 dj-static-0.0.6 django-toolbelt-0.0.1 gunicorn-19.3.0 psycopg2-2.6 static3-0.6.0
Mission accomplished! Hopefully this will save someone a few minutes before they begin a Django project of their own.