Re: 'str' object has no attribute 'resolve'

227 views
Skip to first unread message

Xavier Ordoquy

unread,
Jun 19, 2012, 4:29:04 PM6/19/12
to django...@googlegroups.com

Hi,

1) 
uncomment the two lines to enable admin as it is said:
from django.contrib import admin
admin.autodiscover()


2) use:
    url(r'^admin/', include(admin.site.urls)),


Regards,
Xavier Ordoquy,
Linovia.

Le 19 juin 2012 à 17:53, Sabbineni Navneet a écrit :

This is my url.py file:
from django.conf.urls.defaults import *

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



urlpatterns = patterns('',

     (r'^admin/$', include('django.contrib.admin.urls')),
)
    # Examples:
    # url(r'^$', 'mysite.views.home', name='home'),
    # url(r'^mysite/', include('mysite.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
Please help

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/RylRYGAjC-oJ.
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.

Sabbineni Navneet

unread,
Jun 19, 2012, 4:33:52 PM6/19/12
to django...@googlegroups.com
still it shows the same error

Sabbineni Navneet

unread,
Jun 19, 2012, 4:34:40 PM6/19/12
to django...@googlegroups.com
it still shows the same error

Babatunde Akinyanmi

unread,
Jun 19, 2012, 5:16:15 PM6/19/12
to django...@googlegroups.com
Hi. Give the full traceback please. It'll be easier to assist with the
information
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/7Y67BJIlJyMJ.
> 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.
>
>

--
Sent from my mobile device

Xavier Ordoquy

unread,
Jun 19, 2012, 6:00:37 PM6/19/12
to django...@googlegroups.com
Hi,

If you just return the original urls.py, there's no way we can know what you did and this will prevents us from helping you.
As mentioned by Babatunde, you should give the traceback and the modified urls (use dpaste.com for that).

Regards,
Xavier Ordoquy,
Linovia.

Le 19 juin 2012 à 18:34, Sabbineni Navneet a écrit :

Kurtis Mullins

unread,
Jun 19, 2012, 7:01:46 PM6/19/12
to django...@googlegroups.com
Those URLs are outside of the tuple. Also, you're not using url() types to define the urls so any reverse lookup will fail.

Sabbineni Navneet

unread,
Jun 20, 2012, 6:04:39 AM6/20/12
to django...@googlegroups.com
This is the tracsback:
Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/admin

Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'mysite.books']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in get_response
  89.                     response = middleware_method(request)
File "C:\Python27\lib\site-packages\django\middleware\common.py" in process_request
  67.             if (not _is_valid_path(request.path_info, urlconf) and
File "C:\Python27\lib\site-packages\django\middleware\common.py" in _is_valid_path
  154.         urlresolvers.resolve(path, urlconf)
File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in resolve
  342.     return get_resolver(urlconf).resolve(path)
File "C:\Python27\lib\site-packages\django\core\urlresolvers.py" in resolve
  252.                     sub_match = pattern.resolve(new_path)

Exception Type: AttributeError at /admin
Exception Value: 'str' object has no attribute 'resolve'
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
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+unsubscribe@googlegroups.com.

Sabbineni Navneet

unread,
Jun 20, 2012, 6:06:44 AM6/20/12
to django...@googlegroups.com
Hello Kurtis can u explain it again ,i did not get u.


On Wednesday, June 20, 2012 12:31:46 AM UTC+5:30, Kurtis wrote:
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

--
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+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages