Skip to content

COVID-19 Hospital Impact Model for Epidemics (CHIME) app for Django

License

Notifications You must be signed in to change notification settings

ChrisPappalardo/django-chime

Repository files navigation

django-chime

Documentation Status

COVID-19 Hospital Impact Model for Epidemics (CHIME) app for Django.

Check out a live demo of django-chime at https://chime.pappanaka.com! Register for an account (it's free - you just need to confirm an email address) and create your custom CHIME app instance in minutes.

Features

  • Re-usable application for deploying CHIME models in a Django project
  • Provides database models for assumption persistence
  • Integrates with Django's user and auth infrastructure for privacy and security
  • Fast and lightweight platform allows hosting many models on the same website
  • Built using the latest UPenn CHIME model

Quickstart

Installation

Install the package from github using pip:

$ pip install git+https://github.com/ChrisPappalardo/django-chime.git

Or you can include it in your requirements file like so:

git+https://github.com/ChrisPappalardo/django-chime.git@master#egg=django-chime

Configuration

You will need to add the django_chime application to the INSTALLED_APPS setting of your project's settings.py file:

INSTALLED_APPS = (

    ...

    'django_chime',
)

This will make the models, views, and templates available in your project.

You will also need to migrate your database to use the django-chime models:

$ python manage.py migrate

Views

To allow users to access the django-chime views, you will need to add a path declaration to urlpatterns in your project urls.py like so:

from django_chime.views import ChimeSiteView

...

urlpatterns = [

    ...

    # django-chime deployed models view (authentication optional)
    path(
        '<uuid:pk>/',
        ChimeSiteView.as_view(),
        name='site',
    ),

    # django-chime model management view (requires authentication)
    path(
        'chime/',
        include("django_chime.urls"),
    ),

    ...

Once logged in, users can navigate to /chime/ to create and configure their CHIME models. Once created, the CHIME models are visible without authentication at /<ID of CHIME model>/.

To use the templates that come with django-chime, you will need to add the following blocks to your project base template base.html:

...

{% block external_css %}
{% endblock external_css %}

...

{% block headline %}
{% endblock headline %}

...

{% block section_content %}
{% endblock section_content %}

...

{% block external_javascript %}
{% endblock external_javascript %}

{% block project_javascript %}
{% endblock project_javascript %}

Note

You will need to add the css blocks to the <head> section and the javascript blocks to the bottom of the <body> section of your base template.

As an alternative, try using the base template from djcorecap, as the base for your project, it's awesome!

Credits

The CHIME model and source code is Copyright © 2020, The Trustees of the University of Pennsylvania and was released for public use under the MIT License. Please visit their live application for more information.

The official UPenn CHIME project code base is being actively developed by Code for Philly. Please visit their project on GitHub for more information.

About

COVID-19 Hospital Impact Model for Epidemics (CHIME) app for Django

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published