Tuesday, September 8, 2015

Re: Django for data management in a no-UI application?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCAAGBQJV710HAAoJEC0ft5FqUuEhHzIP/3F2yeTccutW6WKlTx4tC6BP
mfuCw1C7GD2s2xlT3rPL1iNeT8MiNODWNdmsA6HhiO1Qgmp0Bm5Fa5Ak4gC3XJpr
ZgQsXewqmipwUOESh6WOVD+XzviYpaP3MtEB0QfWdrnQJ5ysXcSD9G66MpDj/6iy
FFPZSSJRXm6/gZ5k/BLaP/EHr0Y8drWKkqCXQ4IO1EHh95upQdFZB3y1NdjICSOD
1aTqsd0dE9CPyhnMz+q30BM14tjjjF90pGCVH6av6nNKXcIupXFzko7Nab3+Sckq
2NlCwAT7LRe7whHDBD5JObji0qaZaqyy6Iy5UKVCwXl8xcwCz+K+rV8ZqMZcTPdC
y5EkishgwprMqiz6Ky2CsRWJZgH0s0e/c3IZcdgo7j6iDrJ+wbY6gr5ZUJL8bjwu
/sVMZSCW23BpKmcUStBPWBF7csjzj5KrnrMjkDAtbmdo9Wh7UzZuNkBGSKQyMmCr
DI6MxNM1J8+tQy8Z2q9i6yMlEiSIdX/HB1qpsKfWeOcall0PDpwK7NsRRdEWz1X/
9qEzv+mY7gVANoRv9YCYba9zxZF3w562fOGnafRH3p76xewdFoVPm8D3LMXRIav2
TJ/hTysx/u6lqRmFGfu5i1dN3ukYvWltLdT2GISDYweqbg5ZiG6lHXvmJty03y0L
JDXS0SxTeSA/QKbAZhl5
=RHHD
-----END PGP SIGNATURE-----
On 09/08/2015 04:06 PM, jsachs@nvidia.com wrote:
> I have been planning to develop a standard web application using Django.
> Due to a change in direction, the development plan has been changed to:
>
> 1. Develop a suite of no-GUI applications that run in a command line
> window on a server. One other application will run on _clients _in a
> command line window, and will perform certain operations on the
> server through a REST API service. However,
> 2. All of the applications will use an SQL database that runs on the
> server.
> 3. In a later phase of the project, the server applications will be
> combined and modified to present a GUI.
>
> My question is this: Is it feasible to make all of the server
> applications use Django to communicate with the database server in step
> 1, and then use it to implement the GUI in step 3? By doing so, I would
> avoid having to (1) code all of the database operations without Django
> in step 1, then recode them with Django in step 3, or (2) end up with a
> "hybrid" application that implements the GUI in Django but the database
> operations outside Django.

Sure, you can write the command-line server applications as Django
management commands, or just as Python scripts that use
`django.conf.settings.configure()` and call `django.setup()` before
using the ORM to communicate with the database.

And you can use the same ORM models to drive your REST API, built in Django.

How you approach step 3 depends on whether "browser-based GUI" is
acceptable, or you need to build an OS-native application. Django is
oriented towards the former, but you can certainly build an OS-native
Python application using a GUI toolkit like Qt or whatever, and still
use the Django ORM within it to talk to the database.

Carl

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/55EF5D03.4020503%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment