Difference between revisions of "PyFlaskBootstrap4"

From BITPlan Wiki
Jump to navigation Jump to search
Line 27: Line 27:
 
# [https://github.com/WolfgangFahl/pyFlaskBootstrap4/issues/9 login blueprint]
 
# [https://github.com/WolfgangFahl/pyFlaskBootstrap4/issues/9 login blueprint]
 
# [https://datatables.net/examples/styling/bootstrap4 datatables]
 
# [https://datatables.net/examples/styling/bootstrap4 datatables]
 +
# Server Sent Event Support
  
 
= Demos =
 
= Demos =

Revision as of 19:35, 12 February 2021

OsProject
edit
id  PyFlaskBootstrap4
state  
owner  WolfgangFahl
title  Flask + Bootstrap 4 static components and templates for webprojects
url  https://github.com/WolfgangFahl/pyFlaskBootstrap4
version  0.0.4
description  
date  2021/01/09
since  
until  

What is it?

A python library to get

as a combined solution with some extra functionality. This project builds on

and adds support for

  1. SQLAlchemy-Utils custom data types and utility functions
  2. WTForms data validation, CSRF protection, I18N and more
  3. pydevd remote debugging support
  4. Using flask inside class
  5. Widgets
  6. login blueprint
  7. datatables
  8. Server Sent Event Support

Demos

see

Installation

pip install pyFlaskBootstrap4

Tutorial

HelloWeb application

see helloweb.py

'''
Created on 2021-01-08

This is a demo application for https://github.com/WolfgangFahl/pyFlaskBootstrap4

@author: wf
'''
from fb4.app import AppWrap
from flask import render_template

class HelloWeb(AppWrap):
    '''
    a sample web application
    '''

    def __init__(self):
        '''
        Constructor
        '''
        super().__init__()
        
    def home(self):
        '''
        render the home page of the HelloWeb application
        '''
        html = render_template("bootstrap.html", title="HelloWeb demo application",content="Welcome to the Flask + Bootstrap4 Demo web application",error=None)
        return html
    
helloWeb=HelloWeb()
app=helloWeb.app 
@app.route('/')
def home():
    return helloWeb.home()

if __name__ == '__main__':
    parser=helloWeb.getParser("Flask + Bootstrap4 Demo Web Application")
    args=parser.parse_args()
    helloWeb.optionalDebug(args)
    helloWeb.run(args)

Links