DEV Community

Alin Climente
Alin Climente

Posted on • Updated on

Desktop apps with Django without Electronjs

Not only JS folks can reuse web tehnologies for desktop applications we can do it too. If you want to create a nice gui and you want to reuse your web tech knowledge try flaskwebgui.

First, install it:

pip install flaskwebgui
Enter fullscreen mode Exit fullscreen mode

Next to manage.py file create a gui.py file where you need to import application from project's wsgi.py file.

├── project_name
│   ├── asgi.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── gui.py # this 
├── manage.py
Enter fullscreen mode Exit fullscreen mode
#gui.py

from flaskwebgui import FlaskUI
from project_name.wsgi import application

FlaskUI(application).run()

Enter fullscreen mode Exit fullscreen mode

Next start the application with:

python gui.py  
Enter fullscreen mode Exit fullscreen mode

Django will be served by waitress.

Also, you can use any frontend framework you like + any python web framework you like, just pass a function which starts the server to start_server parameter.

Discussion (0)