Re: permalinks from cron job

2010-01-18 Thread eric.frederich

I do not understand how this would work.
The only place where /apps/ is mentioned is apache's config file.

WSGIScriptAlias /apps /export/home/web/docs/django/my_site/apache/
django.wsgi

There is nothing in my Django settings about /apps/.
Is there a setting that I can put in my Django settings? ... If so
what is it?

Putting URLs together works fine when browsing my site because it is
going through apache.
The problem is when I'm not running through apache (like via cron,
or ./manage_py shell).

So, I do not understand how setting PYTHONPATH via crontab would let
cron know that it is at /apps when currently Apache is the only thing
that know.

~Eric


On Jan 17, 11:54 pm, Ted Nyman  wrote:
> More generally, in a crontab, you'll need to set both the PYTHONPATH  
> and give the location of the relevant Django settings.
>
> -Ted
>
> On Jan 17, 2010, at 8:22 PM, "eric.frederich"  
>
>  wrote:
>
> >> Is there some setting somewhere to set the prefix?
> >> Can it be set via an environment variable?
> >> How to I get the reverse function in urlresolvers to add /apps to my
> >> url like it does when run through wsgi?
>
> >> Thanks,
> >> ~Eric
> > --
> > You received this message because you are subscribed to the Google  
> > Groups "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en
> > .
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: permalinks from cron job

2010-01-18 Thread Andy McKay

You can set a prefix here:

http://code.djangoproject.com/browser/django/trunk/django/core/urlresolvers.py#L364
--
  Andy McKay, @clearwind
  http://clearwind.ca/djangoski

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: permalinks from cron job

2010-01-17 Thread Ted Nyman
More generally, in a crontab, you'll need to set both the PYTHONPATH  
and give the location of the relevant Django settings.


-Ted



On Jan 17, 2010, at 8:22 PM, "eric.frederich"  
 wrote:


Is there some setting somewhere to set the prefix?
Can it be set via an environment variable?
How to I get the reverse function in urlresolvers to add /apps to my
url like it does when run through wsgi?

Thanks,
~Eric

--
You received this message because you are subscribed to the Google  
Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en 
.



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: permalinks from cron job

2010-01-17 Thread eric.frederich
:: bump ::

On Jan 14, 1:59 pm, "eric.frederich"  wrote:
> My django urls work nicely when browsing around, clicking things, and
> when my views generate emails.  They all have the appropriate prefix.
>
> In apache's conf file I have the following...
>
> WSGIScriptAlias /apps /export/home/web/docs/django/my_site/apache/
> django.wsgi
>
> My urls look likehttps://mydomain.com/apps/some_app/
>
> I looked dug around django's code and saw that the magic was happening
> between urlresolvers.py and the wsgi handler setting the appropriate
> prefix '/apps'.
>
> So, my question is how do I get the /apps prefix into my urls when
> running outside of the web (i.e. via a cron job).
>
> Is there some setting somewhere to set the prefix?
> Can it be set via an environment variable?
> How to I get the reverse function in urlresolvers to add /apps to my
> url like it does when run through wsgi?
>
> Thanks,
> ~Eric
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




permalinks from cron job

2010-01-14 Thread eric.frederich
My django urls work nicely when browsing around, clicking things, and
when my views generate emails.  They all have the appropriate prefix.

In apache's conf file I have the following...

WSGIScriptAlias /apps /export/home/web/docs/django/my_site/apache/
django.wsgi

My urls look like https://mydomain.com/apps/some_app/

I looked dug around django's code and saw that the magic was happening
between urlresolvers.py and the wsgi handler setting the appropriate
prefix '/apps'.

So, my question is how do I get the /apps prefix into my urls when
running outside of the web (i.e. via a cron job).

Is there some setting somewhere to set the prefix?
Can it be set via an environment variable?
How to I get the reverse function in urlresolvers to add /apps to my
url like it does when run through wsgi?

Thanks,
~Eric
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.