Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eder/challenge-webservice


https://github.com/eder/challenge-webservice

Last synced: about 23 hours ago
JSON representation

Awesome Lists containing this project

README

        

# Challenger Webservice

Challenger Webservice is an example Flask application illustrating some of my common practices

## Development Environment

At the bare minimum you'll need the following for your development environment:

1. [Python](http://www.python.org/)
2. [MySQL](http://www.mysql.com/)

It is strongly recommended to also install and use the following tools:

1. [virtualenv](https://python-guide.readthedocs.org/en/latest/dev/virtualenvs/#virtualenv)
2. [Vagrant](http://vagrantup.com)

### Local Setup

The following assumes you have all of the recommended tools listed above installed.

#### 1. Clone the project:

$ git clone [email protected]:eder/challenge-webservice.git
$ cd challenger-webservice

#### 2. Create and initialize virtualenv for the project:
$ sudo pip install virtualenv
$ virtualenv challenge
$ source ./challenge/bin/activate
$ pip install -r requirements.txt

#### 3. Edit database connection
config/database.py
$ DATABASE_CONF_URI
$ DATABASE_ENG

#### 4. Upgrade the database:

$ cd app/config/

#### 5. Database Migrations
$ python migration.py db init
$ python migration.py db migrate
$ python migration.py db upgrade

#### 6. Run the development server:

$ python run.py

#### 7. How to use Webservice
Create user:
$ curl -X POST -F facebookId=30 http://localhost:5000/person/

Delete user:
$ curl -X DELETE http://localhost:5000/person/30/

List users with limit:
$ curl http://localhost:5000/?limit=xxx
#### Tests

To run the tests use the following command:

$ nosetests