DEV Community 👩‍💻👨‍💻

Cover image for flask blog app
Benjamin Rukundo
Benjamin Rukundo

Posted on

flask blog app

flask blog app

Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. However, Flask supports extensions that can add application features as if they were implemented in Flask itself.

Our last project to be done for the lux tech academy was making an application/system that has all the features a login authentication system should have, these features are:

  • Users can log in only if their credentials are present in the database.

  • Without logging in, the user cannot go to the next page, even using that particular page's routes.

  • When logged in, the user can go to other pages using routes.

  • After clicking on logout, the user cannot go to the next page again using routes.

  • If the email or username already exists in the database, the user will not create the account.

Requirements needed

Create an environment

Create a project folder and a venv folder within:

macOS/LinuxWindows

> mkdir myproject
> cd myproject
> py -3 -m venv venv
Enter fullscreen mode Exit fullscreen mode

Activate the environment

Before you work on your project, activate the corresponding environment:

macOS/LinuxWindows

> venv\Scripts\activate
Enter fullscreen mode Exit fullscreen mode

Your shell prompt will change to show the name of the activated environment.

Install Flask
Within the activated environment, use the following command to install Flask:

$ pip install Flask
To Run the code
still in your virtual enviroment:
set FLASK_APP=nameOfFile
Enter fullscreen mode Exit fullscreen mode

lastly,

flask run
Enter fullscreen mode Exit fullscreen mode

I have had an amazing experience through this bootcamp and I have been able to learn way a lot thus being very much grateful.
Check out the code here

Top comments (0)

Version 0 beta

Stop by this week's meme thread!