This application provides a list of items within a variety of categories as well as provide a user registration and authentication through Google Plus OAuth API. Registered users will have the ability to post, edit and delete their own items, and the non authenticated users will just browse the items and categories in read only mode.
-
item_catalogPython package which contains a flask REST API using SqlAlchemy as a database ORM framework.__init__.pyWeb app settings for Google Oauth API , Flask, SqlAlchemy, SeaSurf CSRF security, REST configs and URLs mapping.models.pyDatabase schema definitions using SqlAlchemy model declarative style.views.pyService a single one page UI and multiple web services for CRUD operations on items and get a list of previously saved categories.utils.pyMixins and Behaviors for parsing and rendering items as well as authenticating users and authorizing write operations over the items.
-
staticHTML5 Single one page web app using web components and Polymer as web framework for building a modular models based app. -
templatesHTML5 templates for the flask app.catalog.htmlSingle one page app compressed as one file, served by a flask view with no need of any server side rendering.
-
load_fixtures.pySetup the database schema and load a list of a defined categories. -
runserver.pyBootstrap the Flask web application.
Python runtime 2.7.x: Runtime environment for python scripts.SQLite: Super light DBMS for storing users, items and categories.
$ git clone https://github.com/andresanies/item-catalog.git
$ pip install -r requirements.txt
$ python load_fixtures.py
$ python runserver.py
- Test the JSON endpoint on your local host:
$ curl 'http://localhost:5000/catalog/' -H 'Accept: application/json'
- Test the XML endpoint on your local host:
$ curl 'http://localhost:5000/catalog/' -H 'Accept: application/xml'