Skip to main content

Plugin to run Django with the Hitch testing framework.

Project description


HitchDjango is a plugin for the Hitch test framework that lets you run and interact with Django as part of a test.

When the plugin starts Django, before running runserver, it will:

  • Check the version and fail if it is different to what is specified.

  • Run migrations (using migrate).

  • Get the URL using localhost + the specified port and put it in

  • Install all specified Django fixtures.

Currently HitchDjango runs only on Django 1.8 and above. Please raise a ticket if you need an earlier version.

Use with Hitch

Install like so:

$ hitch install hitchdjango
# Service definition in engine's setUp:['Django'] = hitchdjango.DjangoService(
    version="1.8",                                              # Mandatory
    python="{}/venv/bin/python".format(PROJECT_DIRECTORY),      # Mandatory
    managepy=None,                                              # Optional full path to (default: None, assumes in project directory)
    django_fixtures=['fixture1.json',],                         # Optional (default: None)
    port=18080,                                                 # Optional (default: 18080)
    settings="remindme.settings",                               # Optional (default: settings)
    needs=[['Postgres'], ]                         # Optional (default: no prerequisites)

# Interact during the test:
[ Prints help ]


[ Saves fixture ]

See this service in action at the DjangoRemindMe project.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hitchdjango-0.2.tar.gz (4.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page