Search code examples
djangodatabaseservercross-platformdesktop-application

Is it reliable to build desktop applications using web frameworks like Django?


Is it reliable to build desktop applications using web frameworks like Django?

The idea is to

  • build the interface with HTML, CSS, and JavaScript
  • use Python and Django for backend operations (calculations, storage and databases, etc)

and then run a server locally so that

  • the interaction with the application is done through the browser
  • other local devices can access the application by connecting to the device on which the server is running.

If that is possible and yields a reliable experience, then

  • is the development server that comes with Django enough? If no, what servers are most suitable for our purpose? Is Nginx good for example?
  • what database should be used? PostgreSQL, MySQL, etc? The app will need to store a large number of entries.

Solution

  • I've never done this, but I can't see why not. You can use the Django REST Framework to create an API that your desktop application can talk to, in exactly the same way as you might with a JavaScript single page app.

    But no, you should not use the dev server for production, even in a limited scenario like this. Apache/mod_wsgi or nginx/gunicorn are simple to set up and deploy.

    For the database, it makes no difference. The Django core devs prefer postgres, but you should use whatever you are comfortable with.