Giter Site home page Giter Site logo

franklin's Introduction

Franklin

Franklin is an activist training platform built by BIT BLUEPRINT and Socialsquare for actionAid.

The readme contains section explaining how to configure different parts of the project.

Getting started

Franklin uses the 3.4+ version of the Python interpreter, make sure you have this installed before proceeding.

If you haven't already set up a virtual environment please see the Virtual environment section below.

Step 1. Install the needed Python packages by running this command:

> pip install -r requirements.txt

Step 2. In order to build the site you need to have Node.js installed. Depending on your setup and package manager there will be different ways of doing this:

OS X (with homebrew) Arch Ubuntu, Mint
brew install node pacman -S nodejs apt-get install nodejs

Step 3. Then if you don't already have grunt installed, install it:

> npm install -g grunt-cli

Step 4. Install the node dependencies (package.json):

> npm install

Step 5. Build the project

> grunt

Which does the following things:

  • Installs the the bower dependencies (bower.json)
  • Builds the CSS from SASS (.scss-files)

Step 6. django syncdb

> python manage.py syncdb

Step 7. South migrations

> python manage.py migrate

Step 8. Try it out!

> python manage.py runserver

(optional) Step 9. Create a superuser

> python manage.py createsuperuser

You should now be able to see the site at http://localhost:8000 :)

Virtual environment

We recommend setting up a virtual environment. It is not required but, it is good practice. If you don't already have virtualenv, install it with the command

> pip install virtualenv

(You may need to sudo the above command)

Then create the virtual environment in the folder .venv:

> virtualenv --python=python3.4 .venv

And lastly activate the virtual environment:

> . .venv/bin/activate

Database migrations (using South)

Initially (when you start your project) you should run the following commands:

> ./manage.py syncdb
> ./manage.py migrate skills
> ./manage.py migrate

When you change your models the database will have to be updated. You first create a migration

> ./manage.py schemamigration skills --auto

And then apply it:

> ./manage.py migrate skills

SQLite

For testing purposes you can enable an SQLite backend instead of the default PostgreSQL. This is done by setting the environment variable GCL_USE_SQLITE. If the varible is present in the environment (regardless of its value) a local SQLite database in will be used. (Residing in the file database.sqlite3)

Tests

You can run the tests by running the command

python manage.py test global_change_lab.tests

By default the tests are run through PhantomJS. This means you need to have the executable binary phantomjs on your PATH.

Using Google Chrome for testing

To run the tests with Chrome you can set the environment variable FRANKLIN_TEST_CHROME, e.g.

FRANKLIN_TEST_CHROME=1 python manage.py test global_change_lab.tests

You need to have the executable binary chromedriver on your PATH. chromedriver can be downloaded here.

Using Firefox for testing

You can also test with Mozilla Firefox by setting the environment variable FRANKLIN_TEST_FIREFOX, e.g.

FRANKLIN_TEST_FIREFOX=1 python manage.py test global_change_lab.tests

Running a single test

A single test from the test suite can be run with a command like this:

python manage.py test global_change_lab.tests.SeleniumTestSuite.test_login

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.