This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
# -*- coding: utf-8 -*- | |
""" | |
A real simple app for using webapp2 with auth and session. | |
It just covers the basics. Creating a user, login, logout and a decorator for protecting certain handlers. | |
PRE-REQUIREMENTS: | |
Set at secret_key in webapp2 config: |
Lately, I have been looking into Python CMSs. There are many out there, but for some reason or another Mezzanine stuck out as one I should try. Installing it is easy enough, but getting it up on running on my new favorite host, Heroku, was a bit of a challege.
Below you will find the steps that I took to get Mezzanine up and running on Heroku. Please let me know in the comments below if anything didn't work for you.
Heroku is shortly depricating Django's standard DATABASES
dictionary in favor for a package which takes OS Environment Variables and builds the required dictionary for you. This is a good thing because it makes setting up a database on Heroku very easy. The package is called dj_database_url
and it makes short work of getting a PostgreSQL database up and running with Mezzanine. Below is the code that you want to put in Mezzanine's DATABASES
section:
import dj_database_url
DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
I hereby claim:
To claim this, I am signing this object: