When I deploy the project to production server (Apache/mod_wsgi), there's an internal server error (see log below). If I remove the load markup line and the one markdown filter I used in one of my templates, everything's working again. I double checked I have markdown installed (otherwise it gives a different error).

Update: after much trial-and-error probing, I narrowed the problem to import markdown -- as long as this line is executed server will produce 500 error. Not sure why, and I switched to markdown2 which seems like a good enough substitute and it worked.