Code up the main.py index.html and add.html so that the following requirements are met:
When you head over to http://locahost:5000 (or whatever shows up as your URL when you run main.py), you should have a <h1> that says My Library and link <a> to Add New Book.
e.g.
When you head over to the /add path, e.g. http://locahost:5000/add you should see a form like the one below:
Make the form on the /add path work so that when you click "Add Book" the book details gets added as a dictionary to the list called all_books
in main.py.
The data structure of all_books
should be a List of Dictionary objects. e.g
all_books = [ { "title": "Harry Potter", "author": "J. K. Rowling", "rating": 9, } ]
Make the home page show each of the books in all_books
as a list item <li> in an unordered list <ul> e.g.
Make the home page show <p>Library is empty.</p>
if there are no books. Also, make sure the "Add New Book" link works and takes the user to the /add page.
Hint: If there are no books then all_books = []
e.g.