name 'url' is not defined

2,894 views
Skip to first unread message

Keyton Weissinger

unread,
Nov 9, 2008, 4:11:17 PM11/9/08
to Pinax Users
I posted this in Django Users too, just in case...

I'm trying to get Pinax 0.5.0 set up on a windows XP box using Django
1.0. I'm just trying to get the BASIC project setup. No customization.
I've executed the Windows-specific warning here:
http://pinaxproject.com/docs/0.5.0/install.html

I did that and it seems no matter what I've tried (and I've tried a
fair bit), I keep getting the following error:
Traceback:
File "C:\Python25\lib\site-packages\django\core\handlers\base.py" in
get_response
77. request.path_info)
File "C:\Python25\lib\site-packages\django\core\urlresolvers.py" in
resolve
178. for pattern in self.urlconf_module.urlpatterns:
File "C:\Python25\lib\site-packages\django\core\urlresolvers.py" in
_get_urlconf_module
197. self._urlconf_module =
__import__(self.urlconf_name, {}, {}, [''])
File "C:\kweissinger\Tools\pinax\projects\basic_project\..
\basic_project\urls.py"
in <module>
12. url(r'^$', direct_to_template, {"template":
"homepage.html"}, name="home"),

Exception Type: NameError at /
Exception Value: name 'url' is not defined

Any one dealt with this? There seems to be some tantalizingly
promising hits on Google but I've been looking through them for an
hour and can't figure it out. Would love to start digging into Pinax
and use it, but I can't seem to get it going.

And before anyone chimes in with "Get a real OS", I know I know. It
would certainly help in this problem. But that's not an option this
afternoon.

Thank you in advance!

Keyton

Brian Rosner

unread,
Nov 9, 2008, 4:16:47 PM11/9/08
to pinax...@googlegroups.com
On Sun, Nov 9, 2008 at 2:11 PM, Keyton Weissinger <key...@gmail.com> wrote:
>
> I did that and it seems no matter what I've tried (and I've tried a
> fair bit), I keep getting the following error:
> Traceback:
> File "C:\Python25\lib\site-packages\django\core\handlers\base.py" in
> get_response
> 77. request.path_info)
> File "C:\Python25\lib\site-packages\django\core\urlresolvers.py" in
> resolve
> 178. for pattern in self.urlconf_module.urlpatterns:
> File "C:\Python25\lib\site-packages\django\core\urlresolvers.py" in
> _get_urlconf_module
> 197. self._urlconf_module =
> __import__(self.urlconf_name, {}, {}, [''])
> File "C:\kweissinger\Tools\pinax\projects\basic_project\..
> \basic_project\urls.py"
> in <module>
> 12. url(r'^$', direct_to_template, {"template":
> "homepage.html"}, name="home"),
>
> Exception Type: NameError at /
> Exception Value: name 'url' is not defined
>

Can you use dpaste to show us your urls.py? url is defined in
django.conf.urls.defaults and it is very common that you see a rom
django.conf.urls.defaults import * import in your urls.py.

--
Brian Rosner
http://oebfare.com

Keyton Weissinger

unread,
Nov 9, 2008, 5:34:03 PM11/9/08
to Pinax Users
from django.conf.urls.defaults import *
from django.conf import settings

from django.views.generic.simple import direct_to_template

from django.contrib import admin
admin.autodiscover()

import os

urlpatterns = patterns('',
url(r'^$', direct_to_template, {"template": "homepage.html"},
name="home"),

(r'^about/', include('about.urls')),
(r'^account/', include('account.urls')),
(r'^openid/', include('account.openid_urls')),
(r'^profiles/', include('basic_profiles.urls')),
(r'^notices/', include('notification.urls')),
(r'^announcements/', include('announcements.urls')),

(r'^admin/(.*)', admin.site.root),
)

if settings.DEBUG:
urlpatterns += patterns('',
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': os.path.join(os.path.dirname(__file__),
"site_media")}),
)

Keyton Weissinger

unread,
Nov 9, 2008, 5:38:06 PM11/9/08
to Pinax Users
DOH!!!!

Sorry. Here's the DPaste URL:
http://dpaste.com/89672/

I tried changing the import to importing url directly. I then get a
problem somewhere deeper but still no dice...

Thank you!

K

James Tauber

unread,
Nov 9, 2008, 9:43:53 PM11/9/08
to pinax...@googlegroups.com

For anyone not on #pinax, we sorted this out there. Basically django
was b0rked on Keyton's box.

James

Reply all
Reply to author
Forward
0 new messages