Backend server for Sharebnb API. In use by Sharebnb React Frontend.
Integrates AWS S3 into relational database for file storage.
See requirements.txt for a full list of dependencies.
- Clone this repo.
git clone https://github.com/veronicani/sharebnb-flask.git
- To install dependencies into a virtual environment (venv), create / activate venv in the project directory.
To create new venv
To activate venv:
$ python3 -m venv venv
$ source venv/bin/activate
- Install requirements.txt.
Note: this will override any previous installs in the venv.
(venv) $ pip3 install -r requirements.txt
- Run server.
(For some macs, running on port 5000 will lead to an address conflict, so run on port 5001 instead)
(venv) $ flask run -p 5000
- Create new database (requires PostgresQL to be installed):
createdb sharebnb
- To reseed data:
cd sharebnb-flask
- Enter iPython in terminal (while in venv):
(venv) $ ipython
- Run seed file:
In [1]: run seed.py