A simple blog, written in Python, using the Pyramid web framework.
Note: I have switched to using http://gohugo.io for my blog. As a result, I no longer use this project, though I can provide support if anyone else wants to.
First make sure there is a running local instance of redis. Then run the following commands:
git clone https://github.com/ismail-s/fireblog.git cd fireblog pip install -r requirements.txt python setup.py develop initialize_fireblog_db development.ini mkdir reload-spooler uwsgi --ini-paste-logged development.ini
Do note when running those commands that:
- you use a virtualenv
- You don't use development.ini when running in production. This is because development.ini enables the debug toolbar, which allows arbitrary code execution. For a warning of what this could result in, see this article.
- If you want to run the server in production mode as a daemon, then run:
uwsgi --ini-paste-logged production.ini
If you wish to customise stuff, eg use a database like postgres instead of sqlite (the default), then change the .ini file you pass to these commands.
Managing the database
The initialize_fireblog_db script does 3 things when run:
- Creates the db with the required tables if they don't exist already
- Updates the db to the latest version if necessary
- Creates a first post if no posts exist already
- Makes sure all required settings are in the settings table, prompting the user of the script to input values if a value doesn't exist or is invalid.
This means that this script doesn't accept any parameters besides the ini file which says where the db is. The script is also safe to run at any point, to either create, update or check the db.