I am new with Django. I need to quickly develop a sophisticated GUI for a Django project. My underlying database is resource description framework (RDF). Is there any Eclipse IDE available for quick Django GUI development? Or is there any other GUI development tool (provides widgets) available for Django based project?
JetBrains has a Product for Python developers with Django support.
Its not for free but you can try it for 30 days.
https://www.jetbrains.com/pycharm/
Django is a web framework. It doesn't have a GUI. Though there are many IDEs that support Django template syntax, none of them will provide any kind of GUI functionality.
As far as IDEs go, Jetbrains is good, Eclipse has pretty decent python support, though I'm a big fan of sublime texts smart simplicity.
As for GUI stuff, perhaps rethink a little here. Django is a web framework that deals best with transactional interaction. It fires you a web page, you fire it a response. The system isn't really a good fit to GUI stuff. Thats not to say it can't play a part. Instead consider splitting it into a client/server product. Both TastyPie and Django Rest Framework are good options for building a RESTful API that can be interrogated by a remote client. You can then build the client using either one of the visual studio suites, or delphi, or if your looking to stay within the python mothership, perhaps PyQT/PySide (Which include a visual form designer) would be more up your alley. I guess you could build djangos ORM into an app (Although personally I'd use SQLAlchemy for that as its more decoupled than djangos ORM), but I'd warn that direct network access to databases isn't generally held to be wise for obvious security reasons, and you need to have a have a hard think about the threading implications if your gui toolkit is multithreaded, because Djangos ORM isn't built with the assumption it'll need to deal with multiple threads over single objects. My 0.02c is use Django to build an API and PyQT (or whateer your comfortable with) for the front end.
GUI is a term more for desktops, frontend is for web, for more see https://en.wikipedia.org/wiki/Graphical_user_interface.
Try any HTML5 WISWYG editor to make frontend (probably responsive) design.
More no this look in https://softwareengineering.stackexchange.com/questions/148489/how-to-develop-front-end-ui-for-my-django-website
Related
I need to write a very light database (sqlite is fine) app that will initially be run locally on a clients windows PC but could, should it ever be necessary, be upgraded to work over the public interwebs without a complete rewrite.
My end user is not very technically inclined and I'd like to keep things as simple as posible. To that end I really want to avoid having to install a local webserver, however "easy" that may seem to you or I. Django specifically warns not to use it's inbuilt webserver in production so my two options seem to be...
a) Use django's built in server anyway while the app is running locally on windows and, if it ever needs to be upgraded to work over the net just stick it behind apache on a linux box somewhere in the cloud.
b) Use a framework that has a more robust built in web server from the start.
My understanding is that the only two disadvantages of django's built in server are a lack of security testing (moot if running only locally) and it's single threaded nature (not likely to be a big deal either for a low/zero concurrency single user app running locally). Am I way off base?
If so, then can I get some other "full stack" framework recommendations please - I strongly prefer python but I'm open to PHP and ruby based solutions too if there's no clear python winner. I'm probably going to have to support this app for a decade or more so I'd rather not use anything too new or esoteric unless it's from developers with some serious pedigree.
Thanks for your advice :)
Roger
I find Django's admin very easy to use for non-technical clients. In fact, that is the major consideration for my using Django as of late. Once set up properly, non-technical people can very easily update information, which can reflected on the front end immediately.
The client feels empowered.
Use Django. It's very simple for you to get started. Also, they have the best documentation. Follow the step by step app creating tutorial. Django supports all the databases that exist. Also, the built in server is very simple to use for the development and production server. I would highly recommend Django.
I'm trying to build a desktop application using Python. To make it able to be used on as many platforms as possible, I think web UI may be a good choice. This boils down to the problem of making a local HTTP server first. I did some survey and found that people are mainly talking about BaseHTTPServer and SimpleHTTPServer. For prototyping, subclassing them may suffice.
Besides pure prototyping, I also want to leave some room for extension to real service. That is, once mature, I'd like to move the codes to a real dedicated HTTP server, so that end users only need a browser to use it.
I say "extensible" in the following sense:
The code modification is as minimum as possible in the migration process.
I will focus on algorithm in the prototyping stage. I also want to leave some room for future front end designer.
It looks WSGI + Django is a widely mentioned combination. After some search, what I found is using WSGI in apache or nginx. Is it possible to use self-contained modules? i.e. wsgiref + Django, so that I can start everything just from one entry script. I don't want to bother potential first adopters by asking them install apache and configure it. It will be very good if you have sample codes or pointers for further reading.
I'm new to Python and web programming in Python. Thanks for your help. I just try to make sure I'm on the right track. My underlying algorithms is implemented in Python 2.7. So the UI solution had better also be in Python 2.7.
I think what you may want is Bottle. It is a web framework that only needs the standard library to be installed. It also has compatibility with many other production servers, as well as shipping with it's own development server. And if that isn't good enough, it is all in a single file, and has support with many different templating languages, as well as it's own built in templating language.
Check it out here: http://bottlepy.org/docs/dev/
As mentioned bottle is a good choice, I personally like Flask, which if I recall correctly is what bottle is based off of. Anyways there are three things that really make Flask a joy to use.
Blueprints - essentially an application architecture
Flask-Sijax - allows for comet technology
Celery - an asynchronous task queue/job queue based on distributed message passing
there are a lot of other plugins, including one for an admin interface that I haven't tried out yet but it looks promising, and it works with Python 2.7
I dealt with GAE before and I like simplicity of its webapp. Now I am trying to learn how to work with Amazon EC2. My question - where do I start to make a simple web application that I will be able to access form browser? I suppose I should use WSGI for this purpose. I don't want to use Django as I want to keep the application small and lightweight without unnecessary features. What can you recommend? Thanks.
AWS and GAE are very different. GAE very strictly defines what you can and can't do in terms of development environment. AWS gives you a server to do whatever you want with.
GAE is good when you don't want to have to figure out how all the pieces fit together to scale well. AWS is good when you need flexibility to do whatever you want in your environment.
So to answer your question -- you can use any framework / environment you like.
Personally, I like Django/Pinax for anything requiring a user system. You want a lighter weight system, I've heard good things about Pylons.
Here's a listing of a few others:
http://wiki.python.org/moin/WebFrameworks
Since we're talking AWS, it doesn't have to be python. Ruby on Rails is great.
As already mentioned, you have a lot more flexibility with Amazon than with GAE. If you want to stick with Python and would like to be able to access your app through your browser, you might consider web2py, which enables you to edit and manage your apps through a web-based IDE and admin interface (see demo).
web2py was designed for ease of use and developer productivity, so it's very easy to learn and get going quickly, and you can get a lot done with very little code. Although it's easy to do simple (and even not-so-simple) things quickly and easily, if your app gets more complex, web2py can handle that too, as it is a well-integrated full-stack framework with lots of built-in functionality, including a database abstraction layer, form handling and validation, access control, web services, and easy Ajax integration.
web2py runs on GAE out of the box, and web2py apps are portable from GAE to other platforms without requiring any code changes. However, if you're looking for a simple, scalable cloud hosting option with more flexibility than GAE, you might take a look at the new DotCloud (still in beta), which actually runs on EC2. There's a demo web2py app running there now, and a tutorial explaining the simple deployment process.
If you have any questions about web2py, you'll get lots of help from the friendly and responsive mailing list. I know some of the users have hosted web2py apps on EC2. For example, this demo Q&A site powered by web2py is hosted on EC2.
I am in the planning stages of rewriting an Access db I wrote several years ago in a full fledged program. I have very slight experience coding, but not enough to call myself a programmer by far. I'll definitely be learning as I go, so I'd like to keep everything as simple as possible. I've decided on Python and SQLite for my program, but I need help on my next decision.
Here is my situation
1) It'll be run locally on each machine, all Windows computers
2) I would really like a nice looking GUI with colors, nice screens, menus, lists, etc,
3) I'm thinking about using a browser interface because (a) from what I've read, browser apps
can look really great, and (b) I understand there are lots of free tools to assist in setting up the GUI/GUI code with drag and drop tools, so that helps my "keep it simple" goal.
4) I want the program to be totally portable so it runs completely from one single folder on a user's PC, with no installation(s) needed for it to run
(If I did it as a browser app, isn't there the possibility that a user's browser settings could affect or break the app. How likely is this?)
For my situation, should/could I make it a browser app? What would be the pros and cons for my situation?
Writing a desktop application as a locally-hosted web application isn't typically a good idea. Although it's possible to create great user interfaces with HTML, CSS, and Javascript, it's far easier to create interfaces with conventional GUI frameworks.
Using web technologies to create your desktop GUI would introduce a great deal of unnecessary complexity to your application.
Creating user interfaces with HTML and CSS is difficult and time-consuming. HTML is a document markup language and CSS is a document formatting language; neither is well-suited to creating GUIs.
Using web technologies makes your application depend on the user's web browser. Far too many people are still using old, crippled browsers such as IE 6 and 7 that don't follow modern standards. You'll spend hours if not days trying to track down interface bugs that only happen on certain browsers.
You'll need to serve your application with a web server, introducing another layer of complexity. Your application will have to communicate with your interface through restricted web technologies without any of the benefits of a true web application.
I recommend using a desktop GUI framework, instead. In particular, I think wxPython would be the best GUI framework for you to use; it's stable, widely used, well documented, and highly portable. In addition, you can use a GUI-based interface builder such as Boa Constructor or possibly wxGlade to design your application's user interface. In summary, creating an application with almost any desktop GUI framework would be easier than using web technologies.
I've done a desktop app running on windows and I think that it is a great way to develop app.
I would recommend to have a look at bottle. It is a lightweight web framework. It is less capabale than Django for example but it does well. It can be packed with py2exe if you want to deploy on machines without Python.
There is a lot of javascript libs on the web to help you. I like jquery and jquery-ui, raphaeljs ... but there are some others.
My app is running into a small browser based on the mshtml component of Pyjama-Desktop. This way, the user doesn't know that it is a web app. But you could let the app running into the favorite browser, webbrowser python module might be interesting for you.
If your app needs to access your filesystem, a browser-based app may be tricky. For security reasons, a browser doesn't have full access to your filesystem. However, you can mimick file open with ajaxupload and file save with an iframe.
If it only deals with a sqllite database, i think that it is a very good choice.
I hope it helps
Pyjamas-Desktop
You did not mention if you are on windows or linux or any other OS.
If you are writing a browser app the first thing you are going to need is a web server, if each user is running the app on his local machine => means each user has to have a webserver running locally.
Also there are a lot of Rapid Development GUI toolkits such as wxPython and Glade which make design of GUI apps simple and easier.
I would suggest that if you are building a network app -> Take the browser route.
If you are building standalone app then go with a native application.
Here is an almost exhaustive list of all the frameworks. you can choose whatever suits your needs.
http://wiki.python.org/moin/GuiProgramming
I personally favor PyGtk, however it has a little learning curve associated with it if you havent done any GUI programming before.
I think it should work. What are you afraid of? Proxy settings, firewall?
I think running web server locally isn't hard for power user but it could be a problem for average user (even integrated with your app).
Probably You should run your app as service because forcing user to start server before entering web page, could be frustrating.
I would prefer other solutions. I would probably use Java (Swing) or C++ with QT. But I like Your approach, especially that it allows easy prototyping. If You prefer web style development you could try http://www.appcelerator.com/products/titanium-desktop-application-development/ it creates desktop apps using html+java script +webkit. But I didn't tried it my self (but I would like to).
Also Adobe Air could be probably good option for You.
I would suggest a browser application. This eliminates the need for installation on client computers (and as such, as OS agnostic), and is accessible from anywhere in the world if the DNS is set up correctly for the server.
Using a web interface allows you to make use of some of the more powerful User Interface tools, such as:
The ability to use CSS for spectacular design
The availability of JavaScript Utilities (jQuery, ExtJS, etc.)
Easily modified compared to Desktop applications
Higher accessibility
Consistent UI (e.g. Users already know how "back" works, etc)
Centralized updates (Just update the server, not each client)
Your choice of application type will be related both to the technology constraints and the type of user experience you plan to deliver.
Rich Client Application:
Usually developed as a stand-alone application.
Can support disconnected or occasionally connected scenarios.
Uses the processing and storage resources of the local machine.
Web Application:
Can support multiple platforms and browsers.
Supports only connected scenarios.
Uses the processing and storage resources of the server.
I personally favor PyQt in your case for a portable application.
The homepage for PyQt is http://www.riverbankcomputing.com/software/pyqt/
PyQt supports the Windows, Linux, UNIX and MacOS/X platforms.
PyQt4 is a set of Python bindings for Qt 4 that are dual-licensed under the GPL (version 2 and 3, with additional license exceptions) and a commercial license. There is also PySide by Nokia - new alternative bindings (as of November 2009) with LGPL license that struggle to be API compatible (at least until Qt 4.6) with PyQt4.
Tools and docs
PyQt Reference Documentation.
PyQt4 book: http://www.qtrac.eu/pyqtbook.html
The pyuic4 utility is a command line interface to the uic module. Conver xml ui from Qt to python.
Qt Designer is a powerful cross-platform GUI layout and forms builder. It allows you to rapidly design and build widgets and dialogs using on-screen forms using the same widgets that will be used in your application.
PyQt4 exposes much of the functionality of Qt 4 (From Nokia) to Python, including:
A comprehensive set of widgets
Flexible layout managers
Standard GUI features for applications (menus, toolbars, dock windows)
Easy communication between application components (signals and slots)
A unified painting system with transparency, anti-aliasing, OpenGL integration and SVG support
Internationalization (i18n) support and integration with the Qt Linguist translation tool
Etc.
You question is a little broad. I'll try to cover as much as I can.
First, what I understood and my assumptions.
In your situation, the sqlite database is just a data store. Only one process (unless your application is multiprocess) will be accessing it so you won't need to worry about locking issues. The application doesn't need to communicate with other instances etc. over the network. It's a single desktop app. The platform is Windows.
Here are some thoughts that come to mind.
If you develop an application in Python (either web based or desktop), you will have to package it as a single executable and distribute it to your users. They might have to install the Python runtime as well as any extra modules that you might be using.
Guis are in my experience easier to develop using a standalone widget system than in a browser with Javascript. There are things like Pyjamas that make this better but it's still hard.
While it's not impossible to have local web applications running on each computer, your real benefits come if you centralise it. One place to update software. No need to "distribute" etc. This of course entails that you use a more powerful database system and you can actually manage multiple users. It will also require that you worry about browser specific quirks.
I'd go with a simple desktop app that uses a prepackaged toolkit (perhaps Tkinter which ships with Python). It's not the best of approaches but it will avoid problems for you. I'd also consider using a language that's more "first class" on windows like C# so that the runtimes and other things are already there. You requirement for a fancy GUI is secondary and I'd recommend that you get the functionality working fine before you focus on the bells and whistles.
Good luck.
Could someone please explain to me how the current python webframworks fit together?
The three I've heard of are CherryPy, TurboGears and Pylons. However I'm confused because TurboGears seems to use CherryPy as the 'Controller' (although isn't CherryPy a framework in in it's own right?), and TurbGears 2 is going to be built on top of Pylons (which I thought did the same thing?).
There are more to it ofcourse.
Here's a comprehensive list and details!
Web Frameworks for Python
Extract from above link:
Popular Full-Stack Frameworks
A web application may use a
combination of a base HTTP application
server, a storage mechanism such as a
database, a template engine, a request
dispatcher, an authentication module
and an AJAX toolkit. These can be
individual components or be provided
together in a high-level framework.
These are the most popular high-level
frameworks. Many of them include
components listed on the WebComponents
page.
Django (1.0 Released 2008-09-03) a
high-level Python Web framework that
encourages rapid development and
clean, pragmatic design
Pylons (0.9.6.2 Released 2008-05-28) a
lightweight Web framework emphasizing
flexibility and rapid development. It
combines the very best ideas from the
worlds of Ruby, Python and Perl,
providing a structured but extremely
flexible Python Web framework. It's
also one of the first projects to
leverage the emerging WSGI standard,
which allows extensive re-use and
flexibility but only if you need it.
Out of the box, Pylons aims to make
Web development fast, flexible and
easy. Pylons is built on top of Paste
(see below).
TurboGears (1.0.4.4 Released
2008-03-07) the rapid Web development
megaframework you've been looking for.
Combines CherryPy, Kid, SQLObject and
MochiKit. After reviewing the website
check out: QuickStart Manual
web2py (currently version 1.43)
Everything in one package with no
dependencies. Development, deployment,
debugging, testing, database
administration and maintenance of
applications can be done via the
provided web interface. web2py has no
configuration files, requires no
installation, can run off a USB drive.
web2py uses Python for the Model, the
Views and the Controllers, has a
built-in ticketing system to manage
errors, an internationalization
engine, works with MySQL, PostgreSQL,
SQLite , Oracle, MSSQL and the Google
App Engine via an ORM abstraction
layer. web2py includes libraries to
handle HTML/XML, RSS, ATOM, CSV, RTF,
JSON, AJAX, XMLRPC, WIKI markup.
Production ready, capable of
upload/download of very large files,
and always backward compatible.
Grok (0.13 Released 2008-06-23) is
built on the existing Zope 3
libraries, but aims to provide an
easier learning curve and a more agile
development experience. It does this
by placing an emphasis on convention
over configuration and DRY (Don't
Repeat Yourself).
Zope (2.10.4 Released 2007-07-04,
3.3.1 Released 2007-01-14, Zope 3.4.0c1 Released 2008-01-31) Being the grandaddy of Python web frameworks,
Zope has grown into a family of
frameworks over the years. Zope 1 was
released in 1999. Zope 2 is both a web
framework and a general purpose
application server, today it is
primarily used by
ContentManagementSystems. Zope 3 is
both a standalone framework and a
collection of related libraries, which
are also included with newer releases
of Zope 2. All of the Zope frameworks
include the ZODB, an object database
for Python.
Give a try to web2py. It is point and click (you do not even need to install Python, comes with it). You develop using a web interface and you can deploy almost everywhere, including iPhone, Oracle and Google App Engine. Before trying web2py, try install some of the other Python frameworks, you will appreciate it even more.
CherryPy is not a full-stack web framework (like Django for example), in fact it isn't a web framework but a HTTP framework. Writing a web application using CherryPy is much like writing a regular object-oriented application in Python.
Also, CherryPy has it's own production-ready WSGI web server, which can be also used for applications written using other frameworks, hence the confusion surrounding CherryPy as a framework.
If you are looking for a start-to-finish solution then it's worth mentioning that the leader of the pack in that space is Django
Have you tried FastAPI.
It's a is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.
Pretty easy to learn, quite powerful and lightweight.
https://fastapi.tiangolo.com/
I have been using for my application and it seems to be similar to Flask, but quite robust.
from fastapi import FastAPI
app = FastAPI()
#app.get("/")
def read_root():
return {"Hello": "World"}
Some Video Tutorials can be found here
You can also find a lot of help materials from here