So I switched from mod_python to mod_wsgi since I don;t really know
what is going on and I realise mod_wsgi is recommended for 1.1 now.
Anyway the rest of my site works fine now. The only part still not
working is the admin section which fails with this "No module named
urls" error as can be seen in the traceback above.

For my settings I have the root urlconf as "myapp.urls".

In the urls file I have:

(r'^admin/(.*)', include('admin.site.urls')),

as is specified in the latest release notes. Although googling around
it is confusing as to whether this should be used or:

(r'^admin/(.*)', include('admin.site.root')),

should be used. Also I'm not sure if I should substitute "site" for
"myapp" in here.

Again I have found a couple of threads where someone has experienced
something similar better exaclty the same as what I am experiencing.
Any further suggestions?

Many thanks

On Jul 9, 5:44 pm, huw_at1 <huwdjo...@gmail.com> wrote:
> Hmm I didn't change any imports as far as i am aware.
>
> By full traceback do you mean the entirety of the error in the error
> log?
>
> Such as:
>
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] mod_python
> (pid=26734, interpreter='ccprod.arrowt.co.uk', phase='PythonHandler',
> handler='django.core.handlers.modpython'): Application error
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] ServerName:
> 'ccprod.arrowt.co.uk'
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] DocumentRoot:
> '/var/www'
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] URI: '/admin'
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Location: '/'
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Directory:
> None
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Filename: '/
> var/www/admin'
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] PathInfo: ''
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] Traceback
> (most recent call last):
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/mod_python/importer.py", line 1542, in
> HandlerDispatch\n    default=default_handler, arg=req,
> silent=hlist.silent)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/mod_python/importer.py", line 1234, in
> _process_target\n    result = _execute_target(config, req, object,
> arg)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/mod_python/importer.py", line 1133, in
> _execute_target\n    result = object(arg)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/handlers/modpython.py", line
> 228, in handler\n    return ModPythonHandler()(req)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/handlers/modpython.py", line
> 201, in __call__\n    response = self.get_response(request)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/handlers/base.py", line 73, in
> get_response\n    response = middleware_method(request)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/middleware/common.py", line 57, in
> process_request\n    _is_valid_path("%s/" % request.path_info)):
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/middleware/common.py", line 142, in
> _is_valid_path\n    urlresolvers.resolve(path)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/urlresolvers.py", line 262, in
> resolve\n    return get_resolver(urlconf).resolve(path)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/urlresolvers.py", line 186, in
> resolve\n    sub_match = pattern.resolve(new_path)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/urlresolvers.py", line 184, in
> resolve\n    for pattern in self.url_patterns:
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/urlresolvers.py", line 213, in
> _get_url_patterns\n    patterns = getattr(self.urlconf_module,
> "urlpatterns", self.urlconf_module)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/core/urlresolvers.py", line 208, in
> _get_urlconf_module\n    self._urlconf_module = import_module
> (self.urlconf_name)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20]   File "/usr/
> lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in
> import_module\n    __import__(name)
> [Thu Jul 09 16:24:08 2009] [error] [client 192.168.2.20] ImportError:
> No module named urls
>
> On 9 July, 16:59, Friðrik Már Jónsson <frid...@pyth.net> wrote:
>
> > Hey!
>
> > A full traceback could be helpful.
>
> > A lot of time when you've got really strange import errors they have  
> > something to do with circular imports. Did you change any imports  
> > right before or after the upgrade?
>
> > Regards,
> > Friðrik Már
>
> > On Jul 9, 2009, at 3:25 PM, huw_at1 wrote:
>
> > > Hi all,
>
> > > I have just been moving my website to a production server and am
> > > having some difficulty getting it working. I have upgraded the Django
> > > from 1.0 on my development server to 1.1 on the production server.
> > > When I try to access the admin pages I get an Internal Server Error
> > > and a message in the apache logs stating "Import Error: No module
> > > named urls". I have tried running the shell and importing the urls
> > > module from within and outside of the local directory both of which
> > > work fine.
>
> > > I'm guessing it's either some value in my settings file or something
> > > is non-backwards compatible going from 1.0 to 1.1 but I am a bit
> > > clueless as to what atm. Any suggestions would be most welcome.
>
> > > Many thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to