Django for data management in a no-UI application?

已查看 102 次
跳至第一个未读帖子

jsa...@nvidia.com

未读,
2015年9月2日 15:20:372015/9/2
收件人 Django users
I'm designing a program which was originally meant to be a server application, and I planned to write it with Django. I haven't used Django before, so I've been reading about it to help me think about the design.

Now there has been a change in direction. I'm being asked to develop the program as a no-UI service. A browser-based user interface will be added later.

However, the program will make extensive use of a SQL database. I'd like to use Django's data management features from the start, so that when the GUI is added I won't have to choose between rewriting the data management and leaving it outside the Django framework.

None of the tutorial material I've read addresses this case, where Django is used for data management but there is no UI. Will I have any problems developing a program this way?

Rafael E. Ferrero

未读,
2015年9月2日 15:35:172015/9/2
收件人 django...@googlegroups.com
I don't quite understand very well your use case, but, i think that you can go with REST, maybe?? [http://www.django-rest-framework.org/]

--
Rafael E. Ferrero

--
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...@googlegroups.com.
To post to this group, send email to django...@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/c9e96c5a-689f-4b20-bd9d-c23fc34e844d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Avraham Serour

未读,
2015年9月2日 18:03:402015/9/2
收件人 django-users

+1 to DRF, you may also use the django admin as a quick CRUD to your data

Mulianto

未读,
2015年9月3日 13:01:032015/9/3
收件人 django...@googlegroups.com
Hi ,

Gui as webapp in django is included, which is admin interface.

But if you will build own web gui for the frontend, you still can use django , but with the result as an API , whic you can build with DRF or without.

With the API your client can be web client, mobile phone, desktop app, embedded app , you name it.

Mulianto

Sent from my Mini Ipad 

jsa...@nvidia.com

未读,
2015年9月8日 18:06:492015/9/8
收件人 Django users
I think I failed to explain my situation clearly, and I need to try again.

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.

I haven't looked at the "Django REST" link yet, but I appreciate the suggestion. The project will require a REST API, as I mentioned, although most of the applications will run on the server, and will not need an API.

Carl Meyer

未读,
2015年9月8日 18:12:072015/9/8
收件人 django...@googlegroups.com
On 09/08/2015 04:06 PM, jsa...@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

signature.asc

jsa...@nvidia.com

未读,
2015年9月9日 19:23:312015/9/9
收件人 Django users
Thanks, that's a clear answer. As a bonus, it's the one I was hoping for. :)

The UI will be web-based. A native OS GUI would be cool, but 'way overkill. The application that will be used internally by a small number of people. It automates some production processes, and having a GUI at all is a convenience rather than a necessity.

The only reason there will an application running on the client at all is that this application must execute a native OS GUI application (a commercial application, not part of my development project).
回复全部
回复作者
转发
0 个新帖子