Thank you very much Anssi. I just got it perfect :D I know i am so silly with errors. but i am beginner. Thanks alot. Can u help me one more error? I trying to make a db connection using postgresql and python2.7 when i type import postgresql and enter I get the following error:
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> import postgresql Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import postgresql ImportError: No module named postgresql >>> Help me plz On Feb 20, 1:49 pm, akaariai <akaar...@gmail.com> wrote: > On Feb 20, 10:01 am, kalyani ram <arch.kalu3...@gmail.com> wrote: > > > My urls.py is as follows. > > > from django.conf.urls.defaults import * > > from mysite.views import current_datetime, hours_ahead > > > urlpatterns = patterns('', > > (r'^time/$', current_datetime) > > (r'^time/plus/(\d{1,2})/$', hours_ahead), > > ) > > Missing comma after the first pattern. Thus you have (r'^time/$', > current_datetime)(...), which is syntax for calling the first tuple. > That causes the error. > > > def hours_ahead(request, offset): > > offset = int(offset) > > dt = datetime.datetime.now() + datetime.timedelta(hours=offset) > > return render_to_response('temp.html', {'hour_offset': offset}, > > {'next_time': dt }) > > If I am not mistaken you should not have two dictionaries on the last > line, just one: > {'hour_offset': offset, 'next_time': dt } > > - Anssi -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.