mikeywaites / arrested-cookiecutter

A Cookie Cutter for Flask Arrested - https://github.com/mikeywaites/flask-arrested

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arrested Cookie Cutter

https://badges.gitter.im/bruv-io/Arrested.png

This is a cookie-cutter for Arrested. - A Framework for rapidly building REST APIs with Flask. This cookie-cutter creates a Flask application that exposes a User API to help demonstrate how to use the different components of Arrested.

Installation

If you haven't already installed Cookie Cutter then you'll need to do that first.

pip install cookiecutter

or read their documentation here.

πŸš€ Get started in under a minute..

Run the following commands to create a new project using the Arrested cookiecutter.

Step 1

Clone the project repo using cookiecutter (run cookiecutter --help for more options when creating the project)

cookiecutter gh:mikeywaites/arrested-cookiecutter -o arrested-users-api

Step 2

Change to the newly created directory.

cd arrested-users-api

The directory should look something like this.

.
└── arrested-users-api
    β”œβ”€β”€ Dockerfile
    β”œβ”€β”€ README.rst
    β”œβ”€β”€ arrested_users
    β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”œβ”€β”€ apis
    β”‚   β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”‚   └── v1
    β”‚   β”‚       β”œβ”€β”€ __init__.py
    β”‚   β”‚       β”œβ”€β”€ mappers
    β”‚   β”‚       β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”‚       β”‚   β”œβ”€β”€ base.py
    β”‚   β”‚       β”‚   └── user.py
    β”‚   β”‚       β”œβ”€β”€ middleware.py
    β”‚   β”‚       └── users.py
    β”‚   β”œβ”€β”€ app.py
    β”‚   β”œβ”€β”€ config.py
    β”‚   β”œβ”€β”€ migrations
    β”‚   β”‚   β”œβ”€β”€ 266926b5775b_initial_migration.py
    β”‚   β”‚   └── script.py.mako
    β”‚   β”œβ”€β”€ models
    β”‚   β”‚   β”œβ”€β”€ __init__.py
    β”‚   β”‚   β”œβ”€β”€ base.py
    β”‚   β”‚   └── user.py
    β”‚   └── wsgi.py
    β”œβ”€β”€ arrested_users.db
    β”œβ”€β”€ docker-compose.yml
    β”œβ”€β”€ requirements.txt
    └── setup.py

7 directories, 22 files

Step 3

The example ships with a Docker container. Read more about Installing. and Running. Docker.

docker-compose up api

Step 4

Fire a HTTP request at the Users endpoint of your newly created API.

curl -u admin:secret localhost:8080/v1/users | python -m json.tool

The User Guide

Get started with Flask-Arrested using the quickstart user guide or take a look at the in-depth API documentation.

https://arrested.readthedocs.org.

About

A Cookie Cutter for Flask Arrested - https://github.com/mikeywaites/flask-arrested


Languages

Language:Python 93.0%Language:Mako 7.0%