Giter Site home page Giter Site logo

schoeller / dkobo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kobotoolbox/dkobo

0.0 2.0 0.0 5.48 MB

A django project for developing components of the kobotoolbox

License: GNU Affero General Public License v3.0

Ruby 0.02% JavaScript 39.95% Python 9.51% CoffeeScript 38.85% CSS 11.40% Shell 0.27%

dkobo's Introduction

Dkobo.

Build Status

A django project for developing components of the KoBoToolbox, including the new version of KoBoForm


Installation

  1. Clone the project:

    git clone https://github.com/kobotoolbox/dkobo.git

  2. Activate a python virtualenv.

    It's suggested that you use virtualenv wrapper, which provides the "mkvirtualenv" and "workon" commands
    However, without that, you can still create a virtualenv e.g. named pykobo virtualenv ~/pykobo

  3. If in production, set production environment variables. (See below)

  4. Install python:

    pip install -r requirements.txt

  5. Ensure system packages are installed:

    apt-get install python2.7-dev apt-get install libxml2 libxml2-dev libxslt1-dev

  6. Special package installs (require custom repositories):

    apt-get install postgresql-server-dev-9.3 apt-get install nodejs

  7. Install javascript dependencies:

    npm install
    bower install

  8. Build javascript and stylesheet dependencies

    grunt build

  9. Continue with "launching the server" (optionally skipping any repeated steps)

Launching the server

  1. Ensure the latest code is pulled

    git pull origin master

  2. Activate the virtualenvironment

    example virtualenv named pykobo
    source ~/pykobo/bin/activate

  3. Consider installing any requirements that have not been installed

    pip install -r requirements.txt # this installs python dependencies inside the vitualenv
    npm install
    bower install

  4. Migrate the database

    python manage.py syncdb
    python manage.py migrate

  5. Run the server on port 8000

    python manage.py runserver OR (when actively developing the application)
    python manage.py gruntserver This is an alias for running 'grunt' in the background.


Production environment variables

DJANGO_DEBUG=False
DJANGO_SECRET_KEY=<use a unique django secret key here>

The server should run in development / debug mode by default, but if you want to change it you can run the command

`source scripts/set_debug.sh true` #sets development mode<br>
or<br>

LOCAL:  source scripts/set_debug.sh true
LOCAL:  source scripts/set_debug.sh false
HEROKU: sh scripts/set_debug.sh --heroku true
HEROKU: sh scripts/set_debug.sh --heroku false
`source scripts/set_debug.sh false` #sets production mode

Grunt commands

grunt (no arguments)

default task: triggers requirejs:compile_xlform, build_css, and watch for changes

grunt build

triggers requirejs:compile_xlform, build_css

  • Creates js and css dependencies
grunt build_all
  • Used when launching production
  • Runs build and generates modernizr.js file for use when django is not in debug mode.
grunt build_css
  • Runs sass:dist, cssmin:strip_duplicates, cssmin:dist
grunt test
  • Runs build, karma:unit

dkobo's People

Contributors

chrisnager avatar dorey avatar jnm avatar martijnr avatar nstraub avatar pmusaraj avatar tinok avatar

Watchers

 avatar  avatar

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.