GithubHelp home page GithubHelp logo

elainekamlley / concordia Goto Github PK

View Code? Open in Web Editor NEW

This project forked from libraryofcongress/concordia

0.0 1.0 0.0 33.34 MB

Crowdsourcing platform.

Shell 1.46% Python 46.97% HTML 44.64% CSS 6.12% JavaScript 0.66% Groovy 0.16%

concordia's Introduction

concordia

Prerequisites

Docker

Running Concordia

$ git clone https://github.com/LibraryOfCongress/concordia.git
$ cd concordia
$ docker-compose up

Browse to localhost

Development Environment

You may wish to run the Django development server on your localhost instead of within a Docker container. It is easy to set up a Python virtual environment to work in.

Configuration

See the section below for config.json.

Serve

Instead of doing docker-compose up as above, instead do the following:

$ docker-compose up -d db
$ docker-compose up -d rabbit

This will keep our database in its container for convenience.

Next, set up a Python virtual environment:

$ python3 -m venv env
$ source env/bin/activate
$ pip install -r requirements_devel.txt

Edit, or create the config/config-optional-override.json and set the file content to: {"mode":"mac"}

Finally, run migrations and launch the development server:

$ ./manage.py migrate
$ ./manage.py runserver

Misc

To generate a model graph, do:

$ docker-compose up -d app
$ docker-compose exec app bash
# cd concordia/static/img
# python3 ./manage.py graph_models concordia > tx.dot
# dot -Tsvg tx.dot -o tx.svg

config.json

Settings for the concordia app reside in config/config.json.

The config.json file is composed of top level stanzas, with a minimum stanza name of "production".

Values in the config.json are accessed using the Config class with "from config import Config". (You may need to set the python sys.path value to import Config).

Once Config has been imported, values are accessed with Config.Get("<config key>") (replace <config key> with the actual key value.

By default, the "production" stanza is used. To override the stanza, create the file config-optional-override.json in the config dir. This json file will have a single json key/value with the key name as "mode". For example, to use the "unittest" stanza, set the config-optional-override.json to: {"mode":"unittest"}

For development on a mac, set the config-optional-override.json file to: {"mode":"mac"}. This stanza has a setting for database connections to 0.0.0.0 on port 54321.

If a key/value is added to config.json, it must added to all stanzas. A new stanza can be created by copying the "production" stanza and adding it to end of the config.json file. Remember to set the config-optional-override.json value to match the new stanza name.

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.