jadolg / webpymail

Automatically exported from code.google.com/p/webpymail
GNU General Public License v3.0
0 stars 0 forks source link

Exception on R58 #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Environment:

Request Method: GET
Request URL: http://localhost:8080/auth/login/?next=/
Django Version: 1.2.1
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'webpymail.wpmauth',
 'webpymail.mailapp']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware')

Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in 
get_response
  91.                         request.path_info)
File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py" in 
resolve
  216.                     sub_match = pattern.resolve(new_path)
File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py" in 
resolve
  216.                     sub_match = pattern.resolve(new_path)
File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py" in 
resolve
  123.             return self.callback, args, kwargs
File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py" in 
_get_callback
  132.             raise ViewDoesNotExist("Could not import %s. Error was: %s" % (mod_name, str(e)))

Exception Type: ViewDoesNotExist at /auth/login/
Exception Value: Could not import webpymail.wpmauth.views. Error was: No module 
named config

Fixed this with attached patch.

Original issue reported on code.google.com by akimov.alex on 6 Sep 2010 at 12:10

Attachments:

GoogleCodeExporter commented 9 years ago
Same problem in mailapp/forms.py:39.

And about my diff -- using dots maybe not the best solution, because not all 
python versions (I mean higher 2.4) supports this natively. 
(http://www.python.org/dev/peps/pep-0328/)

Original comment by akimov.alex on 6 Sep 2010 at 12:38

GoogleCodeExporter commented 9 years ago
When we use the built-in django development server this error does not show up 
because the current directory is added to the sys.path when we run the server. 

I think you could simply add the utils module directory to the sys.path, the 
server you're using should provide an easy way to do this. Or, since I would 
like to keep wpmauth project independent maybe it would be better to move this 
app away from the project and to it's own directory on the sys.path just like 
any other python module.

Either way I think this is better handled in the documentation.

I don't like your patch because of the reasons above, if we change the place o 
wpmauth relative to the utils module it will cease to work again.

Let me think a few days about this, if you have another idea it's welcome!

Original comment by hguerreiro@gmail.com on 6 Sep 2010 at 11:49

GoogleCodeExporter commented 9 years ago
Forgot to mention, I had a similar problem because we had a utils.py file in 
the mailapp/views directory. I had to change the name of this file in r58, but 
the respective pyc file should still be there. This might be the source of the 
problem. Just go to the mailapp views directory and delete the utils.pyc and 
try again.

Please note that the organization of the django apps (in webpymail) is not very 
good. I'll try to fix this in the future.

Original comment by hguerreiro@gmail.com on 7 Sep 2010 at 12:41

GoogleCodeExporter commented 9 years ago
Removing the pyc files fixed the problem? 

Original comment by hguerreiro@gmail.com on 8 Sep 2010 at 9:23

GoogleCodeExporter commented 9 years ago
Yes, removing utils.pyc from wpmauth and mailapp helped.
And about utils module: adding project to sys.path is normal, so I don't think 
you have to change something, and move utils somewhere.
And if you're thinking about separating wpmauth app, I don't see any good 
solution. Maybe copy-pasting two functions from utils.conf to wpmauth would be 
acceptable.

Original comment by akimov.alex on 9 Sep 2010 at 12:12

GoogleCodeExporter commented 9 years ago
Good!

Original comment by hguerreiro@gmail.com on 9 Sep 2010 at 4:44