Skip to content

Python Shell

Python Shell

A Python shell interface is provided at the URL /admin/shell/.

This interface allows advanced users direct access to the underlying database objects using Python.

Danger

The scripting shell interface should only ever be used by advanced users. It requires intimate knowledge of the underlying InvenTree code, and improper use could easily result in corruption of data

Seriously

If you are not 100% sure of what you are doing, do not use the shell interface

Enabling Shell Mode

The admin shell is (by default) only enabled when InvenTree is running in DEBUG mode

The shell interface allows Python queries to be run by the admin user, as shown below:

Admin shell interface Admin shell interface

Last update: October 18, 2021