DEV Community

Alin Climente
Alin Climente

Posted on • Edited on

6 4

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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay