将django项目编译为桌面应用程序 [英] Compiling django project as a desktop application
问题描述
我做了一些研究,发现一些解决方案来编译python。这些解决方案是:
- cx_freeze
- py2exe
- pyinstaller(这个声称它支持django但仍未发布)
- dbuilder.py
那个桌面应用程序主要在Windows上运行,但是如果我能找到一个可以在Linux和Mac上运行的解决方案,那将是很棒的。
有没有人设法做到这一点?如果是这样,你能指出我正确的方向吗?
谢谢。
是的,我在OSX上这样做。这不简单,据我所知,我可能是第一个在OSX上成功实现的人,所以YMMV。
Pyinstaller,截至3月份,wasn对Django的支持已经做好了准备。我已经提交了几张机票,当我试图使用它来打包我的应用程序,我承认没有解决这些问题。
我用py2app,最终,因为我有其他应用程序的经验。我用py2app和Django做了一个示例项目,并将其放在 Github 上。你可能会发现它很有用。我还链接了我在这个过程中发现有用的几个页面,我在下面包含了:
https://groups.google.com/forum/?fromgroups=#!topic/django-users/-VGqvHew35g
http://misunderstandings.wordpress.com/2008/06/26/django-desktop-app/
https://bitbucket.org/Lawouach/cherrypy-recipes/src/9c35b4b62ef1/frameworks / django_?at = default
如果我不得不这样做,我可能会使用SQLAlchemy和wxPython或PySide。我建议您仔细考虑您想要使用Django作为打包的应用程序,因为它引入了很多复杂性。
I have a web application that I would like to have a version of it on the desktop. It would be totally awesome if i can just compile it rather than rewrite it. (I can't give the customer the code unfortunately)
I did some research and found some solutions to compile python in general. These solutions are:
- cx_freeze
- py2exe
- pyinstaller (this one claims it has support for django but still unreleased)
- dbuilder.py
That desktop application will run mainly on Windows, but if I can find a solution that would make it run on Linux and Mac too it would be great.
Did anyone manage to do this properly ? If so, can you please point me to the right direction?
Thanks.
Yes, I am doing this on OSX. It's not simple and, as far as I can tell, I may be the first person to successfully do it on OSX, so YMMV.
Pyinstaller, as of March, wasn't quite ready for Django support. I've filed a few tickets from when I tried to use it to package my application and I have admittedly not fixed those issues yet.
I went with py2app, ultimately, because I had prior experience with it for other applications. I made a sample project with py2app and Django and put it on Github. You may find it useful. I also linked a few of the pages that I found useful in the process, which I've included below:
https://groups.google.com/forum/?fromgroups=#!topic/django-users/-VGqvHew35g
http://misunderstandings.wordpress.com/2008/06/26/django-desktop-app/
https://bitbucket.org/Lawouach/cherrypy-recipes/src/9c35b4b62ef1/frameworks/django_?at=default
If I had to do it again, I would probably use SQLAlchemy and wxPython or PySide. I'd recommend thinking carefully about what you'd like to achieve using Django as a packaged application because it introduces a lot of complexity.
这篇关于将django项目编译为桌面应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!