Error while importing URLconf 'mysite.urls': 'module' object has no attribute 'views'

8 views
Skip to first unread message

Chris Haynes

unread,
Jun 14, 2008, 9:16:26 PM6/14/08
to Django users
This error goes away if I remove the line
(r'^ptree/$', mysite.trees.views.parse_tree),
from the urlpatterns. But I can import trees.views from the shell

~/dj/mysite 144: manage.py shell
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import trees.views
>>> import urls
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "c:\Users\Chris\dj\mysite\urls.py", line 17, in <module>
(r'^ptree/$', mysite.trees.views.parse_tree),
AttributeError: 'module' object has no attribute 'views'
>>> # comment out line 17 in urls.py
>>> import urls
>>>

Using django 0.97 pre. There's another app in the site created some
time ago that works, but I've just created mysite.trees. Both are
imported in the INSTALLED_APPS list.
The only significant difference I note is the lack of a database model
in mysite trees, but don't see what that would have to do with this
error. Any help appreciated!

Chris Haynes

unread,
Jun 17, 2008, 9:17:43 AM6/17/08
to Django users
Resolved. Don't know how.
Reply all
Reply to author
Forward
0 new messages