Skip to main content

Tidewave Web for Django, FastAPI, and Flask

Project description

Tidewave

Tidewave is the coding agent for full-stack web app development. Integrate Claude Code, OpenAI Codex, and other agents with your web app and web framework at every layer, from UI to database. See our website for more information.

This project supports Django, FastAPI, and Flask. It can also be used as a standalone Model Context Protocol (MCP) server for your editors.

Installation

Django

Add tidewave[django] as a dependency to your pyproject.toml:

"tidewave[django]",

Then open up your settings.py and add the following after your MIDDLEWARE and INSTALLED_APPS definition:

if DEBUG:
    INSTALLED_APPS.insert(0, "tidewave.django.apps.TidewaveConfig")
    MIDDLEWARE.insert(0, 'tidewave.django.Middleware')

If you are using Jinja2, you need to add our extension too (preferably in DEBUG mode only):

JINJA2_ENVIRONMENT_OPTIONS = {
    "extensions": [
        "tidewave.jinja2.Extension"
    ],
}

Now make sure Tidewave is installed and you are ready to connect Tidewave to your app.

Settings

  • TIDEWAVE["allow_remote_access"] - Whether to allow remote connections (default False)
  • TIDEWAVE["team"] - Enable your Tidewave Team configuration, such as TIDEWAVE = {"team": {"id": "dashbit"}}

Note Tidewave only runs in DEBUG mode.

Flask

Add tidewave[flask] as a dependency to your pyproject.toml:

"tidewave[flask]",

Now, in your application definition, you can initialize the Tidewave class and pass your Flask application to init_app:

if app.debug:
    from tidewave.flask import Tidewave
    tidewave = Tidewave()
    tidewave.init_app(app)

Note Tidewave only runs when app.debug is True. Therefore, remember to start your dev server with the --debug flag. If you are setting app.debug programatically, remember to do so before you call tidewave.init_app.

Now make sure Tidewave is installed and you are ready to connect Tidewave to your app.

Configuration

When initializing Tidewave(), the following options are supported:

  • allow_remote_access: allow remote connections when True (default False)
  • team: enable Tidewave Web for teams

Tidewave will automatically detect if your Flask application is using SQLAlchemy and Jinja2 and configure them automatically.

FastAPI

Tidewave Web is currently not supported for FastAPI.

Add tidewave[fastapi] as a dependency to your pyproject.toml:

"tidewave[fastapi]",

Now, in your application definition, you can initialize the Tidewave class and pass your FastAPI application to install. Note that you only want to do this in development mode:

# Your preferable way of detecting dev mode.
is_dev = os.environ.get("RUN_MODE", None) == "development"

if is_dev:
    from tidewave.fastapi import Tidewave
    tidewave = Tidewave()
    tidewave.install(app)

If you are using Jinja2, you need to add our extension too:

if is_dev:
    # ...

    from tidewave.jinja2 import Extension
    templates.env.add_extension(Extension)

If you are using SQLAlchemy, then you need to pass your Base class and the underlying engine as arguments to install:

tidewave.install(app, sqlalchemy_base=Base, sqlalchemy_engine=engine)

Note: when using SQLModel, you should set sqlalchemy_base=SQLModel.

Now make sure Tidewave is installed and you are ready to connect Tidewave to your app.

Configuration

When initializing Tidewave(), the following options are supported:

  • allow_remote_access: allow remote connections when True (default False)
  • team: enable Tidewave Web for teams

Available tools

  • execute_sql_query - executes a SQL query within your application database, useful for the agent to verify the result of an action (if Django or SQLAlchemy are configured)

  • get_docs - get the documentation for a given module/class/method. It consults the exact versions used by the project, ensuring you always get correct information

  • get_logs - reads logs written by the server

  • get_models - lists all modules in the application and their location for quick discovery (if Django or SQLAlchemy are configured)

  • get_source_location - get the source location for a given module/class/method, so an agent can directly read the source skipping search

  • project_eval - evaluates code within the web server itself, giving the agent access to your runtime, dependencies, and in-memory data

Troubleshooting

Content security policy

If you have enabled Content-Security-Policy, Tidewave will automatically enable "unsafe-eval" under script-src in order for contextual browser testing to work correctly. It also disables the frame-ancestors directive.

Contributing

# Install
uv sync --only-dev

# Run tests
uv run python -m pytest

# Lint and format code
uv run ruff check --fix .
uv run ruff format .

Acknowledgements

A thank you to Rob Hudson for implementing the Django integration.

License

Copyright (c) 2025 Dashbit

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

tidewave-0.2.0.tar.gz (91.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tidewave-0.2.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file tidewave-0.2.0.tar.gz.

File metadata

  • Download URL: tidewave-0.2.0.tar.gz
  • Upload date:
  • Size: 91.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tidewave-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5a08fc4be0f0d7bd862752abeac49fcb9ed682d0099cde8690b33eb15f52f1f4
MD5 15aaadcafeedefd290dad1d8e2834275
BLAKE2b-256 51b6735ea4f63380517e8bc4548966c2e246b13e27ec36ec89fc207c22cbc634

See more details on using hashes here.

Provenance

The following attestation bundles were made for tidewave-0.2.0.tar.gz:

Publisher: release.yaml on tidewave-ai/tidewave_python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tidewave-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tidewave-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tidewave-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24922fb901154d55872af2fac5d5f08a77873601b1abf6d5bc75260be6c48ec4
MD5 9f5468447192f7f924d8ab45b06f1614
BLAKE2b-256 dc81a95bfbcbaa64448d8ea3442853909749e82235b1fb4f9acfdacfdbb8f310

See more details on using hashes here.

Provenance

The following attestation bundles were made for tidewave-0.2.0-py3-none-any.whl:

Publisher: release.yaml on tidewave-ai/tidewave_python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page