error in urls.py

18 views
Skip to first unread message

andy saksena

unread,
May 3, 2010, 3:27:44 AM5/3/10
to Django users
Hi

my urls.py is

from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns(”,
# Example:
# (r’^xxxx/’, include(‘xxxx.foo.urls’)),
(r’^accounts/’, include(‘registration.backends.default.urls’)),
# Uncomment the admin/doc line below and add
‘django.contrib.admindocs’
# to INSTALLED_APPS to enable admin documentation:
# (r’^admin/doc/’, include(‘django.contrib.admindocs.urls’)),
#(r’^accounts/’, include(‘xxxx.newapp.urls’)),
# Uncomment the next line to enable the admin:
(r’^admin/’, include(admin.site.urls)),
(r’^accounts/register/$’,register,
{‘form_class’:RegistrationForm,’profile_callback’:UserProfile.objects.profile_callback},name
= ‘registration_register’),
)

but when I try looking under accounts/register I get this error
“”
SyntaxError at /accounts/logout/

(‘invalid syntax’, (‘/home/andy/src/python/django/xxxx/../xxxx/
urls.py’, 17, 132, ” (r’^accounts/register/$’,register,
{‘form_class’:RegistrationForm,’profile_callback’:UserProfile.objects.profile_callback},name
= ‘registration_register’),\n”))

“”

Can anyone help me with this.
Thanks in advance
Andy

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Daniel Roseman

unread,
May 3, 2010, 4:41:00 AM5/3/10
to Django users
On May 3, 8:27 am, andy saksena <andy.saks...@gmail.com> wrote:
> Hi
>
> my urls.py is
>
> from django.conf.urls.defaults import *
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns(”,
> # Example:
> # (r’^xxxx/’, include(‘xxxx.foo.urls’)),
> (r’^accounts/’, include(‘registration.backends.default.urls’)),
> # Uncomment the admin/doc line below and add
> ‘django.contrib.admindocs’
> # to INSTALLED_APPS to enable admin documentation:
> # (r’^admin/doc/’, include(‘django.contrib.admindocs.urls’)),
> #(r’^accounts/’, include(‘xxxx.newapp.urls’)),
> # Uncomment the next line to enable the admin:
> (r’^admin/’, include(admin.site.urls)),
> (r’^accounts/register/$’,register,
> {‘form_class’:RegistrationForm,’profile_callback’:UserProfile.objects.profi le_callback},name
> = ‘registration_register’),
> )
>
> but when I try looking under accounts/register I get this error
> “”
> SyntaxError at /accounts/logout/
>
> (‘invalid syntax’, (‘/home/andy/src/python/django/xxxx/../xxxx/
> urls.py’, 17, 132, ” (r’^accounts/register/$’,register,
> {‘form_class’:RegistrationForm,’profile_callback’:UserProfile.objects.profi le_callback},name
> = ‘registration_register’),\n”))
>
> “”
>
> Can anyone help me with this.
> Thanks in advance
> Andy
>

As the error message says, you've got an obvious syntax error - a
space in 'profi le_callback'. But when you fix this, you'll still have
a problem, because you aren't importing UserProfile anywhere, so
you'll get a NameError.
--
DR.

andy saksena

unread,
May 4, 2010, 8:03:35 PM5/4/10
to Django users
Thanks that resolved.


On May 3, 5:41 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
Reply all
Reply to author
Forward
0 new messages