Web Programming with Python and JavaScript
The purpose of Book Review is to let you review and rate the books you read in order to build a nice review database. In addition to the web site, you can use the API to ask for basic info and the review of a book.
You need to register to be part of the project.
application.py
contains the flask application, including the routes and the logic for authentication, search, review process, API and admin tasksbook.csv
is the source for the book databaseimport.py
is a python program that can help you importing books from a csv file to the databaserequirements.txt
contains the required packages that you can install with pip- In
static
folder you'll find a css file and an background image for the Home page - In
templates
folder you'll find all the html files:book.html
: display informations related to a specific book and let a user add a reviewbooks.html
: is the result for a searcherror.html
: a generic error pageindex.html
: is the Home pagelayout.html
: defines the look and feel for the entire websitelogin.html
: login pageprofile.html
: is the user profile templateregister.html
: to register a new userreviews.html
: for admin, lists all the reviewsupdate_review.html
: provide to a user the ability to edit is reviewusers.html
: for admin, lists all the users
To run locally:
- Install using git: clone the repository
git clone https://github.com/mathieuc22/project1.git
cd project1
- Create a virtualenv and activate it
- Install dependencies:
pip install -r requirements.txt
- Build a postgresql database and add it to a
DATABASE_URL
env variable - Get a Goodread API key and add it to a
GR_KEY
env variable - Add
application.py
to aFLASK_APP
env variable and run the serverflask run
- Open http://127.0.0.1:5000 in a browser.