Can't get turbogears.scheduler to work. Please help.

1 view
Skip to first unread message

sebe...@spawar.navy.mil

unread,
May 28, 2007, 1:42:49 PM5/28/07
to TurboGears
I'm trying to run a certain controller daily. At top of my controller
file I imported the turbogears.scheduler and I added something like
the following at bottom of my controllers file too:

def set_up_my_daily_controller():
def daily():
open("this_is_a_test", "w").write("wow great")
turbogears.scheduler.add_weekday_task(daily, range(1,8),
(3,0))

turbogears.startup.call_on_startup.append(set_up_my_daily_controller)


How come I don't see the ``this_is_a_test'' file created anywhere?

Thanks!

Chris

Puck

unread,
May 29, 2007, 2:10:40 AM5/29/07
to TurboGears
Hi Chris,

did you add
tg.scheduler = True
to your configuration?

HTH,
Puck


On 28 Mai, 19:42, "seber...@spawar.navy.mil"

sebe...@spawar.navy.mil

unread,
May 30, 2007, 3:07:22 AM5/30/07
to TurboGears
Puck

Thanks. The blog I was working off of must have been obsolete. I
found other docs
that did things right including adding the boolean you mentioned.

Thanks!


Chris

bnf-austin

unread,
May 30, 2007, 9:39:51 AM5/30/07
to TurboGears
do you mind linking the docs that you found doing things correctly? I
know that I'm going to need to use scheduler in the next couple of
weeks, and having a place to find the right way to do it, without
getting sidetracked into old documents would be very helpfull.

Thanks,
BNF

On May 30, 2:07 am, "seber...@spawar.navy.mil"

Puck

unread,
May 30, 2007, 10:51:18 AM5/30/07
to TurboGears
What about the official documenation? That worked for me:
http://docs.turbogears.org/1.0/Scheduler

sebe...@spawar.navy.mil

unread,
May 30, 2007, 1:35:38 PM5/30/07
to TurboGears
I'll second Puck suggestion....the official docs are
trustworthy.....blogs maybe/maybe not :)


chris

Mike Schinkel

unread,
May 30, 2007, 2:13:53 PM5/30/07
to turbo...@googlegroups.com
Hi all:

I'm a newbie on TurboGears and am wondering if it is possible to host
TurboGears on a dedicated Windows 2003 Server box running IIS that already
has some ASP and ASP.NET websites running so IIS has to process port 80 (I
could buy a separate IP address, but don't want to.) I'm wondering if anyone
has used IIS as a proxy for a TurboGears application on Windows 2003 Server
and if so, how? Thanks in advance.

--
-Mike Schinkel
http://www.mikeschinkel.com/blogs/
http://www.welldesignedurls.org
http://atlanta-web.org - http://t.oolicio.us


Paul Johnston

unread,
May 30, 2007, 2:42:48 PM5/30/07
to turbo...@googlegroups.com
Hi,

Yes, I've done exactly that. I used a free reverse proxy:
http://www.saltypickle.com/Home/16 With a bit of hacking it now seems to
work fine. If you don't fancy coding, it may be worth looking at one of
the cheaper commercial ones.

The main issue for me was that my app was coded to server from the root
directory of the webserver, and it was moving to /myapp. ReverseProxy
tries to automatically rewrite links to fix this, but it actually broke
things I set server.webpath in my config file, so the TG app was rooted
at /myapp, and disabled ReverseProxy's rewriting (by hacking the code).

Good luck!

Paul

Mike Schinkel

unread,
May 30, 2007, 3:25:31 PM5/30/07
to turbo...@googlegroups.com
> Yes, I've done exactly that. I used a free reverse proxy:
> http://www.saltypickle.com/Home/16 With a bit of hacking it
> now seems to work fine. If you don't fancy coding, it may be
> worth looking at one of the cheaper commercial ones.

Thanks Paul!

> The main issue for me was that my app was coded to server
> from the root directory of the webserver, and it was moving
> to /myapp. ReverseProxy tries to automatically rewrite links
> to fix this, but it actually broke things I set
> server.webpath in my config file, so the TG app was rooted at
> /myapp, and disabled ReverseProxy's rewriting (by hacking the code).

Do you think it's possible to get it to serve from the root? URL design is
both very important to me [1] is critical to my app so I need it to work
from the root. Possible?

http://atlanta-web.org - http://t.oolicio.us

[1] http://www.welldesignedurls.org

Paul Johnston

unread,
May 30, 2007, 3:34:37 PM5/30/07
to turbo...@googlegroups.com
Hi,

>Do you think it's possible to get it to serve from the root? URL design is
>both very important to me [1] is critical to my app so I need it to work
>from the root. Possible?
>
>

Sure it's possible - put ReverseProxy in the root.

You won't then be able to have anything else running on that web server
though (unless you use a different port or virtual host).

Paul

Mike Schinkel

unread,
May 30, 2007, 3:40:48 PM5/30/07
to turbo...@googlegroups.com
> You won't then be able to have anything else running on that
> web server though (unless you use a different port or virtual host).

That kind of defeats the purpose, no? I was hoping it could use host
headers, i.e.

http://my-asp-net-app.com/ => ASP.NET on IIS
http://my-tg-app.com/ => TurboGears via IIS proxy

-Mike

Reply all
Reply to author
Forward
0 new messages