The code behind okfn.org
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
article_list_item 2018 update (#405) Jun 5, 2018
contrib Add script for munging redirects Apr 14, 2014
docs Partner attributes for listing partners/funders Jan 8, 2014
foundation Allow sorting of the Board members (#408) Jul 24, 2018
lib Chng comment from sass to less Jun 23, 2016
sendemail Rebased on dockerfile (#406) Jun 26, 2018
static 2018 update (#405) Jun 5, 2018
templates 2018 update (#405) Jun 5, 2018
tools Add a simple tool to help with updating requirements.txt Feb 21, 2014
.DS_Store Allow sorting of the Board members (#408) Jul 24, 2018
.bowerrc Allow sorting of the Board members (#408) Jul 24, 2018
.coveragerc Move all apps into the `foundation` package Feb 21, 2014
.dockerignore Rebased on dockerfile (#406) Jun 26, 2018
.env.example Rebased on dockerfile (#406) Jun 26, 2018
.gitignore Rebased on dockerfile (#406) Jun 26, 2018
.travis.yml Allow sorting of the Board members (#408) Jul 24, 2018
Dockerfile Rebased on dockerfile (#406) Jun 26, 2018
Gruntfile.js 2018 update (#405) Jun 5, 2018
LICENSE.txt foundation: use full legal name in copyright notice Apr 19, 2014
README.md Rebased on dockerfile (#406) Jun 26, 2018
bower.json 2018 update (#405) Jun 5, 2018
manage.py Initial commit Dec 16, 2013
package-lock.json Allow sorting of the Board members (#408) Jul 24, 2018
package.json bump to version 1.0.1 Jul 24, 2018
requirements.dev.in 2018 update (#405) Jun 5, 2018
requirements.dev.txt 2018 update (#405) Jun 5, 2018
requirements.in Rebased on dockerfile (#406) Jun 26, 2018
requirements.txt Rebased on dockerfile (#406) Jun 26, 2018
tox.ini Rebased on dockerfile (#406) Jun 26, 2018

README.md

okfn.org

Build Status Coverage Status

This is the Django/Django CMS project that runs http://okfn.org.

Prerequisites and assumptions

You must have the following installed:

  • Python 2.7
  • node

Also, the python packages being used require the following libraries to be installed:

  • libxml
  • libxslt
  • libsasl2
  • Python Imaging Library (PIL) dependencies, see here for a quick ubuntu instructions.

You may also wish to follow any install instructions inside a Python virtual environment. Explaining virtualenv is outside of the scope of this README, but this tutorial might help.

Running in development

Prepare the database. This step can be skipped if you'd like to use dummy SQLite database:

  • Get a dump of the database
  • Create a local database createdb okfn
  • Populate it psql okfn --file=/path/to/dump.sq or pg_restore -d okfn path/to/dump.dump

Cherry-pick environment variables from .env.example you'd like to set and add it to the .env file. Popular options:

  • CACHE_URL
  • DATABASE_URL
  • DJANGO_DEBUG
  • DJANGO_SECRET_KEY

Prepare the app:

pip install -r requirements.dev.txt
npm install
python manage.py migrate
python manage.py update_index

Start the server:

python manage.py runserver # dev
gunicorn foundation.wsgi:application --access-logfile '-' --error-logfile '-' # prod

Another option is to use Docker. For this one you should configure your database to work with remote connections using a proper IP address in the connection string or you should use default SQLite database (omit DATABASE_URL):

docker build -t okfn .
docker run -d -p 8888:80 -e DATABASE_URL=<change_me> -e <...> okfn