Skip to main content

Peewee integration for flask

Project description

flask-peewee
============

provides a layer of integration between the `flask <http://flask.pocoo.org/>`_
web framework and the `peewee orm <http://peewee.readthedocs.org/>`_.

batteries included:

* admin interface
* authentication
* rest api

requirements:

* `flask <https://github.com/mitsuhiko/flask>`_
* `peewee <https://github.com/coleifer/peewee>`_
* `wtforms <https://bitbucket.org/simplecodes/wtforms>`_
* `wtf-peewee <https://github.com/coleifer/wtf-peewee>`_
* python 2.5 or greater


check out the `documentation <http://flask-peewee.readthedocs.org/>`_.


admin interface
---------------

influenced heavily by the `django <http://djangoproject.com>`_ admin, provides easy
create/edit/delete functionality for your project's models.

.. image:: http://i.imgur.com/EtzdO.jpg


rest api
--------

influenced by `tastypie <https://github.com/toastdriven/django-tastypie>`_, provides
a way to expose a RESTful interface for your project's models.

::

curl localhost:5000/api/user/
{
"meta": {
"model": "user",
"next": "",
"page": 1,
"previous": ""
},
"objects": [
{
"username": "admin",
"admin": true,
"email": "",
"join_date": "2011-09-16 18:34:49",
"active": true,
"id": 1
},
{
"username": "coleifer",
"admin": false,
"email": "coleifer@gmail.com",
"join_date": "2011-09-16 18:35:56",
"active": true,
"id": 2
}
]
}


installing
----------

I recommend installing in a virtualenv. to get started::

# create a new virtualenv
virtualenv --no-site-packages project
cd project/
source bin/activate

# install this project (will install dependencies as well)
pip install flask-peewee


example app
-----------

the project ships with an example app, which is a silly twitter clone. to
start the example app, ``cd`` into the "example" directory and execute
the ``run_example.py`` script::

cd example/
python run_example.py

if you would like to test out the admin area, log in as "admin/admin" and navigate to:

http://127.0.0.1:5000/admin/

you can check out the REST api at the following url:

http://127.0.0.1:5000/api/message/

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

flask-peewee-0.5.5.tar.gz (697.5 kB view details)

Uploaded Source

File details

Details for the file flask-peewee-0.5.5.tar.gz.

File metadata

File hashes

Hashes for flask-peewee-0.5.5.tar.gz
Algorithm Hash digest
SHA256 8123c154c15d26aa62f9de0bde1ed7eef559218b955a85f4cf210cfb912d563a
MD5 77b361613f34c18ac97d34a2e10a5ace
BLAKE2b-256 e2656feafdd853b7be93cfc7d078f400b8a709d065aa83d0877705c212221f24

See more details on using hashes here.

Provenance

Supported by

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