All Projects → ClimenteA → Flaskwebgui

ClimenteA / Flaskwebgui

Licence: mit
Create desktop applications with Flask (or Django)!

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Flaskwebgui

Db Seeder
A database seeder app for MySQL
Stars: ✭ 77 (-55.49%)
Mutual labels:  desktop-application
Logfx
LogFX is a simple Log reader supporting color highlighting and able to handle giant files.
Stars: ✭ 109 (-36.99%)
Mutual labels:  desktop-application
Autokey
AutoKey, a desktop automation utility for Linux and X11, formerly hosted at OldAutoKey. Updated to run on Python 3.
Stars: ✭ 2,095 (+1110.98%)
Mutual labels:  desktop-application
Ezlayoutdisplay
Learn your custom layout quickly and easily by displaying your ErgoDox layout right from your desktop !
Stars: ✭ 84 (-51.45%)
Mutual labels:  desktop-application
Bookmark
[NOT MAINTAINED] Desktop app to manage bookmarked links using Atom Electron and Vue.js.
Stars: ✭ 97 (-43.93%)
Mutual labels:  desktop-application
Chirp
🐦 A cross platform twitter application
Stars: ✭ 129 (-25.43%)
Mutual labels:  desktop-application
Subethaedit
General purpose plain text editor for macOS. Widely known for its live collaboration feature.
Stars: ✭ 1,183 (+583.82%)
Mutual labels:  desktop-application
Applicationbuilder.jl
[deprecated] Compile, bundle, and release julia software
Stars: ✭ 167 (-3.47%)
Mutual labels:  desktop-application
Open Exam Suite
This project seeks to create an open source exam designer and simulator that will be solace for those wanting to take any simulated examinations.
Stars: ✭ 101 (-41.62%)
Mutual labels:  desktop-application
Crashreporter.net
Send crash reports of your classic desktop application developed using .NET Framework directly to your mail's inbox with full exception report, stack trace and screenshot.
Stars: ✭ 134 (-22.54%)
Mutual labels:  desktop-application
Runjs
A JavaScript playground that auto-evaluates as you type
Stars: ✭ 1,266 (+631.79%)
Mutual labels:  desktop-application
Library Management System Java
📚 A sophisticated Library Management System designed in Java while following the concepts of decoupled layers (entities) and minimal code in interface (GUI).
Stars: ✭ 96 (-44.51%)
Mutual labels:  desktop-application
Autoupdater.net
AutoUpdater.NET is a class library that allows .NET developers to easily add auto update functionality to their classic desktop application projects.
Stars: ✭ 1,958 (+1031.79%)
Mutual labels:  desktop-application
Quick Screen Recorder
Lightweight desktop screen recorder for Windows.
Stars: ✭ 80 (-53.76%)
Mutual labels:  desktop-application
Raven Reader
📖 All your articles in one place. Beautiful.
Stars: ✭ 2,040 (+1079.19%)
Mutual labels:  desktop-application
Zeal
Offline documentation browser inspired by Dash
Stars: ✭ 9,164 (+5197.11%)
Mutual labels:  desktop-application
Youtube2audio
Desktop application to download YouTube videos as annotated MP3 or MP4 files
Stars: ✭ 128 (-26.01%)
Mutual labels:  desktop-application
Frameless Titlebar
Customizable Electron Titlebar for frameless windows
Stars: ✭ 167 (-3.47%)
Mutual labels:  desktop-application
Nuxhash
A NiceHash cryptocurrency mining client for Linux.
Stars: ✭ 150 (-13.29%)
Mutual labels:  desktop-application
Electron Python Example
Electron as GUI of Python Applications
Stars: ✭ 1,749 (+910.98%)
Mutual labels:  desktop-application

Create desktop applications with Flask/Django!

Downloads

Install

pip install flaskwebgui

Or download source file flaskwebgui.py and place it where you need.

Usage with Flask

Add bellow js code to your base.html (or to your script.js file)

<script>

document.addEventListener('DOMContentLoaded', function() {

    var url = 'http://127.0.0.1:5001/GUI-is-still-open'; 
    fetch(url, { mode: 'no-cors'});
    setInterval(function(){ fetch(url, { mode: 'no-cors'});}, 5000)();

});

</script>

In your main python file add bellow 3 lines of code

from flask import Flask
from flaskwebgui import FlaskUI #get the FlaskUI class

app = Flask(__name__)

# Feed it the flask app instance 
ui = FlaskUI(app)

# do your logic as usual in Flask
@app.route("/")
def index():
  return "It works!"

# call the 'run' method
ui.run()

Usage with Django

Make a file 'gui.py'(file name not important) next to 'manage.py' file in the django project folder.

Add the js code like we did it up.

Inside 'gui.py' file add these 2 lines of code:

from flaskwebgui import FlaskUI #import FlaskUI class

#You can also call the run function on FlaskUI class instantiation

FlaskUI(server='django').run()

Next run from your terminal the bellow command:

python gui.py

Configurations

Default FlaskUI class parameters:

  • app, ==> flask class instance

  • width=800 ==> default width 800

  • height=600 ==> default height 600

  • fullscreen=False ==> start app in fullscreen

  • maximized=False ==> start app in maximized window

  • app_mode=True ==> by default it will start chrome in app(desktop) mode without address bar

  • browser_path="" ==> path to browser.exe (absolute path to chrome C:/browser_folder/chrome.exe)

  • server="flask" ==> the default backend framework is flask (django is suported also), you can add a function which starts the desired server for your choosed framework (bottle, web2py pyramid etc)

  • port=5000 ==> specify other if needed, make sure to add port+1 in the js script

  • socketio=SocketIO Instance ==> Flask SocketIO instance (if specified, uses socketio.run() instead of app.run() for Flask application)

Should work on windows/linux/mac with no isssues.

Develop your app as you would normally do, add flaskwebgui at the end or for tests. flaskwebgui doesn't interfere with your way of doing a flask application it just helps converting it into a desktop app more easily with pyinstaller or pyvan.

Distribution

You can distribute it as a standalone desktop app with pyinstaller or pyvan.

Credits

It's a combination of https://github.com/Widdershin/flask-desktop and https://github.com/ChrisKnott/Eel

flaskwebgui just uses threading to start a flask server and the browser in app mode (for chrome). It has some advantages over flask-desktop because it doesn't use PyQt5, so you won't have any issues regarding licensing and over Eel because you don't need to learn any logic other than Flask/Django.

Submit any questions/issues you have! Fell free to fork it and improve it!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].