This website is for reviewing books. The application allows users to register / login / logout, search for books, leave a review for individual books, and see reviews made by other people. The application also allows users to see book information and reviews made by other people using the Goodreads API. Finally, book details and reviews can be queried programmatically via a custom API.
- Set
api_keyenvironment variable to your Goodreads API key. - Set
secret_keyenvironment variable to your Flask secret key. - Set
DATABASE_URLenvironment variable to the address of your Heroku database. - When in the same directory as
application.py, executeflask runto launch the application.
- All files stored within the
Books404youdirectory. - CSS and image files stored within the
staticdirectory. - HTML files stored within the
templatesdirectory. - Website Flask / Python code stored within
application.py. books_tables: SQL code for three database tables.books.csv: CSV file of 5000 booksimport.py:Python code to upload CSV file contents to a database table.
To view a book's details in JSON format, navigate to .../api/ISBN_NUMBER. JSON returns data in the following format:
{
"title": "Memory",
"author": "Doug Lloyd",
"year": 2015,
"isbn": "1632168146",
"review_count": 28,
"average_score": 5.0
}