Skip to content

nick-korres/city_guess_api

Repository files navigation

City Guess (Api)

This is the Api for my City Guess web app whose code is here.

There are 2 routes

Installation

Assuming you have python 3+ installed :

  • Clone the repository and cd into the folder ( example in Windows PowerShell)
git clone https://github.com/nick-korres/city_guess_api.git
cd .\city_guess_api\
  • Install the dependencies. You might want to do it in a python virtual enviroment.
pip install -r requirements.txt
  • Install PostgreSQL
  • Create file named .env containing the folowing :
DATABASE_URL=postgresql+psycopg2://username:password@localhost/dbName

The default username is postgres and the password the one set at installation. create a database and set the name at the variable above.

Usage

  • To create the tables in the database :
flask shell
from app import Setup
Setup()
exit()
flask  run