Writing custom django-admin commands

2021-05-06 Thread Ilia Rk
how should i write commands that works with all apps existing in project not just apps with specific name -- 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

Re: Followed 'Writing custom django-admin commands' - 'Apps aren't loaded yet.'!

2019-07-13 Thread Joe Reitman
27; On Thursday, July 11, 2019 at 3:15:39 PM UTC-5, paul_d...@hotmail.com wrote: > > I've got a basic Django site up and running and am now trying to write a > custom command by following the "Writing custom django-admin commands" > documentation. However having followe

Followed 'Writing custom django-admin commands' - 'Apps aren't loaded yet.'!

2019-07-11 Thread paul_d_sm...@hotmail.com
I've got a basic Django site up and running and am now trying to write a custom command by following the "Writing custom django-admin commands" documentation. However having followed it carefully I get this exception: (myfrontier) C:\Users\PDS\git\myfrontier>set DJAN

Re: custom django-admin commands naming convention

2011-03-08 Thread Marwan Al-Sabbagh
cool thanks, Marwan On Wed, Mar 9, 2011 at 12:14 AM, creecode wrote: > Hello Marwan, > > I don't know if it's common but for my needs it's a must! :-) I have > several apps with custom management commands and I've taken to naming > the commands like... > > my_app_name_my_custom_management_com

Re: custom django-admin commands naming convention

2011-03-08 Thread creecode
Hello Marwan, I don't know if it's common but for my needs it's a must! :-) I have several apps with custom management commands and I've taken to naming the commands like... my_app_name_my_custom_management_command_name.py If find it easier to read the command name if I separate each word with

custom django-admin commands naming convention

2011-03-08 Thread Marwan Al-Sabbagh
Hi, I need to cron a few jobs for my django app to run daily. I went through the docs on "Writing custom django-admin commands" and thats the direction I'm planning to go to run these jobs. Our company has a number of teams developing different apps and I didn't want the na

Signals sent while running custom django-admin commands?

2010-07-19 Thread peppergrower
With Django 1.2.1 I'm finding that signals don't seem to get sent while running a custom manage.py command. Looking at the documentation[1], it looks like this may be the intended behavior; is the documentation saying that _only_ the post_syncdb signal gets sent when running django-admin commands,

Re: Custom Django-Admin commands

2009-12-22 Thread Justin Steward
On Tue, Dec 22, 2009 at 3:24 PM, Bill Freeman wrote: > If you are calling this from, for example, crontab note that each line > in crontab is executed in its own subshell, so you have the choice of > setting PYTHONPATH, or (my personal favorite because it works with so > many kinds of scripts) you

Re: Custom Django-Admin commands

2009-12-22 Thread Bill Freeman
If you are calling this from, for example, crontab note that each line in crontab is executed in its own subshell, so you have the choice of setting PYTHONPATH, or (my personal favorite because it works with so many kinds of scripts) you can cd to the project directory and execute the script as ./m

Re: Custom Django-Admin commands

2009-12-22 Thread Justin Steward
I'm at a loss as to understand why, but I've worked out what I need to add to pythonpath. PYTHONPATH=/home/user i.e. The pythonpath needs to include NOT the project's root, but the directory one level ABOVE that for custom commands to work properly... Thanks for the help guys. ~Justin -- You

Re: Custom Django-Admin commands

2009-12-21 Thread Justin Steward
On Tue, Dec 22, 2009 at 3:51 PM, Alex_Gaynor wrote: > > Do you have __init__.py files in each of those directories? Of course - Else it woud not work from the project's root directory either. ~Justin -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: Custom Django-Admin commands

2009-12-21 Thread Alex_Gaynor
On Dec 21, 8:38 pm, Justin Steward wrote: > On Tue, Dec 22, 2009 at 12:16 PM, Doug Blank wrote: > > > You probably just need to set your PYTHONPATH: > > > cd /home/user > > PYTHONPATH=proj python proj/manage.py custom > > That was my initial thought too, however setting the PYTHONPATH does > no

Re: Custom Django-Admin commands

2009-12-21 Thread Justin Steward
On Tue, Dec 22, 2009 at 12:16 PM, Doug Blank wrote: > > You probably just need to set your PYTHONPATH: > > cd /home/user > PYTHONPATH=proj python proj/manage.py custom > That was my initial thought too, however setting the PYTHONPATH does not affect the behaviour in this instance. ~Justin --

Re: Custom Django-Admin commands

2009-12-21 Thread Doug Blank
On Mon, Dec 21, 2009 at 8:10 PM, Justin Steward wrote: > Hi all, > > I've written a custom command to use with manage.py, and from the root > of the project directory, it works great. > > But the problem is, this command is almost never going to be called > from within the project directory. > > (

Custom Django-Admin commands

2009-12-21 Thread Justin Steward
Hi all, I've written a custom command to use with manage.py, and from the root of the project directory, it works great. But the problem is, this command is almost never going to be called from within the project directory. (hoping the spacing doesn't get too mangled when I send this) /home/ u

Re: Custom django-admin commands help?

2009-02-22 Thread phyl.jack...@gmail.com
Thanks Daniel, your guess was correct Id left out the handle stuff competely. It appears to be working perfectly now! Phil On 22 Feb, 13:21, Daniel Roseman wrote: > On Feb 22, 1:00 pm, "phyl.jack...@gmail.com" > wrote: > > > > > I have a little custom script that changes some database stuff and

Re: Custom django-admin commands help?

2009-02-22 Thread Daniel Roseman
On Feb 22, 1:00 pm, "phyl.jack...@gmail.com" wrote: > I have a little custom script that changes some database stuff and > sends an email - I want to set it to run on a cron job. > > So Ive been trying to set it up as a custom django-admin command, Ive > been trying to use this little bit of info

Custom django-admin commands help?

2009-02-22 Thread phyl.jack...@gmail.com
I have a little custom script that changes some database stuff and sends an email - I want to set it to run on a cron job. So Ive been trying to set it up as a custom django-admin command, Ive been trying to use this little bit of info- http://docs.djangoproject.com/en/dev/howto/custom-managemen