datasette-codespaces by simonw

48 downloads this week        Star



PyPI Changelog Tests License

Conveniences for running Datasette on GitHub Codespaces


Install this plugin in the same environment as Datasette.

datasette install datasette-codespaces


Using Datasette in GitHub Codespaces provides a detailed tutorial introduction to this plugin.


Install this when you are using Datasette inside of GitHub Codespaces. It makes the following changes:

  • All requests will identified as representing the root actor - provided Datasette is running inside Codespaces. This is detected through the presence of the CODESPACE_NAME environment variable. GitHub restricts access to servers running in the Codespaces environment based on GitHub authentication, so treating all requests as root should be acceptably secure.
  • The datasette-x-forwarded-host plugin will be installed, ensuring links to other pages within Datasette such as facet navigation work correctly.


To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-codespaces
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests: