On Sun, Feb 16, 2014 at 10:20 PM, simone monteleone <ares.a...@gmail.com>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/CAJxq84-1ySH__CsrBqw9%2B0Bo031iMOkT%2BWVv5n1HdRN1DCk7sQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.