Key concepts:
Basic HTML and CSS (Bootstrap);
CRUD operations with SQLlite and SQL Alchemy - Relational Databases;
FlaskFramework - Basic Functionalities;
FlaskLogin - Authentication
Python Decorators
Crete a mobile responsive Blog Website to host posts and comments with Authentication feature. And deploy the app on Heroku. As there is a chance that the blog will not be hosted for a long time, the basic app features are presented below.
The Home Page display a NaviBar with : Home, Login, Register, About, Contact Create New Post redirects you to the Forms to create a new post. The acess is retritcted to Admin Only. To that the login is necessary.
We have two entries of a Flask-WTForm - one for the email and the other for the password. When submitted, it will be checked against the user database. If it is a register user will have the permission to comment, if admin can create a new post too.
In this section is displayed the form to create a new blog post. With a title, subtitle, img_url and body sections to fill. The data from the for is stored with SQLAlchemy after the POST request (submit button).
Now, when we redirect to the home page we can see the new blog post presented with it's title, subtitle and the user who post it.
Here we see the complete post, the edit button and the comment form. If we submit a comment:
When the 'edit post' page is loaded, the forms are automatically filled with the post information to be edited.
If user that is not the admin and tries to edit or create a post:
We can see that the relationship between the tables and the hashing of the password is working properly. There are a few comments in the code highlighting some key structures and resources used.