Thanks for the reply. Again, my goal is just to access admin site successfully.
Okay, referencing: http://www.djangobook.com/en/1.0/chapter06/ My urls.py: from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: ###from django.contrib import admin ###admin.autodiscover() from mysite.views import hello from mysite.views import my_homepage_view from mysite.views import current_datetime, hours_ahead urlpatterns = patterns('', ('^hello/$', hello), ('^$', my_homepage_view), ('^time/$', current_datetime), (r'^time/plus/(\d{1,2})/$', hours_ahead), #(r'^admin/', include(admin.site.urls)), (r'^admin/', include('django.contrib.admin.urls')), ) Part of my settings.py:Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 278, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 635, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.5/site-packages/django/core/handlers/ wsgi.py", line 239, in __call__ response = self.get_response(request) File "/usr/lib/python2.5/site-packages/django/core/handlers/ base.py", line 67, in get_response response = middleware_method(request) File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 57, in process_request _is_valid_path("%s/" % request.path_info)): File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 142, in _is_valid_path urlresolvers.resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 246, in resolve return get_resolver(urlconf).resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 181, in resolve sub_match = pattern.resolve(new_path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 179, in resolve for pattern in self.urlconf_module.urlpatterns: File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) ImportError: No module named urls MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) ROOT_URLCONF = 'mysite.urls' INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.sessions', #'django.contrib.sites', #'pksite.polls', 'django.contrib.auth', 'django.contrib.admin', 'mysite.books', ) models.py is as follows: from django.db import models Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 278, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 635, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.5/site-packages/django/core/handlers/ wsgi.py", line 239, in __call__ response = self.get_response(request) File "/usr/lib/python2.5/site-packages/django/core/handlers/ base.py", line 67, in get_response response = middleware_method(request) File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 57, in process_request _is_valid_path("%s/" % request.path_info)): File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 142, in _is_valid_path urlresolvers.resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 246, in resolve return get_resolver(urlconf).resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 181, in resolve sub_match = pattern.resolve(new_path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 179, in resolve for pattern in self.urlconf_module.urlpatterns: File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) ImportError: No module named urls Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 278, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 635, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.5/site-packages/django/core/handlers/ wsgi.py", line 239, in __call__ response = self.get_response(request) File "/usr/lib/python2.5/site-packages/django/core/handlers/ base.py", line 67, in get_response response = middleware_method(request) File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 57, in process_request _is_valid_path("%s/" % request.path_info)): File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 142, in _is_valid_path urlresolvers.resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 246, in resolve return get_resolver(urlconf).resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 181, in resolve sub_match = pattern.resolve(new_path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 179, in resolve for pattern in self.urlconf_module.urlpatterns: File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) ImportError: No module named urls Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 278, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 635, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.5/site-packages/django/core/handlers/ wsgi.py", line 239, in __call__ response = self.get_response(request) File "/usr/lib/python2.5/site-packages/django/core/handlers/ base.py", line 67, in get_response response = middleware_method(request) File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 57, in process_request _is_valid_path("%s/" % request.path_info)): File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 142, in _is_valid_path urlresolvers.resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 246, in resolve return get_resolver(urlconf).resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 181, in resolve sub_match = pattern.resolve(new_path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 179, in resolve for pattern in self.urlconf_module.urlpatterns: File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) ImportError: No module named urls Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 278, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 635, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.5/site-packages/django/core/handlers/ wsgi.py", line 239, in __call__ response = self.get_response(request) File "/usr/lib/python2.5/site-packages/django/core/handlers/ base.py", line 67, in get_response response = middleware_method(request) File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 57, in process_request _is_valid_path("%s/" % request.path_info)): File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 142, in _is_valid_path urlresolvers.resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 246, in resolve return get_resolver(urlconf).resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 181, in resolve sub_match = pattern.resolve(new_path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 179, in resolve for pattern in self.urlconf_module.urlpatterns: File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) ImportError: No module named urls # Create your models here. from django.db import models class Publisher(models.Model): name = models.CharField(max_length=30) address = models.CharField(max_length=50) city = models.CharField(max_length=60) state_province = models.CharField(max_length=30) country = models.CharField(max_length=50) website = models.URLField() class Author(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=40) email = models.EmailField() class Book(models.Model): title = models.CharField(max_length=100) authors = models.ManyToManyField(Author) publisher = models.ForeignKey(Publisher) publication_date = models.DateField() def __str__(self): return self.title class Admin: pass Here's the error when I try to hit the admin site: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 278, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.5/site-packages/django/core/servers/ basehttp.py", line 635, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.5/site-packages/django/core/handlers/ wsgi.py", line 239, in __call__ response = self.get_response(request) File "/usr/lib/python2.5/site-packages/django/core/handlers/ base.py", line 67, in get_response response = middleware_method(request) File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 57, in process_request _is_valid_path("%s/" % request.path_info)): File "/usr/lib/python2.5/site-packages/django/middleware/common.py", line 142, in _is_valid_path urlresolvers.resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 246, in resolve return get_resolver(urlconf).resolve(path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 181, in resolve sub_match = pattern.resolve(new_path) File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 179, in resolve for pattern in self.urlconf_module.urlpatterns: File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py", line 198, in _get_urlconf_module self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) ImportError: No module named urls Okay, given the details, does anyone know what I did wrong. Pretty much following the example, as you can see by the source. Thanks for any insights and help. Pat On Apr 8, 10:06 pm, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Wed, Apr 8, 2009 at 10:24 AM, Xpineapple <kenned...@gmail.com> wrote: > > > Per manual (www.djangobook.com/en/2.0/), Chapter 6, I try to setup > > the admin site. My version of Django is (1, 0, 2, 'final', 0) which > > is covered by this manual. > > > However, after following guidance on activating site, I get this error > > when running server and going tohttp://127.0.0.1:8000/admin/- > > > AttributeError: 'AdminSite' object has no attribute 'urls' > > > The steps are very easy to follow, so perhaps something is problematic > > here? I am running on Linux Fedora 10 X84_64. Please help. Thanks... > > Those refer to the 1.1(dev version now) and beyond way of hooking up admin > urls. Consult the Django 1.0 docs for how to hook up the urls(everything > else is the same). > > Alex > > -- > "I disapprove of what you say, but I will defend to the death your right to > say it." --Voltaire > "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---