# flask-peewee puts an admin, a REST API and auth on top of Peewee

> flask-peewee is a small integration layer between Flask and the Peewee ORM that ships an admin interface influenced by Django's, a REST API generator, authentication and form handling, and its value is that it is about four dependencies rather than a framework.

**coleifer/flask-peewee** — flask integration for peewee, including admin, authentication, rest api and more

- Repository: https://github.com/coleifer/flask-peewee
- Website: http://flask-peewee.readthedocs.org/
- Stars: 784 · Forks: 175
- Language: Python
- License: MIT
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/coleifer-flask-peewee

## An integration layer, not a framework

flask-peewee provides a layer of integration between the Flask web framework and the Peewee ORM, and the project describes itself as batteries included with an admin interface, authentication and a REST API. The dependency list is the honest measure of the scope: flask, peewee at 3.0.0 or newer, wtforms and wtf-peewee, and Python 3.8 or greater. That is four packages, two of which are the frameworks you would have installed anyway. The philosophy follows from the author's other work, since the wtf-peewee package is by the same author and is what wires WTForms to Peewee models, and this package builds the Flask layer on top of that. So flask-peewee is not trying to be a web framework, an ORM or a form library. It is the glue that turns a set of Peewee models into a Flask application with an admin screen, a JSON API and a login flow, and the glue is the thing you would otherwise write yourself.

## The admin is a Django-shaped idea, and it works

The admin interface is influenced heavily by the Django admin and provides easy create, edit and delete functionality for your project's models. The README shows a screenshot of the default interface and then shows the crux theme, so there is at least one alternative look available. The practical value of a model admin is that it removes a category of work that looks small until you count it: for every model you need list views, a create form, an edit form, filters, and a delete action, and the wiring for each. Getting that from a Peewee model alone is a project in itself. The README also mentions the admin area path, which for the example application is at /admin/ on the local server, and the login for that area uses the same credentials as the rest of the example app, so the admin is a part of the application rather than a separate service.

## The REST API is generated from the models, with pagination metadata

The REST API provides a RESTful interface for your project's models, and the example in the README shows the shape of a response from the user endpoint.

```
    curl localhost:5000/api/user/
```

The response is a JSON object with a meta block and an objects array. The meta block carries the model name, the next and previous page links, the page, the page count and the total object count, and the objects array carries the records themselves with their fields, in the example a username, an admin flag, a join date, an active flag and an id. The pagination metadata is what makes this usable from a client, since a bare array would give the caller no way to know whether more pages exist. The example application exposes the message endpoint at /api/message/, and the API is derived from the same models the admin screens use, which means a field added to a model shows up in both without a second definition.

## Installation and the example app are the whole getting started path

Installing is a single pip command.

```
    pip install flask-peewee
```

The project ships with an example app, which the README describes as a silly twitter clone, and to start it you change into the example directory and execute the run_example.py script.

```
    cd example/
    python run_example.py
```

To try the admin area, you log in as admin/admin and navigate to the admin path, and the REST API is reachable at its own path on the same local server. That example is worth running before adopting the library, because it is a complete working configuration of the admin, the API, the authentication and the models together, and the example directory is laid out the way a real application would be. The listing shows admin.py, api.py, auth.py, config.py, models.py, views.py, main.py and a migrations/ directory, plus templates and static directories, so it also answers the question of how the pieces are meant to be separated.

## The packaging is a little dated, and the version comes from the code

Two details in the build configuration are worth a note, because they will show up if you try to build from source. The project metadata in pyproject.toml declares the version as dynamic, and the setuptools configuration resolves it from the attr flask_peewee.__version__, so the version string lives in the package rather than in the build file. There is also a setup.py that calls setup with find_packages and nothing else, which is a leftover from the older build path and means the pyproject.toml is the file that describes the actual dependencies. The repository root is small and conventional, with the flask_peewee package directory, the docs directory, the example directory, a runtests.py script, a MANIFEST.in, a .readthedocs.yaml for the documentation build and a .github directory. There are no GitHub releases, so the version you get is whatever is on the package index, and the project page is the readthedocs documentation rather than a separate site.

## Where flask-peewee is the wrong choice

The main limit is that this is a glue library for a specific pair, and the pair is a matter of taste that has moved on. Flask-Peewee has been around long enough that its idioms reflect an earlier era of Flask, and the wider Python community has consolidated on SQLAlchemy with Flask-SQLAlchemy, which offers the same model-plus-migrations-plus-admin story with a much larger ecosystem and more migration paths documented. That is the alternative worth comparing, and the difference in approach is concrete: the SQLAlchemy route puts the model layer behind a widely maintained core with a large extension ecosystem, while flask-peewee puts it behind a thin adapter maintained alongside a smaller ORM, with the trade-off being fewer dependencies and a smaller surface. The second limit is scale of features. A Peewee model admin is excellent for a dozen models, and the moment you need row level permissions, an approval workflow or an audit trail, you are writing it yourself, because the admin is described as providing create, edit and delete, not as a configurable framework. The third is that the project shows no GitHub releases and a last push on 2026-09-03, so it is maintained but quiet, and a team that wants an actively developed admin should weigh that.

## Conclusion

flask-peewee suits a Python team that has already chosen Flask and Peewee and wants an admin panel, a JSON API and login handling without adopting a full framework, since the whole integration is four dependencies and a configuration file. It is the wrong choice for a greenfield project that has not picked a stack, because there are better supported combinations, and it is the wrong choice for a large team with a Django background, since the admin interface is explicitly influenced by Django and the surrounding conventions are the ones you already know rather than the ones you would learn. Before adopting it, read the documentation at flask-peewee.readthedocs.io, run the bundled twitter clone example to see the admin and the API in a working configuration, and check that the version of Peewee you use is 3.0 or newer. The last push was on 2026-09-03 and the repository publishes no GitHub releases.

## FAQ

### What does flask-peewee provide?

It provides a layer of integration between Flask and the Peewee ORM, with batteries included: an admin interface influenced heavily by the Django admin, authentication, and a REST API for your project's models. The requirements are flask, peewee 3.0.0 or newer, wtforms, wtf-peewee and Python 3.8 or greater.

### How do I install flask-peewee and run the example app?

Install it with pip install flask-peewee. The project ships a twitter clone example, so change into the example directory and run python run_example.py, then log in as admin/admin to reach the admin area and use the /api/message/ endpoint for the REST API.

### What does the flask-peewee REST API response look like?

It returns a JSON object with a meta block holding the model, next, previous, page, page_count and object_count, and an objects array holding the records. The README shows the user endpoint at localhost:5000/api/user/ with username, admin, join_date, active and id fields.

## Sources

- [coleifer/flask-peewee on GitHub](https://github.com/coleifer/flask-peewee)
- [Issues](https://github.com/coleifer/flask-peewee/issues)
- [License: MIT](https://github.com/coleifer/flask-peewee/blob/master/LICENSE)
- [Project website](http://flask-peewee.readthedocs.org/)
- [README](https://github.com/coleifer/flask-peewee/blob/master/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/coleifer-flask-peewee
