← Back to Projects
MkViewer - Login Page [Read-Only]
Initializing MkViewer...
README.md

Project 61 - πŸ” Flask Secrets Login App

A simple Flask web application that demonstrates form handling, validation, authentication logic, and CSRF protection using Flask-WTF. Users must log in with the correct credentials to access a β€œtop secret” pageβ€”otherwise, access is denied (with a meme).

This project is primarily for learning purposes, not production security. (README Made by AI)


πŸš€ Features

  • Flask backend with multiple routes
  • Secure random SECRET_KEY generation using Python’s secrets module
  • Login form built with Flask-WTF
  • Email validation using email-validator
  • Password length enforcement
  • CSRF protection
  • Success / Access Denied pages
  • Clean separation of templates

🧠 What This Project Teaches

  • How Flask routing works
  • How to use FlaskForm and WTForms
  • Server-side form validation
  • CSRF protection in Flask
  • Basic authentication logic
  • Rendering templates with Jinja2

πŸ“‚ Project Structure

. β”œβ”€β”€ main.py β”œβ”€β”€ requirements.txt └── templates β”œβ”€β”€ index.html β”œβ”€β”€ login.html β”œβ”€β”€ success.html └── denied.html


πŸ› οΈ Installation & Setup

1️⃣ Clone the repository

bash git clone https://github.com/your-username/your-repo-name.git cd your-repo-name

2️⃣ Install dependencies

Windows

bash python -m pip install -r requirements.txt

macOS / Linux

bash pip3 install -r requirements.txt


3️⃣ Run the app

bash python main.py

The app will start on:

http://127.0.0.1:5000/


πŸ”‘ Login Credentials

Use the following credentials to access the secret page:

  • Email: admin@email.com
  • Password: 12345678

Anything else will result in Access Denied.

⚠️ These credentials are hardcoded and are for demonstration only.


πŸ” Security Notes

  • A new random SECRET_KEY is generated on every app startup
  • Passwords are not hashed
  • No database is used
  • Not intended for real authentication systems

This project focuses on learning Flask fundamentals, not production-grade security.


πŸ“¦ Dependencies

From requirements.txt:

  • Flask
  • Flask-WTF
  • WTForms
  • Bootstrap-Flask
  • Werkzeug
  • email-validator

πŸ“Έ Screens

  • Home page β†’ Welcome + Login button
  • Login page β†’ Email + password validation
  • Success page β†’ Rickroll πŸ˜„
  • Denied page β†’ Dog fail meme 🐢

πŸ§ͺ Ideas to Improve

  • Hash passwords using werkzeug.security
  • Store users in a database (SQLite)
  • Add registration
  • Improve styling with Bootstrap
  • Add sessions instead of direct comparison

πŸ“œ License

This project is open-source and free to use for educational purposes.