Have you done
from yourapp.models import * from django.contrib import admin admin.site.register(Books) in admin.py? On Sep 26, 4:55 am, pengwupeng <pengwupeng2...@gmail.com> wrote: > the environment is apache+django, accessing my app is ok,but i > can't access the admin interface. > the configuration of the httpd.conf is likes this below: > Listen 127.0.0.1:8888 > <VirtualHost 127.0.0.1:8888> > <Location "/"> > SetHandler python-program > PythonPath "sys.path+['c:/']" > PythonHandler django.core.handlers.modpython > SetEnv DJANGO_SETTINGS_MODULE Djangoproject.settings > PythonInterpreter books > PythonDebug On > </Location> > > #Alias /site_media > Alias /site_media c:/Djangoproject/media > <Directory "c:/Djangoproject/media"> > AllowOverride None > Options FollowSymLinks MultiViews Indexes > Order allow,deny > Allow from all > </Directory> > <Location "/site_media/"> > SetHandler None > </Location> > > #Alias /media > Alias /media C:/Python25/Lib/site-packages/django/contrib/admin/media > <Directory "C:/Python25/Lib/site-packages/django/contrib/admin/media"> > AllowOverride None > Options FollowSymLinks MultiViews Indexes > Order allow,deny > Allow from all > </Directory> > <Location "/media/"> > SetHandler None > </Location> > # file types we want to serve statically > # case insensative match > <LocationMatch "(?i)\.(jpg|gif|png|txt|ico|pdf|css|jpeg|js)$"> > SetHandler None > </LocationMatch> > </VirtualHost> > > Environment: > > Request Method: GET > Request URL:http://localhost:8888/admin/ > Django Version: 1.1 > Python Version: 2.5.4 > Installed Applications: > ['django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.sites', > 'django.contrib.admin', > 'Djangoproject.books'] > Installed Middleware: > ('django.middleware.common.CommonMiddleware', > 'django.contrib.sessions.middleware.SessionMiddleware', > 'django.contrib.auth.middleware.AuthenticationMiddleware') > > Template error: > In template c:\python25\lib\site-packages\django\contrib\admin > \templates\admin\base.html, error at line 30 > Caught an exception while rendering: Could not import > Djangoproject.books.search. Error was: No module named books.models > 20 : <!-- Header --> > > 21 : <div id="header"> > > 22 : <div id="branding"> > > 23 : {% block branding %}{% endblock %} > > 24 : </div> > > 25 : {% if user.is_authenticated and user.is_staff %} > > 26 : <div id="user-tools"> > > 27 : {% trans 'Welcome,' %} > > 28 : <strong>{% firstof user.first_name user.username %} > </strong>. > > 29 : {% block userlinks %} > > 30 : {% url django-admindocs-docroot as docsroot > %} > > 31 : {% if docsroot %} > > 32 : <a href="{{ docsroot }}">{% trans > 'Documentation' %}</a> / > > 33 : {% endif %} > > 34 : {% url admin:password_change as > password_change_url %} > > 35 : {% if password_change_url %} > > 36 : <a href="{{ password_change_url }}"> > > 37 : {% else %} > > 38 : <a href="{{ root_path }}password_change/"> > > 39 : {% endif %} > > 40 : {% trans 'Change password' %}</a> / > > Traceback: > File "C:\Python25\Lib\site-packages\django\core\handlers\base.py" in > get_response > 92. response = callback(request, *callback_args, > **callback_kwargs) > File "C:\Python25\Lib\site-packages\django\contrib\admin\sites.py" in > wrapper > 196. return self.admin_view(view, cacheable)(*args, > **kwargs) > File "C:\Python25\Lib\site-packages\django\views\decorators\cache.py" > in _wrapped_view_func > 44. response = view_func(request, *args, **kwargs) > File "C:\Python25\Lib\site-packages\django\contrib\admin\sites.py" in > inner > 186. return view(request, *args, **kwargs) > File "C:\Python25\Lib\site-packages\django\views\decorators\cache.py" > in _wrapped_view_func > 44. response = view_func(request, *args, **kwargs) > File "C:\Python25\Lib\site-packages\django\contrib\admin\sites.py" in > index > 374. context_instance=context_instance > File "C:\Python25\Lib\site-packages\django\shortcuts\__init__.py" in > render_to_response > 20. return HttpResponse(loader.render_to_string(*args, > **kwargs), **httpresponse_kwargs) > File "C:\Python25\Lib\site-packages\django\template\loader.py" in > render_to_string > 108. return t.render(context_instance) > File "C:\Python25\Lib\site-packages\django\template\__init__.py" in > render > 178. return self.nodelist.render(context) > File "C:\Python25\Lib\site-packages\django\template\__init__.py" in > render > 779. bits.append(self.render_node(node, context)) > File "C:\Python25\Lib\site-packages\django\template\debug.py" in > render_node > 71. result = node.render(context) > File "C:\Python25\Lib\site-packages\django\template\loader_tags.py" in > render > 97. return compiled_parent.render(context) > File "C:\Python25\Lib\site-packages\django\template\__init__.py" in > render > 178. return self.nodelist.render(context) > File "C:\Python25\Lib\site-packages\django\template\__init__.py" in > render > 779. bits.append(self.render_node(node, context)) > File "C:\Python25\Lib\site-packages\django\template\debug.py" in > render_node > 71. result = node.render(context) > File "C:\Python25\Lib\site-packages\django\template\loader_tags.py" in > render > 97. return compiled_parent.render(context) > File "C:\Python25\Lib\site-packages\django\template\__init__.py" in > render > 178. return self.nodelist.render(context) > File "C:\Python25\Lib\site-packages\django\template\__init__.py" in > render > 779. bits.append(self.render_node(node, context)) > File "C:\Python25\Lib\site-packages\django\template\debug.py" in > render_node > 71. result = node.render(context) > File "C:\Python25\Lib\site-packages\django\template\defaulttags.py" in > render > 243. return self.nodelist_true.render(context) > File "C:\Python25\Lib\site-packages\django\template\__init__.py" in > render > 779. bits.append(self.render_node(node, context)) > File "C:\Python25\Lib\site-packages\django\template\debug.py" in > render_node > 71. result = node.render(context) > File "C:\Python25\Lib\site-packages\django\template\defaulttags.py" in > render > 253. return self.nodelist_true.render(context) > File "C:\Python25\Lib\site-packages\django\template\__init__.py" in > render > 779. bits.append(self.render_node(node, context)) > File "C:\Python25\Lib\site-packages\django\template\debug.py" in > render_node > 71. result = node.render(context) > File "C:\Python25\Lib\site-packages\django\template\loader_tags.py" in > render > 24. result = self.nodelist.render(context) > File "C:\Python25\Lib\site-packages\django\template\__init__.py" in > render > 779. bits.append(self.render_node(node, context)) > File "C:\Python25\Lib\site-packages\django\template\debug.py" in > render_node > 81. raise wrapped > > Exception Type: TemplateSyntaxError at /admin/ > Exception Value: Caught an exception while rendering: Could not import > Djangoproject.books.search. Error was: No module named books.models > > Original Traceback (most recent call last): > File "C:\Python25\Lib\site-packages\django\template\debug.py", line > 71, in render_node > result = node.render(context) > File "C:\Python25\Lib\site-packages\django\template\defaulttags.py", > line 370, in render > url = reverse(self.view_name, args=args, kwargs=kwargs, > current_app=context.current_app) > File "C:\Python25\Lib\site-packages\django\core\urlresolvers.py", > line 341, in reverse > *args, **kwargs))) > File "C:\Python25\Lib\site-packages\django\core\urlresolvers.py", > line 275, in reverse > possibilities = self.reverse_dict.getlist(lookup_view) > File "C:\Python25\Lib\site-packages\django\core\urlresolvers.py", > line 195, in _get_reverse_dict > self._populate() > File "C:\Python25\Lib\site-packages\django\core\urlresolvers.py", > line 187, in _populate > lookups.appendlist(pattern.callback, (bits, p_pattern)) > File "C:\Python25\Lib\site-packages\django\core\urlresolvers.py", > line 134, in _get_callback > raise ViewDoesNotExist, "Could not import %s. Error was: %s" % > (mod_name, str(e)) > ViewDoesNotExist: Could not import Djangoproject.books.search. Error > was: No module named books.models --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---