Re: time it takes django to read database?

2008-12-09 Thread garagefan

haha yeah, i just submitted a ticket to godaddy. They're usually
really good with getting back.

On Dec 9, 6:31 pm, "Colin Bean" <[EMAIL PROTECTED]> wrote:
> On Tue, Dec 9, 2008 at 3:22 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> > ok, server time is 2 hours and 11 minutes behind... this could explain
> > the issue then. The admin section, when creating a new entry takes the
> > time current actual time. So it makes 100% sense that django/python is
> > reading the incorrect time. I've attempted to update the server time
> > using the usual date "time" crap and was told the procedure was not
> > allowed, i assume this is due the server being a virtual server.
>
> > what would the best way to fix this?
>
> Call tech support...
>
> Colin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-09 Thread Colin Bean

On Tue, Dec 9, 2008 at 3:22 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> ok, server time is 2 hours and 11 minutes behind... this could explain
> the issue then. The admin section, when creating a new entry takes the
> time current actual time. So it makes 100% sense that django/python is
> reading the incorrect time. I've attempted to update the server time
> using the usual date "time" crap and was told the procedure was not
> allowed, i assume this is due the server being a virtual server.
>
> what would the best way to fix this?
>

Call tech support...

Colin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-09 Thread garagefan

ok, server time is 2 hours and 11 minutes behind... this could explain
the issue then. The admin section, when creating a new entry takes the
time current actual time. So it makes 100% sense that django/python is
reading the incorrect time. I've attempted to update the server time
using the usual date "time" crap and was told the procedure was not
allowed, i assume this is due the server being a virtual server.

what would the best way to fix this?

the detail.html does not use latest however

On Dec 9, 4:40 pm, garagefan <[EMAIL PROTECTED]> wrote:
> awesome, i will take a look at the server date. It is possible that it
> is off.
>
> On Dec 9, 3:57 pm, "Colin Bean" <[EMAIL PROTECTED]> wrote:
>
> > On Tue, Dec 9, 2008 at 12:16 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> > > Server is Red Hat 7, set up by godaddy, its a virtual server. Python
> > > 2.5 w/ mod_python and python-devel installed. running latest django.
>
> > > I am using webmonkey.com's tutorial for this:
> > >http://www.webmonkey.com/tutorial/Install_Django_and_Build_Your_First...
>
> > > so you can find the blog app as well as the templates in there. The
> > > part that is working instantly is the "secondary" section located in
> > > the base.html template that the other two blog templates extend
>
> > > thanks for lookin
>
> > Ah, didn't realize that it was showing one part of the page and not
> > another.  Looks like the template tag in the "secondary" section
> > queries all of the blog post objects, while the main section uses the
> > "latest" variable from django.views.generic.date_based.archive_index.
> > According to the docs, "Objects with a date in the future are not
> > included (in latest) unless you set allow_future to True."
>
> >http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-...
>
> > Any chance the dates on your posts are set to the future?  Is the date
> > set correctly on your server?
>
> > Colin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-09 Thread garagefan

awesome, i will take a look at the server date. It is possible that it
is off.

On Dec 9, 3:57 pm, "Colin Bean" <[EMAIL PROTECTED]> wrote:
> On Tue, Dec 9, 2008 at 12:16 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> > Server is Red Hat 7, set up by godaddy, its a virtual server. Python
> > 2.5 w/ mod_python and python-devel installed. running latest django.
>
> > I am using webmonkey.com's tutorial for this:
> >http://www.webmonkey.com/tutorial/Install_Django_and_Build_Your_First...
>
> > so you can find the blog app as well as the templates in there. The
> > part that is working instantly is the "secondary" section located in
> > the base.html template that the other two blog templates extend
>
> > thanks for lookin
>
> Ah, didn't realize that it was showing one part of the page and not
> another.  Looks like the template tag in the "secondary" section
> queries all of the blog post objects, while the main section uses the
> "latest" variable from django.views.generic.date_based.archive_index.
> According to the docs, "Objects with a date in the future are not
> included (in latest) unless you set allow_future to True."
>
> http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-...
>
> Any chance the dates on your posts are set to the future?  Is the date
> set correctly on your server?
>
> Colin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-09 Thread Jay Parlar

On Tue, Dec 9, 2008 at 3:57 PM, Colin Bean <[EMAIL PROTECTED]> wrote:
> Ah, didn't realize that it was showing one part of the page and not
> another.  Looks like the template tag in the "secondary" section
> queries all of the blog post objects, while the main section uses the
> "latest" variable from django.views.generic.date_based.archive_index.
> According to the docs, "Objects with a date in the future are not
> included (in latest) unless you set allow_future to True."
>
> http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-date-based-archive-index
>
> Any chance the dates on your posts are set to the future?  Is the date
> set correctly on your server?


Those were my thoughts as well. Depending on how the date gets set
when storing an item in the database, and what date/time gets used
when pulling it from the db, you could run into issues here. Try
passing allow_future=True in with the other arguments to the dict()

Jay P.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-09 Thread Colin Bean

On Tue, Dec 9, 2008 at 12:16 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> Server is Red Hat 7, set up by godaddy, its a virtual server. Python
> 2.5 w/ mod_python and python-devel installed. running latest django.
>
> I am using webmonkey.com's tutorial for this:
> http://www.webmonkey.com/tutorial/Install_Django_and_Build_Your_First_App
>
> so you can find the blog app as well as the templates in there. The
> part that is working instantly is the "secondary" section located in
> the base.html template that the other two blog templates extend
>
> thanks for lookin
>

Ah, didn't realize that it was showing one part of the page and not
another.  Looks like the template tag in the "secondary" section
queries all of the blog post objects, while the main section uses the
"latest" variable from django.views.generic.date_based.archive_index.
According to the docs, "Objects with a date in the future are not
included (in latest) unless you set allow_future to True."

http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-date-based-archive-index

Any chance the dates on your posts are set to the future?  Is the date
set correctly on your server?

Colin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-09 Thread garagefan

Server is Red Hat 7, set up by godaddy, its a virtual server. Python
2.5 w/ mod_python and python-devel installed. running latest django.

I am using webmonkey.com's tutorial for this:
http://www.webmonkey.com/tutorial/Install_Django_and_Build_Your_First_App

so you can find the blog app as well as the templates in there. The
part that is working instantly is the "secondary" section located in
the base.html template that the other two blog templates extend

thanks for lookin

On Dec 9, 2:58 pm, "Colin Bean" <[EMAIL PROTECTED]> wrote:
> On Sun, Dec 7, 2008 at 7:32 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> > following another tutorial to build a blog (webmonkey.com's) at it was
> > rather frustrating to see nothing show up after creating a new blog...
>
> > the admin section seems to see these right away, as they are there as
> > soon as you hit save. But it seems to take the one section 10-20(or
> > more?) minutes to read that they are there, while another section on
> > the same page (that lists the items by title) no time at all. though
> > when I update something that is listed already in the main section
> > (the area that takes a while to get new info) it gets updated
> > immediately... such as the title or entry
>
> >http://kennethdavid.net/mysite/blog/
>
> > most likely if you look within 5-10 minutes you'll see how there are
> > three entry titles, and two blogs... i'll go ahead and add another
> > entry, so at the very least there will be 4 titles and three available
> > entries...
>
> > what would possibly cause this?
>
> Also, what kind of server setup are you using?  Can you reproduce this
> issue on a local development server?
>
> Colin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-09 Thread Colin Bean

On Sun, Dec 7, 2008 at 7:32 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> following another tutorial to build a blog (webmonkey.com's) at it was
> rather frustrating to see nothing show up after creating a new blog...
>
> the admin section seems to see these right away, as they are there as
> soon as you hit save. But it seems to take the one section 10-20(or
> more?) minutes to read that they are there, while another section on
> the same page (that lists the items by title) no time at all. though
> when I update something that is listed already in the main section
> (the area that takes a while to get new info) it gets updated
> immediately... such as the title or entry
>
> http://kennethdavid.net/mysite/blog/
>
> most likely if you look within 5-10 minutes you'll see how there are
> three entry titles, and two blogs... i'll go ahead and add another
> entry, so at the very least there will be 4 titles and three available
> entries...
>
> what would possibly cause this?
> >
>

Also, what kind of server setup are you using?  Can you reproduce this
issue on a local development server?

Colin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-09 Thread Jay Parlar

On Tue, Dec 9, 2008 at 9:33 AM, garagefan <[EMAIL PROTECTED]> wrote:
>
> sure thing:
>
> from django.conf.urls.defaults import *
> from mysite.blog.models import Entry
> from tagging.views import tagged_object_list
>
> info_dict = {
>'queryset': Entry.objects.filter(status=1),
>'date_field': 'pub_date',
> }
>
> urlpatterns = patterns('django.views.generic.date_based',
>(r'(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?
> P[-\w]+)/$', 'object_detail', dict(info_dict,
> slug_field='slug',template_name='blog/detail.html')),
>(r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?
> P[-\w]+)/$', 'object_detail', dict(info_dict,
> template_name='blog/list.html')),
>(r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/
> $','archive_day',dict(info_dict,template_name='blog/list.html')),
>(r'^(?P\d{4})/(?P[a-z]{3})/$','archive_month',
> dict(info_dict, template_name='blog/list.html')),
>(r'^(?P\d{4})/$','archive_year', dict(info_dict,
> template_name='blog/list.html')),
>(r'^$','archive_index', dict(info_dict, template_name='blog/
> list.html')),
> )


Sorry, the problem I suspected isn't there, so I'm not sure what's going on.

Know this though: It's not a problem with Django, esp. since the items
are showing up instantaneously in some places. It just sounds like a
problem in your code.

Could you show the template section that takes such a long time?

Jay P.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-09 Thread garagefan

sure thing:

from django.conf.urls.defaults import *
from mysite.blog.models import Entry
from tagging.views import tagged_object_list

info_dict = {
'queryset': Entry.objects.filter(status=1),
'date_field': 'pub_date',
}

urlpatterns = patterns('django.views.generic.date_based',
(r'(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?
P[-\w]+)/$', 'object_detail', dict(info_dict,
slug_field='slug',template_name='blog/detail.html')),
(r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/(?
P[-\w]+)/$', 'object_detail', dict(info_dict,
template_name='blog/list.html')),
(r'^(?P\d{4})/(?P[a-z]{3})/(?P\w{1,2})/
$','archive_day',dict(info_dict,template_name='blog/list.html')),
(r'^(?P\d{4})/(?P[a-z]{3})/$','archive_month',
dict(info_dict, template_name='blog/list.html')),
(r'^(?P\d{4})/$','archive_year', dict(info_dict,
template_name='blog/list.html')),
(r'^$','archive_index', dict(info_dict, template_name='blog/
list.html')),
)


On Dec 8, 7:29 pm, "Jay Parlar" <[EMAIL PROTECTED]> wrote:
> Could you post your urls.py file for your blog app? It's very easy to
> make a mistake in there that results in confusing time-related errors.
>
> Jay P.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-08 Thread Jay Parlar

Could you post your urls.py file for your blog app? It's very easy to
make a mistake in there that results in confusing time-related errors.

Jay P.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-08 Thread garagefan

I've not set anything up...

On Dec 8, 1:48 am, "Alex Koshelev" <[EMAIL PROTECTED]> wrote:
> Do you use caching?
>
> On Mon, Dec 8, 2008 at 07:34, garagefan <[EMAIL PROTECTED]> wrote:
>
> > ok... i've been able to figure out how long it takes based on the time
> > stamp... an hour and a half for a new object to have come in. It
> > appears that the item is not readable by the two templates, one of
> > which using {%for object in latest $} and then another template that
> > doesn't use it at all.
>
> > the code that reads the objects instantly is:
>
> >  {% for obj in recent_posts %}
> >                                        
> >                                                
> > {{ obj.title}}
> >                                        
> >                                {% endfor %}
>
> > which is getting the info from:
>
> > from django.template import Library, Node
> > from django.db.models import get_model
>
> > register = Library()
>
> > class LatestContentNode(Node):
> >    def __init__(self, model, num, varname):
> >        self.num, self.varname = num, varname
> >        self.model = get_model(*model.split('.'))
>
> >    def render(self, context):
> >        context[self.varname] = self.model._default_manager.filter
> > (status=1)[:self.num]
> >        return ''
>
> > def get_latest(parser, token):
> >    bits = token.contents.split()
> >    if len(bits) != 5:
> >        raise TemplateSyntaxError, "get_latest tag takes exactly four
> > arguments"
> >    if bits[3] != 'as':
> >        raise TemplateSyntaxError, "third argument to get_latest tag
> > must be 'as'"
> >    return LatestContentNode(bits[1], bits[2], bits[4])
>
> > get_latest = register.tag(get_latest)
>
> > an hour and a half is a bit much... i could deal with 5-10 minutes,
> > but at the same time, if the "Recent entries" list reads
> > immediately... so should the rest of the site
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-07 Thread Alex Koshelev
Do you use caching?

On Mon, Dec 8, 2008 at 07:34, garagefan <[EMAIL PROTECTED]> wrote:

>
> ok... i've been able to figure out how long it takes based on the time
> stamp... an hour and a half for a new object to have come in. It
> appears that the item is not readable by the two templates, one of
> which using {%for object in latest $} and then another template that
> doesn't use it at all.
>
> the code that reads the objects instantly is:
>
>  {% for obj in recent_posts %}
>
>
> {{ obj.title}}
>
>{% endfor %}
>
> which is getting the info from:
>
> from django.template import Library, Node
> from django.db.models import get_model
>
> register = Library()
>
> class LatestContentNode(Node):
>def __init__(self, model, num, varname):
>self.num, self.varname = num, varname
>self.model = get_model(*model.split('.'))
>
>def render(self, context):
>context[self.varname] = self.model._default_manager.filter
> (status=1)[:self.num]
>return ''
>
> def get_latest(parser, token):
>bits = token.contents.split()
>if len(bits) != 5:
>raise TemplateSyntaxError, "get_latest tag takes exactly four
> arguments"
>if bits[3] != 'as':
>raise TemplateSyntaxError, "third argument to get_latest tag
> must be 'as'"
>return LatestContentNode(bits[1], bits[2], bits[4])
>
> get_latest = register.tag(get_latest)
>
> an hour and a half is a bit much... i could deal with 5-10 minutes,
> but at the same time, if the "Recent entries" list reads
> immediately... so should the rest of the site
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: time it takes django to read database?

2008-12-07 Thread garagefan

ok... i've been able to figure out how long it takes based on the time
stamp... an hour and a half for a new object to have come in. It
appears that the item is not readable by the two templates, one of
which using {%for object in latest $} and then another template that
doesn't use it at all.

the code that reads the objects instantly is:

  {% for obj in recent_posts %}


{{ obj.title}}

{% endfor %}

which is getting the info from:

from django.template import Library, Node
from django.db.models import get_model

register = Library()

class LatestContentNode(Node):
def __init__(self, model, num, varname):
self.num, self.varname = num, varname
self.model = get_model(*model.split('.'))

def render(self, context):
context[self.varname] = self.model._default_manager.filter
(status=1)[:self.num]
return ''

def get_latest(parser, token):
bits = token.contents.split()
if len(bits) != 5:
raise TemplateSyntaxError, "get_latest tag takes exactly four
arguments"
if bits[3] != 'as':
raise TemplateSyntaxError, "third argument to get_latest tag
must be 'as'"
return LatestContentNode(bits[1], bits[2], bits[4])

get_latest = register.tag(get_latest)

an hour and a half is a bit much... i could deal with 5-10 minutes,
but at the same time, if the "Recent entries" list reads
immediately... so should the rest of the site
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



time it takes django to read database?

2008-12-07 Thread garagefan

following another tutorial to build a blog (webmonkey.com's) at it was
rather frustrating to see nothing show up after creating a new blog...

the admin section seems to see these right away, as they are there as
soon as you hit save. But it seems to take the one section 10-20(or
more?) minutes to read that they are there, while another section on
the same page (that lists the items by title) no time at all. though
when I update something that is listed already in the main section
(the area that takes a while to get new info) it gets updated
immediately... such as the title or entry

http://kennethdavid.net/mysite/blog/

most likely if you look within 5-10 minutes you'll see how there are
three entry titles, and two blogs... i'll go ahead and add another
entry, so at the very least there will be 4 titles and three available
entries...

what would possibly cause this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---