Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commands & Tasks

Ben Golder edited this page Nov 2, 2017 · 8 revisions

Routine Development Commands

  • ./manage.py shell_plus. This opens an ipython shell with a bunch of auto-imports all models and other helpful objects.
  • ./manage.py migrate. Used to migrate the database.
  • ./manage.py behave. Runs browser tests.
  • ./manage.py test. Runs Django test suite.
  • ./manage.py runserver. Runs the local development server.

Fixture management Commands

  • ./manage.py load_essential_data. Loads important fixtures that are used in all environments, such as counties, organizations, and groups.
  • ./manage.py new_fixtures. Reloads essential data and then creates fake seed data (applications, users) for each organization.

Regularly-Scheduled Tasks

  • ./manage.py heroku_release. This command is run whenever Heroku deploys a new app. It runs migrate and then load_essential_data.
  • ./manage.py send_unopened_apps_notification. Run daily at 7:00 AM Pacific using Heroku Scheduler. On weekdays, this checks for unread applications and sends each organization an email about the amount of new applications that are waiting for them. It then sends a slack notification reporting on the totals for each organization.
  • ./manage.py send_followups. Run daily at Noon Pacific using Heroku Scheduler. On weekdays, this sends an email to any user at an organization that doesn't use status notifications.
  • ./manage.py alert_if_org_is_absent. Run ____ using Heroku Scheduler. This will send an email to clearmyrecord-alerts alerting us of any organizations that have not logged in recently and have unread applications.
  • ./manage.py upload_data. Used on cmr-prod to dump data from the production database to S3, so that stage can sync to match production.
  • ./manage.py download_data. Used on cmr-stage to pull in data from S3 and sync the staging database to match production.

Other tasks

  • ./manage.py create_email_forwarding_for_users. This creates route forwarding rules in Mailgun, generating @clearmyrecord.org email accounts for each existing user profile that forward to the users' login emails.

Clone this wiki locally