Redirect with string?

33 visualizações
Pular para a primeira mensagem não lida

Lachlan Musicman

não lida,
1 de ago. de 2014, 01:16:1501/08/2014
para django...@googlegroups.com
Hi all,

I have a thermal line printer (a Zebra LP2824 fwiw) and I've
discovered/worked out that I can print with it by just sending a text,
a la:

cat filename | nc <ipaddress> <portnumber>

I tried this in my view:

return redirect("<ipaddress>", "string")

but it's printing out the HttpResponse object.

How would I send a string to the IP in question from a view?

cheers
L.


--
You have to be really clever to come up with a genuinely dangerous
thought. I am disheartened that people can be clever enough to do that
and not clever enough to do the obvious thing and KEEP THEIR IDIOT
MOUTHS SHUT about it, because it is much more important to sound
intelligent when talking to your friends.
This post was STUPID.
-----------------------------------------------------------------------------------------------------------
The Most Terrifying Thought Experiment of All Time
http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html

Collin Anderson

não lida,
1 de ago. de 2014, 08:47:3601/08/2014
para django...@googlegroups.com
redirect is a django shortcut for an http redirect response, not a file/pipe redirect. You need to use a python socket to connect to the ip address.

Lachlan Musicman

não lida,
1 de ago. de 2014, 08:52:1201/08/2014
para django...@googlegroups.com
Thanks Collin, I'll test on Monday
L.
> --
> 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/4fa95d46-e174-4ece-a3b0-82050d97458b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Lachlan Musicman

não lida,
4 de ago. de 2014, 17:45:2204/08/2014
para django...@googlegroups.com
Collin, worked a charm - thankyou!
L.
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem