Re: can't show admin interface
It does nothing to help you solve your problem, but mod_wsgi is generally preferred above mod python. Good luck solving the problem! Wim On Sep 26, 10:06 am, nausikaawrote: > 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 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: > > > > > > SetHandler python-program > > PythonPath "sys.path+['c:/']" > > PythonHandler django.core.handlers.modpython > > SetEnv DJANGO_SETTINGS_MODULE Djangoproject.settings > > PythonInterpreter books > > PythonDebug On > > > > > #Alias /site_media > > Alias /site_media c:/Djangoproject/media > > > > AllowOverride None > > Options FollowSymLinks MultiViews Indexes > > Order allow,deny > > Allow from all > > > > > > SetHandler None > > > > > #Alias /media > > Alias /media C:/Python25/Lib/site-packages/django/contrib/admin/media > > > > AllowOverride None > > Options FollowSymLinks MultiViews Indexes > > Order allow,deny > > Allow from all > > > > > > SetHandler None > > > > # file types we want to serve statically > > # case insensative match > > > > SetHandler None > > > > > > > Environment: > > > Request Method: GET > > Request URL:http://localhost:/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 : > > > 21 : > > > 22 : > > > 23 : {% block branding %}{% endblock %} > > > 24 : > > > 25 : {% if user.is_authenticated and user.is_staff %} > > > 26 : > > > 27 : {% trans 'Welcome,' %} > > > 28 : {% firstof user.first_name user.username %} > > . > > > 29 : {% block userlinks %} > > > 30 : {% url django-admindocs-docroot as docsroot > > %} > > > 31 : {% if docsroot %} > > > 32 : {% trans > > 'Documentation' %} / > > > 33 : {% endif %} > > > 34 : {% url admin:password_change as > > password_change_url %} > > > 35 : {% if password_change_url %} > > > 36 : > > > 37 : {% else %} > > > 38 : > > > 39 : {% endif %} > > > 40 : {% trans 'Change password' %} / > > > 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
Re: can't show admin interface
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, pengwupengwrote: > 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: > > > SetHandler python-program > PythonPath "sys.path+['c:/']" > PythonHandler django.core.handlers.modpython > SetEnv DJANGO_SETTINGS_MODULE Djangoproject.settings > PythonInterpreter books > PythonDebug On > > > #Alias /site_media > Alias /site_media c:/Djangoproject/media > > AllowOverride None > Options FollowSymLinks MultiViews Indexes > Order allow,deny > Allow from all > > > SetHandler None > > > #Alias /media > Alias /media C:/Python25/Lib/site-packages/django/contrib/admin/media > > AllowOverride None > Options FollowSymLinks MultiViews Indexes > Order allow,deny > Allow from all > > > SetHandler None > > # file types we want to serve statically > # case insensative match > > SetHandler None > > > > Environment: > > Request Method: GET > Request URL:http://localhost:/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 : > > 21 : > > 22 : > > 23 : {% block branding %}{% endblock %} > > 24 : > > 25 : {% if user.is_authenticated and user.is_staff %} > > 26 : > > 27 : {% trans 'Welcome,' %} > > 28 : {% firstof user.first_name user.username %} > . > > 29 : {% block userlinks %} > > 30 : {% url django-admindocs-docroot as docsroot > %} > > 31 : {% if docsroot %} > > 32 : {% trans > 'Documentation' %} / > > 33 : {% endif %} > > 34 : {% url admin:password_change as > password_change_url %} > > 35 : {% if password_change_url %} > > 36 : > > 37 : {% else %} > > 38 : > > 39 : {% endif %} > > 40 : {% trans 'Change password' %} / > > 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.
can't show admin interface
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: SetHandler python-program PythonPath "sys.path+['c:/']" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE Djangoproject.settings PythonInterpreter books PythonDebug On #Alias /site_media Alias /site_media c:/Djangoproject/media AllowOverride None Options FollowSymLinks MultiViews Indexes Order allow,deny Allow from all SetHandler None #Alias /media Alias /media C:/Python25/Lib/site-packages/django/contrib/admin/media AllowOverride None Options FollowSymLinks MultiViews Indexes Order allow,deny Allow from all SetHandler None # file types we want to serve statically # case insensative match SetHandler None Environment: Request Method: GET Request URL: http://localhost:/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 : 21 : 22 : 23 : {% block branding %}{% endblock %} 24 : 25 : {% if user.is_authenticated and user.is_staff %} 26 : 27 : {% trans 'Welcome,' %} 28 : {% firstof user.first_name user.username %} . 29 : {% block userlinks %} 30 : {% url django-admindocs-docroot as docsroot %} 31 : {% if docsroot %} 32 : {% trans 'Documentation' %} / 33 : {% endif %} 34 : {% url admin:password_change as password_change_url %} 35 : {% if password_change_url %} 36 : 37 : {% else %} 38 : 39 : {% endif %} 40 : {% trans 'Change password' %} / 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