hemp is a fast a minimalistic blog engine. It's written in Python, using Tornado, MongoEngine, Buildout, and Supervisor.
The starting point for hemp was Tornado's demo blog engine. A few methods are still present, and a lot has been added and/or compartmentalized for ease of deployment and extensibility.
It's pretty easy to try hemp, it's all ready to run. Just execute those commands:
$ python bootstrap.py
$ bin/buildout
$ bin/development
All you have to do next is open up your browser to http://localhost:5000/. If your mongo server is not localhost, you'll have to change it in hemp/settings/development.py
.
python bootstrap
is going to download and install anything that buildout will need to run. Don't worry, you don't need to be root: everything stays in the project directory.bin/buildout
is going to readbuildout.cfg
to install dependencies and create binaries inbin/
bin/development
is going to load the development settings (fromhemp/settings/development.py
) and run tornado.
The default behavior is that the first person that opens the compose
page will be required to sign in (via google auth), a user account will be created for him, and he can post. Subsequent attempts will not create an account.
The blog posts should be written in markdown.
I recommend either forking or creating a new repository that contains everything from this one. After that, do whatever the hell you want!
If you rename the main hemp
directory, make sure you update buildout.cfg
, production.cfg
, and setup.py
.
$ python bootstrap.py
$ bin/buildout -c production.cfg
$ bin/supervisord
$ bin/supervisorctl status
The recommended deployment method for Tornado is to run it directly, and use nginx or apache as a proxy and static file server. Running a python process on its own is kind of scary, so the buildout configuration in production.cfg
will download and configure supervisor, so that it will make sure tornado is restarted if it ever crashes.
Once it's installed, you can run bin/supervisord
to start its daemon, and then bin/supervisorctl
to control the processes. For example bin/supervisorctl restart all
will restart all tornado instances. Pretty useful when you've just updated your code.
By default, hemp will start 2 tornado processes, running on ports 2000 and 2001. All of that is configurable in production.cfg
.
I didn't think it was relevant or even worth it to build a comments engine, Disqus can provide that, and it's really easy to integrate.