app-generator / sample-flask-bootstrap

How to use Bootstrap with Flask - Free Sample | AppSeed

Home Page:https://appseed.us

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use Bootstrap with Flask

Open-source Flask project enhanced with session-based authentication via Flask-Login and a simple UI powered by Bootstrap. For newcomers, Flask is a popular web framework used to code from simple one-page websites to complex eCommerce solutions and Bootstrap is the most popular JS/CSS framework.


Features

Have questions? Contact Support (Email & Discord) provided by AppSeed

Free Version PRO Version πŸš€ Custom - $3,999
βœ“ Bootstrap 5 Everything in Free, plus: Everything in PRO, plus:
βœ“ Flask-Login βœ… Premium Bootstrap 5 Design βœ… 1mo Custom Development
βœ“ Session-based Authentication βœ… Auth Provided by Flask-Security-Too βœ… Dedicated Developer
- βœ… Extended User Model βœ… Weekly Sprints
- βœ… Users Roles βœ… Technical SPECS
- βœ… Private REPO Access βœ… Documentation
- βœ… PRO Support - Email & Discord βœ… 30 days Delivery Warranty
- βœ… Deployment Assistance -
- - -
--------------------------------- --------------------------------- ---------------------------------
βœ“ LIVE Demo πŸš€ LIVE Demo PRO πŸ›’ Order: $3,999 (GUMROAD)

Flask User Authentication - Free sample provided by AppSeed.


Build from sources

πŸ‘‰ Step #1 - Clone sources (this repo)

$ git clone https://github.com/app-generator/sample-flask-bootstrap.git
$ cd sample-flask-bootstrap

πŸ‘‰ Step #2 - Create a virtual environment

$ # Virtualenv modules installation (Unix based systems)
$ virtualenv env
$ source env/bin/activate
$
$ # Virtualenv modules installation (Windows based systems)
$ # virtualenv env
$ # .\env\Scripts\activate

πŸ‘‰ Step #3 - Install dependencies

$ # Install requirements
$ pip3 install -r requirements.txt

πŸ‘‰ Step #4 - Set Up Environment

$ # Set the FLASK_APP environment variable
$ (Unix/Mac) export FLASK_APP=run.py
$ (Windows) set FLASK_APP=run.py
$ (Powershell) $env:FLASK_APP = ".\run.py"

πŸ‘‰ Step #5 - Create Tables (SQLite persistance)

$ # Create tables
$ flask shell
$ >>> from app import db
$ >>> db.create_all()

πŸ‘‰ Step #6 - (optional) Enable DEBUG Environment (local development)

$ # Set up the DEBUG environment
$ # (Unix/Mac) export FLASK_ENV=development
$ # (Windows) set FLASK_ENV=development
$ # (Powershell) $env:FLASK_ENV = "development"

πŸ‘‰ Step #7 - Start the project

$ # Run the application
$ # --host=0.0.0.0 - expose the app on all network interfaces (default 127.0.0.1)
$ # --port=5000    - specify the app port (default 5000)  
$ flask run --host=0.0.0.0 --port=5000
$
$ # Access the app in browser: http://127.0.0.1:5000/

Code-base structure

The project has a super simple structure, represented as bellow:

< PROJECT ROOT >
   |
   |-- app/
   |    |-- static/
   |    |    |-- <css, JS, images>    # CSS files, Javascripts files
   |    |
   |    |-- templates/
   |    |    |
   |    |    |-- index.html           # Index File
   |    |    |-- login.html           # Login Page
   |    |    |-- register.html        # Registration Page
   |    |    
   |    |
   |   config.py                      # Provides APP Configuration 
   |   forms.py                       # Defines Forms (login, register) 
   |   models.py                      # Defines app models 
   |   views.py                       # Application Routes 
   |
   |-- requirements.txt
   |-- run.py
   |
   |-- ************************************************************************

Resources



How to use Bootstrap with Flask - Free sample provided by AppSeed.

About

How to use Bootstrap with Flask - Free Sample | AppSeed

https://appseed.us

License:Other


Languages

Language:CSS 46.1%Language:HTML 40.1%Language:SCSS 12.7%Language:Python 0.6%Language:JavaScript 0.5%