Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use qt and django to create desktop apps

I had this idea of creating desktop apps using django. The principe being: - Write the django app, and use something like cherrypy to serve it. - Write a Qt app in C++ to access it and this by using QtWebview (webkit)

I'd like to "bundle" this in a single app. The lighter, the better :)

So here are my questions and if you have better ideas and suggestions, please share them :)

  • Is it possible to serve a django app with a c++ one? (a c++ server embedding python)?
  • anyone did this before? Do you have some articles, blog posts?

Thanks a lot!

like image 309
sandra Avatar asked May 08 '10 00:05

sandra


People also ask

Can I build a desktop app with Django?

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.

Is PYQT good for desktop application?

Compared to Electron and JavaScript, PyQt5 might not be the popular tool to build desktop apps, but it's very effective. Web apps are very popular, but there are still times when only a desktop app can deliver a great user experience.

Is it possible to create desktop application with Python?

Creating a desktop application by using Python is pretty simple. If you're a beginner you can select the basic level libraries for practice. You can also build real world advanced desktop applications by Python coding. In this article, you've learned the basics of how you can build desktop applications.

Can you use Django for apps?

It is important to understand that a Django application is a set of code that interacts with various parts of the framework. There's no such thing as an Application object. However, there's a few places where Django needs to interact with installed applications, mainly for configuration and also for introspection.


2 Answers

Django has it's own server. Why involve CherryPy?

You're creating a hellaciously complex architecture for no recognizable purpose. Your comments are almost impossible to parse in the context of your question. Please consider rewriting the question to address your actual concerns with an actual thing you actually wrote.

"I ... used pywxiwdgets in the past and it was SLOW"

There are many of desktop frameworks. Use another one.

Don't introduce Django -- it's for web applications, not desktop applications. The overhead of messing with Django and CherryPy is silly.

Find the original reason for SLOW. I'll bet it was database slowness from using SQLite. If not that, I'll bet it was a poor data model. If not that I'll be it was poor use of the pywxwidgets. If not that, I'll bet your desktop app made internet connections that were slow. Indeed, I'd bet that almost any part of your app was the culprit and making a super-complex architecture will not make things faster, just more complex.

Until you identify -- and measure -- the original cause for slowness, you're not actually solving the actual problem you actually had.

like image 52
S.Lott Avatar answered Sep 24 '22 13:09

S.Lott


Look at http://www.python-camelot.com/

It says "A python GUI framework on top of Sqlalchemy and PyQt, inspired by the Django admin interface."

like image 44
dorian Avatar answered Sep 26 '22 13:09

dorian