Re: Question about the send of file versus the django server

2014-02-18 Thread Russell Keith-Magee
On Tue, Feb 18, 2014 at 4:10 PM, simone monteleone wrote: > 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 solutio

Re: Question about the send of file versus the django server

2014-02-18 Thread simone monteleone
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: -

Re: Question about the send of file versus the django server

2014-02-16 Thread Russell Keith-Magee
On Sun, Feb 16, 2014 at 10:20 PM, simone monteleone 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 i

Re: Question about the send of file versus the django server

2014-02-16 Thread simone monteleone
In other hand, it's possible to use the Django server to intercept a requests? SM Il giorno domenica 16 febbraio 2014 15:20:54 UTC+1, simone monteleone ha scritto: > > Hi Russ, > > The script is now running in a normal bash shell, where I import the > DJANGO_SETTINGS_MODULE. > > So it's corr

Re: Question about the send of file versus the django server

2014-02-16 Thread simone monteleone
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? Thanks SM Il giorno domenica 16 febbraio 2014 01:21:

Re: Question about the send of file versus the django server

2014-02-15 Thread Russell Keith-Magee
Hi Simone, On Sun, Feb 16, 2014 at 2:53 AM, simone monteleone wrote: > Hi Russ, > > My goal is to load the csv file directly in the database. > > So my idea is define a script containing the follow pseudo-code: > > while(1) and receive_csv(): > > value1, value2 = read_csv() > > MyModel.o

Re: Question about the send of file versus the django server

2014-02-15 Thread François Schiettecatte
Hi See this: https://docs.djangoproject.com/en/1.6/topics/http/file-uploads/ Cheers François On Feb 15, 2014, at 1:53 PM, simone monteleone wrote: > Hi Russ, > > My goal is to load the csv file directly in the database. > > So my idea is define a script containing the follow pseudo

Re: Question about the send of file versus the django server

2014-02-15 Thread simone monteleone
Hi Russ, My goal is to load the csv file directly in the database. So my idea is define a script containing the follow pseudo-code: while(1) and receive_csv(): value1, value2 = read_csv() MyModel.objects.create(field1=value1, field2=value2) The script run on the server, ex http:/

Re: Question about the send of file versus the django server

2014-02-13 Thread Russell Keith-Magee
On Thu, Feb 13, 2014 at 4:11 PM, simone monteleone wrote: > Hi all, > > I have to send a file (ex. csv file) to the Django server. > > I think to use the requests python module. > > Is this the best way? > The "best" way will depend on your exact requirements - I'll come back to this in a moment.

Question about the send of file versus the django server

2014-02-13 Thread simone monteleone
Hi all, I have to send a file (ex. csv file) to the Django server. I think to use the requests python module. Is this the best way? Second question; Django can receive this file? And also in this case, what it is the best way? My goal is to load the csv file information in the dabatase handle