mousadialo / django-profile

Automatically exported from code.google.com/p/django-profile
BSD 2-Clause "Simplified" License
2 stars 0 forks source link

"No module named magic" for the last rev of Django #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I upgrade django to the last rev of the SVN. And to get this error, trying
to enter /admin/

<pre>
Environment:

Request Method: GET
Request URL: http://tesis/admin/
Django Version: 0.97-pre-SVN-7510
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'tesis.customer',
 'userprofile',
 'account',
 'tesis.employee',
 'tesis.callcenter',
 'tesis.pos',
 'tesis.tax']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware')

Template error:
In template
/var/www/django-projects/tesis/site-packages/tesis/templates/admin/base.html,
error at line 28
   Caught an exception while rendering: Error while importing URLconf
'userprofile.urls': No module named magic
   18 :     {% if not is_popup %}
   19 :     <!-- Header -->
   20 :     <div id="header">
   21 :         <div id="branding">
   22 :         {% block branding %}{% endblock %}
   23 :         </div>
   24 :         {% if user.is_authenticated and user.is_staff %}
   25 :         <div id="user-tools">
   26 :         {% trans 'Welcome,' %} <strong>{% if user.first_name %}{{
user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>.
   27 :         {% block userlinks %}
   28 :         <a href=" {% url django.contrib.admin.views.doc.doc_index
%} ">{% trans 'Documentation' %}</a>
   29 :         / <a href="{% url django.contrib.auth.views.password_change
%}">{% trans 'Change password' %}</a>
   30 :         / <a href="{% url django.contrib.auth.views.logout %}">{%
trans 'Log out' %}</a>
   31 :         {% endblock %}
   32 :         </div>
   33 :         {% endif %}
   34 :         {% block nav-global %}{% endblock %}
   35 :     </div>
   36 :     <!-- END Header -->
   37 :     {% block breadcrumbs %}
   38 :         <div class="breadcrumbs"><a href="/">{% trans 'Home' %}</a>{%
if title %} &rsaquo; {{ title|escape }}{% endif %}</div>

Traceback:
File "/usr/lib/python2.5/site-packages/django/template/debug.py" in render_node
  71.             result = node.render(context)
File "/usr/lib/python2.5/site-packages/django/template/defaulttags.py" in
render
  363.             return reverse(self.view_name, args=args, kwargs=kwargs)
File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in reverse
  297.     return iri_to_uri(u'/' + get_resolver(urlconf).reverse(viewname,
*args, **kwargs))
File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in reverse
  282.         if lookup_view in self.reverse_dict:
File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in
_get_reverse_dict
  218.                     for key, value in pattern.reverse_dict.iteritems():
File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in
_get_reverse_dict
  215.         if not self._reverse_dict and hasattr(self.urlconf_module,
'urlpatterns'):
File "/usr/lib/python2.5/site-packages/django/core/urlresolvers.py" in
_get_urlconf_module
  255.                 raise ImproperlyConfigured, "Error while importing
URLconf %r: %s" % (self.urlconf_name, e)

Exception Type: ImproperlyConfigured at /admin/
Exception Value: Error while importing URLconf 'userprofile.urls': No
module named magic
</pre>

I See that maybe the new admin app try to reverse the urls using url
function when the urls has names. See here:
http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns

I fix the problem modifing urls.py of the userprofile app, for example from:
  (r'^save/$', save),
to:
  url(r'^save/$', save),

After that, everything works fine. I see that must of the apps has already
using url() instead the tuples.

Original issue reported on code.google.com by marioces...@gmail.com on 4 May 2008 at 6:31

GoogleCodeExporter commented 8 years ago
Don't liten to me ... jejeje just get sure you have the python-magic library
installed. That was the problem

Original comment by marioces...@gmail.com on 4 May 2008 at 7:10

GoogleCodeExporter commented 8 years ago

Original comment by david.ru...@gmail.com on 14 Jun 2008 at 11:22