GithubHelp home page GithubHelp logo

rcvr's Introduction

Red Cross Volunteer Registry

A django webapp to handle volunteers at Indian Red Cross.

This webapp has only been tested on Ubuntu 16.04. It is compatible with python 2.7 and python 3.4+.

Deploying on Heroku

Required environment variables

  • SECRET_KEY: This will be used as django.conf.settings.SECRET_KEY.
  • HEROKU: Set this variable to any value. The presence of this environment variable makes django use settings appropriate for Heroku.

Setup instructions

  1. Create a heroku app.
  2. Setup environment variables as specified above.
  3. Push code to heroku app.
  4. Run a one-off dyno (using heroku run bash) and run these commands on it:
    • python manage.py migrate.
    • python createsuperuser. Now fill out details of the superuser.
    • Optionally run scripts/load_all_locs.py or scripts/load_locations.py to load location data. See sample_data/ for an example of location files.

Deploying locally for testing

For setting up a development environment, you must install the required dependencies. It is recommended to use a virtualenv.

Quick start

pip install -r requirements/dev.txt.
python manage.py migrate
python createsuperuser
python scripts/load_all_locs.py sample_data
python manage.py runserver

Now go to http://localhost:8000/admin/ to check out your webapp.

Settings

Settings can be found in project_conf/settings/:

  • heroku.py contains settings to run the webapp on Heroku.
  • default.py contains settings to run the development environment.
  • __init__.py contains the common settings.

If you want to override settings, it is recommended to copy default.py to a new file local.py and make changes there, to avoid messing things up.

We use SQLite by default for development and testing. You can change settings to use something else.

We use whitenoise to serve static assets.

Directory structure

  • devel - Tools to help with development and testing.
  • lib - Useful reusable code.
  • main - The main django app.
  • mysite - locale data.
  • project_conf - Project settings. Also contains root urlconf and wsgi.py.
  • requirements - Project requirements for dev and heroku.
  • sample_data - Sample csv files containing location data. These can be used with scripts/load_all_locs.py and scripts/load_locations.py.
  • scripts - Scripts useful in both development and production.
  • stubs - mypy stubs for django. Useful for type checking.

Automated testing

  • mypy - static type checker for python. First do pip install -r requirements/mypy.txt. Then use it from devel/run_mypy.py. It only works on python 3.
  • pyflakes - linter and static checker. Use it from devel/lint_all.py. devel/lint-all.py also uses a custom linter.
  • python manage.py test - django backend tests.

We also have a .travis.yml to run tests automatically on Travis CI. The travis helper scripts are located in devel/travis/.

rcvr's People

Contributors

sharmaeklavya2 avatar

Watchers

 avatar  avatar

Forkers

tekfyl

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.