https://github.com/eder/challenge-webservice
https://github.com/eder/challenge-webservice
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/eder/challenge-webservice
- Owner: eder
- Created: 2014-08-04T05:15:24.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T20:14:49.000Z (over 3 years ago)
- Last Synced: 2025-03-05T01:29:41.944Z (over 1 year ago)
- Language: Python
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
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 git@github.com: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