Just make sure when you *do* set your hosting up that you get shell
(command line) access of some kind so you can set up the cron jobs.

regards
 Steve

[EMAIL PROTECTED] wrote:
> Thanks for your help Daniel! I havent got hosting sorted yet so its
> something Ill have to set up later.
> I guess I can set up the custom command and do it manually for now.
> Phil
> 
> On Nov 12, 5:29 pm, Daniel Roseman <[EMAIL PROTECTED]>
> wrote:
>> On Nov 12, 5:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>> wrote:
>>
>>
>>
>>> Hi all,
>>> Just building my first site with django and Ive hit my first snag that
>>> I cant find in the documentation.
>>> Just as an example scenario, suppose I have my model-
>>> class User(models.Model):
>>>     signup_date =  models.DateTimeField()
>>>     full_user_date = models.DateTimeField()
>>>     full_user = models.BooleanField()
>>> I want to make it so that when we arrive at full_user_date django
>>> flicks full_user over to 1 and sends the user an email.
>>> I imagine I could do it in the views.py, but it would be dependant on
>>> someone visiting the page. I think it would be more effecient to just
>>> do a check once a day, thats all I need. How can i set it up so django
>>> does a check on the database after a set time?
>>> any ideas?
>>> Phil
>> You need some sort of job that runs periodically on the server. If
>> you're using Linux (or a Mac), cron is ideal for this. (I think
>> Windows has something like a Schedule Server for this job.)
>>
>> Just create a standalone script that imports the Django models just as
>> you would do in a view. Perhaps the best way of doing this is to
>> create a custom manage.py command - 
>> seehttp://docs.djangoproject.com/en/dev/howto/custom-management-commands...
>> for how this is done.
>>
>> You can then set cron to run manage.py your_command once a day to do
>> the update.
>> --
>> DR.
> > 
> 


-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to