behave-django
Behave BDD integration for Django
What it is and what it does
behave-django bridges Behave, a Gherkin-based behavior-driven development framework, into Django projects. It lets you write acceptance tests in plain-language feature files and execute them against a Django application with full access to the test client, Django's assertion library, and database transaction isolation per scenario.
The package handles the plumbing: it configures Behave to run within Django's test environment, manages database state between scenarios, and provides hooks for fixture loading and page object patterns. It's designed for teams that want to write acceptance criteria in Gherkin (readable by non-developers) while leveraging Django's testing infrastructure and optionally automating browser interactions via beautifulsoup4.
Use it for:
- Write acceptance tests in Gherkin that non-technical stakeholders can read and understand alongside developers.
- Test Django views and workflows end-to-end with clean database state between each scenario.
- Automate web UI testing using Django's test client or browser automation without leaving the Behave framework.
- Validate complex user journeys across multiple Django views in a single feature file.
- Integrate BDD testing into CI/CD pipelines using Behave's command-line interface and configuration files.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Behave BDD testing into Django projects, enabling scenario-driven testing with database isolation, Django's test client, and browser automation support.
Yes, if you're running Django 5.2 or 6.0 on Python 3.10+ and want to adopt BDD testing with Gherkin scenarios. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It's well-suited for teams that value readable acceptance criteria and Django's test infrastructure together.
Install
behave-django on PyPI
pip
pip install behave-djangouv
uv add behave-djangopoetry
poetry add behave-djangoInstalling behave-django
Before you install
Low friction installation with a wheel distribution. Actively maintained as of 71 days ago with recent commits and a stable codebase. Requires Python 3.10 or later and is tested against Django 5.2 and 6.0.
License in practice
MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute behave-django freely provided you include the license notice.
Quickstart
pip install behave-django
from behave_django import *
# In features/steps/steps.py:
from behave import given, when, then
@given('a Django test environment')
def step_impl(context):
pass
Requires Python 3.10 or later and a Django project (5.2 or 6.0) already set up.
Verify before relying
- Whether page object patterns are built-in or require manual implementation.
- Specific browser automation libraries supported beyond beautifulsoup4.
- Whether fixture loading covers Django fixtures or custom formats.
- Performance characteristics when running large scenario suites.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — behave, django, beautifulsoup4 |
| Maintenance | actively maintained — 71 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 264,114/month — #8,343 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: behave_django-2.0.0-py3-none-any.whl
Keywords: bdd, behave, django, testing
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
behavebehave is a behavior-driven development (BDD)…
permissive · top 5,000 on PyPI
radish-bddradish is a Behavior Driven Development (BDD)…
permissive · top 15,000 on PyPI
behavexBehaveX extends Behave with parallel test…
unclear · top 15,000 on PyPI
pytest-bddpytest-bdd implements Gherkin-based…
permissive · top 5,000 on PyPI
behave-html-formatterGenerates HTML reports from Behave BDD test…
copyleft · top 15,000 on PyPI
vedroVedro is a scenario-style testing framework for…
permissive · top 15,000 on PyPI
allure-behaveIntegrates Behave BDD test execution with…
permissive · top 15,000 on PyPI
cucumber-tag-expressionsParses and evaluates boolean tag expressions…
permissive · top 5,000 on PyPI
cucumber-expressionsCucumber Expressions provides a simpler, more…
permissive · top 5,000 on PyPI
behave-reportportalIntegrates Behave BDD test execution with…
permissive · top 15,000 on PyPI