Install

Dependencies

  • Apache 2
  • MySQL (or other database)
  • Python 2.7
  • pip
  • virtualenv
sudo apt-get install apache2
sudo apt-get install libapache2-mod-wsgi
sudo apt-get install mysql-server
sudo apt-get install libmysqlclient-dev
sudo apt-get install python
sudo apt-get install python-pip
sudo pip install virtualenv

1 Download

Download a ZIP file...

wget https://github.com/byu-osl/citizen-budget/archive/master.zip

...or use git.

git clone https://github.com/byu-osl/citizen-budget.git

Place the Citizen Budget code in /home/citizen-budget.

2 Configure For Your City

cp doc/config.py .

Edit this file and do the following actions.

  • Generate a secret key.

    python
    >>> import os
    >>> os.urandom(24)

    Place this secret key in the file.

    app.config["SECRET_KEY"] = "YOUR KEY HERE"
  • Set your city name.

    city.name = 'Your City'

    and place your city logo in static/img/logo.png.

  • Configure email access by putting a Gmail addresss and password in the file.

    app.config['MAIL_USERNAME'] = 'YOUR APP GMAIL ADDRESS HERE'
    app.config['MAIL_PASSWORD'] = 'YOUR APP GMAIL PASSWORD HERE'
    

    This account will be used to send login codes to administrative users via email.

    You probably want to create a new Gmail account for this purpose, since the password will be stored in this file on your server. Anyone with access to the server will be able to see the password.

  • Create logging directory.

    sudo mkdir /var/log/citizen-budget
    sudo chown www-data:www-data /var/log/citizen-budget
    

3 Setup MySQL

mysql -u root -p
mysql> CREATE DATABASE citizenbudget;
mysql> GRANT ALL PRIVILEGES ON citizenbudget.* TO "citizenbudget"@"localhost" IDENTIFIED BY "citizenbudget";
mysql> FLUSH PRIVILEGES;
mysql> EXIT

4 Setup Apache

Setup a virtual host for the site.

sudo cp doc/vhost /etc/apache/sites-available/citizenbudget

Edit this file and change the following line to so it matches your virtual host name.

ServerName budget.yourcity.org

Restart the server

sudo service apache2 restart

Setup the WSGI configuration file for the application.

sudo cp doc/app.wsgi .

5 Setup Python Virtual Environment

virtualenv env
source env/bin/activate
(env) pip install flask
(env) pip install flask-mail
(env) pip install flask-sqlalchemy
(env) pip install wtforms
(env) pip install mysql-python

6 Install Citizen Budget

Visit the web site for the virtual host you setup at http://budget.yourcity.org. You should see the following screen.

Click on the Add button and create an administrative user.

Citizen Budget uses login codes, instead of passwords, so you only need to enter your name, email address, and cell phone number. Click the Finish button and you should see a welcome screen.

7 Upload Financial Statements

Click on the person icon on the right side of the menu and select Financials.

Click the Add button and upload your financial statements. As of now, the only supported format is CSV exported from Caselle financial software. You may upload multiple files at a time. Once the files are uploaded, you should see them displayed on the same screen.

Click on the Home menu, and you should see a beautiful home page for your city budget.

Fork me on GitHub