I found the best way to do this is
python manage.py < script.py
On Jul 21, 2011 8:00 PM, "Gelonida N" wrote:
> On 07/18/2011 04:33 PM, bruno desthuilliers wrote:
>> On Jul 18, 3:33 pm, Alexander Crössmann
>> wrote:
>>> Hi Malcom,
>>>
>>> I am
On 07/18/2011 04:33 PM, bruno desthuilliers wrote:
> On Jul 18, 3:33 pm, Alexander Crössmann
> wrote:
>> Hi Malcom,
>>
>> I am not sure the management commands are what I want
>
> Strange enough, it seems that everyone starts by saying this and ends
> up writing
Nevermind, I thought you were referring to the previously sys.path.append()
method.
Regards,
AT
On Thu, Jul 21, 2011 at 1:13 PM, Andre Terra wrote:
> On Jul 21, 4:53 pm, Jonas Geiregat wrote:
>> >
>> > This is a good read on the subject , it presents
>
> On Jul 21, 4:53 pm, Jonas Geiregat wrote:
> >
> > This is a good read on the subject , it presents an elegant solution.
> >
> > http://superjared.com/entry/django-and-crontab-best-friends/
>
>
> With the problem that it will use the first module named "settings" in
>
On Thu, Jul 21, 2011 at 10:27 AM, bruno desthuilliers
wrote:
> I maintain, from experience, that custom commands are the simplest,
> safest and most flexible solution.
same here
--
Javier
--
You received this message because you are subscribed to the Google
On Jul 21, 4:53 pm, Jonas Geiregat wrote:
>
> This is a good read on the subject , it presents an elegant solution.
>
> http://superjared.com/entry/django-and-crontab-best-friends/
With the problem that it will use the first module named "settings" in
sys.path, which may *or
On Jul 21, 4:45 pm, Valder Gallo wrote:
> Alexander,
>
> Try use this
>
> #test.py
> import os, sys
> sys.path.append('../')
This is relative to whatever the current working directory is whenever
the script is called. Very bad idea, will obviously break one day or
another.
> Alexander,
>
> Try use this
>
> #test.py
> import os, sys
> sys.path.append('../')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
>
> myproject/test.py
>
This is a good read on the subject , it presents an elegant solution.
Alexander,
Try use this
#test.py
import os, sys
sys.path.append('../')
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
myproject/test.py
On 07/18/2011 09:34 AM, Alexander Crössmann wrote:
Hi,
I want to write a python script that works with django models without
runing the
On 18 July 2011 15:41, Shawn Milochik wrote:
> On Mon, Jul 18, 2011 at 10:33 AM, bruno desthuilliers
> wrote:
> > On Jul 18, 3:33 pm, Alexander Crössmann
> > wrote:
> >> Hi Malcom,
> >>
> >> I am not sure the
On Mon, Jul 18, 2011 at 10:33 AM, bruno desthuilliers
wrote:
> On Jul 18, 3:33 pm, Alexander Crössmann
> wrote:
>> Hi Malcom,
>>
>> I am not sure the management commands are what I want
>
> Strange enough, it seems that everyone
On Jul 18, 3:33 pm, Alexander Crössmann
wrote:
> Hi Malcom,
>
> I am not sure the management commands are what I want
Strange enough, it seems that everyone starts by saying this and ends
up writing custom management commands ;)
--
You received this message
Hi Malcom,
I am not sure the management commands are what I want, but the setting
of the DJANGO_SETTINGS_MODULE environment variable helped. I had
experimented with these settings already, but wasn't successful until now.
So, thanks for the help!
Alex
Am 18.07.2011 15:17, schrieb Malcolm
On 18 July 2011 13:34, Alexander Crössmann
wrote:
> Hi,
>
> I want to write a python script that works with django models without
> runing the server. My OS ist Ubuntu 10.10.
>
>
I'd suggest using Django management commands:
Hi,
I want to write a python script that works with django models without
runing the server. My OS ist Ubuntu 10.10.
My skipt looks as follows:
import sys
sys.path.append('/home/myname/python/django_projects/')
sys.path.append('/home/myname/python/')
import settings
from
15 matches
Mail list logo