By the way, the specific exception text and trace are:
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
101. request.path_info)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
300. sub_match = pattern.resolve(new_path)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
300. sub_match = pattern.resolve(new_path)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
209. return ResolverMatch(self.callback, args, kwargs,
self.name)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in callback
216. self._callback = get_callable(self._callback_str)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py" in wrapper
27. result = func(*args)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in get_callable
108. (lookup_view, mod_name))
Exception Type: ViewDoesNotExist at /
Exception Value: Could not import myproject.views.home. Parent module myproject.views does not exist.
On Tue, Dec 11, 2012 at 4:36 AM, Sithembewena Lloyd Dube
<zeb...@gmail.com> wrote:
Hi all,
I have a Django project running Django 1.4.1. (just upgraded). My TEMPLATE_DIRS entry is:
'/home/mymachine/Code/myproject/templates/myapp',
and that is exactly where the index template of the new project is even when i use Firefox to locate it.
In my home view, I call render_to_response as follows:
'def home(request):
return render_to_response('tracks/index.html', {})',
This raises an exception of type ViewDoesNotExist. If I run python manage.py shell, import the view and call it with None as an argument for request, it shows that a response object is returned. Yet, the browser will not render it.
>>> from tracks.views import home as h
>>> h(None)
<django.http.HttpResponse object at 0x95fdeac>
>>> dir(h(None))
['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__', '__getstate__', '__hash__', '__init__', '__iter__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_base_content_is_iter', '_charset', '_container', '_convert_to_ascii', '_get_content', '_headers', '_set_content', 'close', 'content', 'cookies', 'delete_cookie', 'flush', 'get', 'has_header', 'items', 'next', 'set_cookie', 'set_signed_cookie', 'status_code', 'tell', 'write']
Am I missing something?
Thanks.
--
Regards,
Sithu Lloyd Dube
--
Regards,
Sithu Lloyd Dube