Coder Social home page Coder Social logo

isabella232 / collab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cfpb/collab

0.0 0.0 0.0 1.73 MB

Collab is a Django project with a standard set of configurations to provide services to reusable apps.

Home Page: http://cfpb.github.io/collab

License: Creative Commons Zero v1.0 Universal

Python 79.58% JavaScript 1.88% HTML 3.97% CSS 14.57%

collab's Introduction

Collab

Build Status

What is Collab?

Collab is a Django project with a standard set of configurations to provide services to reusable apps.

What is included?

Core Collab comes with:

Setting up a development environment

Requirements:

  • Python (>= 2.6)
  • Mysql

Follow these steps to set up collab:

  1. Clone this repo or a fork of it

    git clone https://github.com/cfpb/collab.git
    cd collab
  2. Make sure you have pip and virtualenv installed:

    easy_install -U pip
    pip install -U pip
    pip install -U virtualenv

    You may have to prepend these commands with sudo, depending on your setup.

  3. Create a virtual environment for the project and install the necessary packages:

    virtualenv --no-site-packages --distribute venv    # creates the virtualenv named "venv"
    source venv/bin/activate                           # activates (places you in) the virtualenv
    pip install -r requirements.txt                    # installs main required packages for collab
    pip install -r requirements-test.txt               # installs packages required for testing

    Important Note: Anytime you restart your terminal and return to work on this project, you will need to reactivate the virtualenv by running the source venv/bin/activate command from the collab root. See virtualenv for more details.

  4. Copy collab/local_settings_template.py to collab/local_settings.py and edit to match your current environment. In particular, update the DATABASES information. You will need to create the database you choose for the default schema.

    • Edit DATABASES (in the else block) to set the database user and password to whatever user you have set up in MySQL (probably root with no password, since it's local to your machine).
    • Set a SECRET KEY. This can be any string you want.
    • If you have already set up any other child apps besides the four required, uncomment them in INSTALLED_APPS.
  5. Set up the database:

    mysql.server start
    mysql -u <user> -e 'create database collab'
    python ./manage.py syncdb
    python ./manage.py syncdb --noinput --migrate
    python ./manage.py loaddata core/fixtures/core-test-fixtures.json

    Optionally, you can create random users for local testing.

    python ./manage.py create_users <number of users>
  6. Run the Django server:

    python ./manage.py runserver
  7. Go to http://localhost:8000 in your browser and log in with user [email protected] and password 1.

  8. You are a winner!

Testing

To run tests:

python manage.py test

Models should have a robust set of unit tests.

When writing unit tests for models, try to separate functionality which needs the DB from functionality which does not. Aim to avoid hitting the DB in a test for optimal results.

Views should have unit testing for functional parts of them: that is, try to extract functionality without side effects from the view functions, and then test those extracted functions.

Views should have system testing using WebTest for page interaction.

collab's People

Contributors

m3brown avatar dlapiduz avatar scotchester avatar jimmynotjim avatar marcesher avatar cfarm avatar grapesmoker avatar willbarton avatar dpford avatar richaagarwal avatar sephcoster avatar ascott1 avatar elucify avatar mattmakai avatar virtix 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.