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

https://github.com/veeara282/pennapps17-backend

Back end for PennApps F17 project
https://github.com/veeara282/pennapps17-backend

Last synced: 3 months ago
JSON representation

Back end for PennApps F17 project

Awesome Lists containing this project

README

        

# PennApps17-backend
Back end for PennApps F17 project

## API Documentation

- `GET /user/`
- Retrieves information about user `` in JSON format.
- `PUT /user/`
- Updates informaton about user `` from the data in the request body.
- `POST /user/`
- Creates a new user on the server from the data in the request body.

## Setup instructions

To setup `virtualenv` with Python 3.x, navigate to the root directory of this repo and type:

```
$ virtualenv -p python3 .
```

Activate `virtualenv`:
```
$ source bin/activate
```

Deactivate `virtualenv`:
```
$ deactivate
```

Note: `virtualenv` creates a bunch of directories, which have been added to `.gitignore`. Do not remove them from `.gitignore`.

## Adding and updating dependencies

To add a dependency, simply run `pip3 install ` from within the virtualenv.

Export the list of dependencies:
```
$ pip3 freeze -r requirements.txt > requirements.txt
```

Install or update dependencies from the list:
```
$ pip install -r requirements.txt
```

Warning: Do not remove `requirements.txt` from `.gitignore`!

## Running the server

Before you run it, you must set the `FLASK_APP` environment variable. Within virtualenv, run:
```
$ export FLASK_APP=main.py
```

Then, you can run `$ flask run`. This works even if you deactivate and re-activate the environment.