Hi Russ,

:) +1 for your example.

I read the Django documentation and I find the Middleware chapter. 

It's possible using the Middleware layer to intercept the HTTP requests.

The "script solution" remain the simplest solution.

My goal is the implementation of system, composed by two devices:

- a data logger

- a web service

The data logger have to send the registered data to the web server.

I think to use an https comunication between the two devices.

So on the same machine, where I install the web server,  I need another web 
server to handle the 
data logger requests.

This is a possible solution.

SM



Il giorno lunedì 17 febbraio 2014 00:27:15 UTC+1, Russell Keith-Magee ha 
scritto:
>
>
> On Sun, Feb 16, 2014 at 10:20 PM, simone monteleone 
> <ares...@gmail.com<javascript:>
> > wrote:
>
>> Hi Russ,
>>
>> The script is now running in a normal bash shell, where I import the 
>> DJANGO_SETTINGS_MODULE.
>>
>> So it's correct to run the script on the machine where the server goes?
>>
>> Or it's possible (and better) runs the commands inside Django?
>>
>> You're missing my point - there's no such thing as "inside Django". 
> Logging onto the server and running the script is the right way to do what 
> you are describing.
>
> A running Django web server isn't a "place" you can run code - it's 
> essentially just a way to turn http://myservice.com into a function call 
> that returns a web page. Requests is just a tool for using a Python script 
> to generate HTTP requests. 
>
> Yes, you can use requests to connect to a Django web server. However, if 
> you're in control of the web server, using requests to do what you 
> describe, instead of just logging onto the server and running a script 
> directly is a bit like saying "I'm going to pick up the cup that is sitting 
> on that table using a fishing rod". Yes, you can probably do it, but unless 
> you've got a good reason, it's much easier to just walk over and pick up 
> the cup with your hand.:-)
>
> Yours,
> Russ Magee %-)
>
>  
>

-- 
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+unsubscr...@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/b955652d-bcc1-483c-b014-5e44c33f162c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to