Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6359393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:30:43+00:00 2026-05-24T23:30:43+00:00

I am going through some tutorials of learning Django for an upcoming project, and

  • 0

I am going through some tutorials of learning Django for an upcoming project, and I could not load templates correctly. The debug mode returns a “ValueError” saying that it “need more than 1 value to unpack”. I am running Django’s bundled server. Any idea what’s the problem? Any help is appreciated.

Here’s the trace:

Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
  111. response = callback(request, *callback_args, **callback_kwargs)

File "/Users/tinwaijosephlee/Sites/djcode/dev2/../dev2/views.py" in hours_ahead
  26. return render_to_response('plus.html', {'offset': offset, 'dt': dt})

File "/Library/Python/2.7/site-packages/django/shortcuts/__init__.py" in render_to_response
  20. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)

File "/Library/Python/2.7/site-packages/django/template/loader.py" in render_to_string
  181. t = get_template(template_name)

File "/Library/Python/2.7/site-packages/django/template/loader.py" in get_template
  157. template, origin = find_template(template_name)

File "/Library/Python/2.7/site-packages/django/template/loader.py" in find_template
  128. loader = find_template_loader(loader_name)

File "/Library/Python/2.7/site-packages/django/template/loader.py" in find_template_loader
  93. module, attr = loader.rsplit('.', 1)

Here’s my view code:

from django.shortcuts import render_to_response
from django.http import HttpResponse

import datetime
import sys
import os

def current_datetime(request):
    now = datetime.datetime.now()
    return render_to_response('current_datetime.html', {'current_date': now})

def hours_ahead(request, offset):
    offset = int(offset)
    dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
    return render_to_response('plus.html', {'offset': offset, 'dt': dt})

Here’s my urls.py

from django.conf.urls.defaults import *
from dev2.views import *

urlpatterns = patterns('',
    (r'^time/$', current_datetime),
    (r'^time/plus/(\d{1,2})/$', hours_ahead),
)

Here’s the template loader config in settings.py

TEMPLATE_LOADERS = (
    '/Users/some_user_name/Sites/djcode/dev2/template',
)

And here’s the template html file

<html><head></head><body>It is now {{ current_date }}.</body></html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:30:44+00:00Added an answer on May 24, 2026 at 11:30 pm

    You’ve set the wrong thing in settings.py. TEMPLATE_LOADERS is for Python code that finds and loads templates. You want to put your directory into TEMPLATE_DIRS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been going through some good (seeming) resources for Rails tutorials, and will dutifully
I am going through some example assembly code for 16-bit real mode. I've come
I'm new to Android development and I'm currently going through some tutorials. When I
I've been going through some tutorials on working with sqlite databases and they all
I recently started picking up vi , going through some tutorials and trying to
I am going through a series of NeHe OpenGK tutorials. Tutorial #9 does some
I'm beginning with backbone.js Going through some tutorials, like the one shown below. I
After going through some tutorials on asp.net mvc the repository pattern came up and
I'm new to python and have been going through some tutorials on log parsing
after going through some basic tutorials on the app engine and the webapp framework,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.