Making command-line clients to Django data

24 views
Skip to first unread message

Jeff Blaine

unread,
Jun 13, 2011, 2:05:56 PM6/13/11
to django...@googlegroups.com
We've got our Django site complete for now.  It consists entirely of just a customized
default "admin" setup.

We'd like to develop some command-line interfaces to the data.

Is there a good/best approach to doing this?  Can I (recommended?) use templates
for formatting text to the terminal?

Any tips, links, etc, would be appreciated.

PS: I'm aware of (but not interested in) the ability to extend manage.py with more
commands.

Cal Leeming [Simplicity Media Ltd]

unread,
Jun 13, 2011, 2:09:00 PM6/13/11
to django...@googlegroups.com
Why not? To want a decent CLI integrated with your app, but without using management commands, is a pretty dumb idea.
 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/0PDkFKZmpfgJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Jeff Blaine

unread,
Jun 13, 2011, 4:04:16 PM6/13/11
to django...@googlegroups.com
Why not? To want a decent CLI integrated with your app, but without using management commands, is a pretty dumb idea.

It's not how we want the end-users to interface with it.

Why is it a dumb idea? 

creecode

unread,
Jun 13, 2011, 8:05:09 PM6/13/11
to django...@googlegroups.com
Hello Jeff,


On Monday, June 13, 2011 1:04:16 PM UTC-7, Jeff Blaine wrote:

It's not how we want the end-users to interface with it.

Perhaps if you describe how you do want your users to interface with the website via command line then we could give you better advice.
 
Why is it a dumb idea?

It's not a dumb idea but the management command is a pretty good way to do things via the command line.  Much less struggle if you do it that way.  There are several examples of how to write a straight shell script that can be found via Google.  I started out with straight shell scripts and have switched over to management commands.  Obviously what works for me may not suit your needs.

Toodle-loooooo..............
creecode

Javier Guerra Giraldez

unread,
Jun 13, 2011, 10:25:09 PM6/13/11
to django...@googlegroups.com
On Mon, Jun 13, 2011 at 7:05 PM, creecode <cree...@gmail.com> wrote:
> I started out with straight shell scripts and have switched over to
> management commands.

same here. i feel dumb every time i have to maintain those old
scripts, things are much easier with management commands.


if you don't want your users to see the "python /project/manage.py
...." part of the command, it's easier to write a management command
_and_ a wrapper shell script than a single 'straight' script.

--
Javier

Jeff Blaine

unread,
Jun 24, 2011, 2:18:45 PM6/24/11
to django...@googlegroups.com
Just a follow-up:

Well, I took your advice and did it via manage command(s) with wrapper scripts
for the users.  It's working well so far.  I do wish I had a clearer understanding
of what the downside to the "standalone" method is, but I suspect I will never
know unless I go out of my way and try it myself.

Cal Leeming [Simplicity Media Ltd]

unread,
Jun 24, 2011, 2:37:11 PM6/24/11
to django...@googlegroups.com
This is one of those "you need to learn the hard way to really appreciate the reason why" situations. A few hours experience is sometimes worth a life time of documentation lol.
 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/0GNE80cCQmcJ.
Reply all
Reply to author
Forward
0 new messages