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
- Host: GitHub
- URL: https://github.com/veeara282/pennapps17-backend
- Owner: veeara282
- License: mit
- Created: 2017-09-09T18:28:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-10T00:53:50.000Z (over 7 years ago)
- Last Synced: 2025-01-02T00:15:25.305Z (5 months ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.