Import generics error when migrating to 2.3 release

54 views
Skip to first unread message

Nestor Manrique

unread,
May 10, 2013, 4:45:41 PM5/10/13
to django-res...@googlegroups.com
Hi! I just saw the new release of the framework and went down to refactoring my code.

I changed my generic views erasing the old "model" property and adding the new "queryset". When I tried to run my app I had this error comming up and I'm pretty lost with it. Here is the complete traceback

Traceback:
File "/home/vagrant/.virtualenvs/gusarapo/src/django/django/core/handlers/base.py" in get_response
  104.                     resolver_match = resolver.resolve(request.path_info)
File "/home/vagrant/.virtualenvs/gusarapo/src/django/django/core/urlresolvers.py" in resolve
  319.             for pattern in self.url_patterns:
File "/home/vagrant/.virtualenvs/gusarapo/src/django/django/core/urlresolvers.py" in url_patterns
  347.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/vagrant/.virtualenvs/gusarapo/src/django/django/core/urlresolvers.py" in urlconf_module
  342.             self._urlconf_module = import_module(self.urlconf_name)
File "/home/vagrant/.virtualenvs/gusarapo/src/django/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/vagrant/gusarapo/urls.py" in <module>
  5. from music.urls import urlpatterns as music_urls
File "/vagrant/music/urls.py" in <module>
  2. from music import views
File "/vagrant/music/views.py" in <module>
  14. from rest_framework import generics
File "/home/vagrant/.virtualenvs/gusarapo/lib/python2.6/site-packages/rest_framework/generics.py" in <module>
  17. class GenericAPIView(views.APIView):
File "/home/vagrant/.virtualenvs/gusarapo/lib/python2.6/site-packages/rest_framework/generics.py" in GenericAPIView
  39.     pagination_serializer_class = api_settings.DEFAULT_PAGINATION_SERIALIZER_CLASS
File "/home/vagrant/.virtualenvs/gusarapo/lib/python2.6/site-packages/rest_framework/settings.py" in __getattr__
  179.             val = perform_import(val, attr)
File "/home/vagrant/.virtualenvs/gusarapo/lib/python2.6/site-packages/rest_framework/settings.py" in perform_import
  129.         return import_from_string(val, setting_name)
File "/home/vagrant/.virtualenvs/gusarapo/lib/python2.6/site-packages/rest_framework/settings.py" in import_from_string
  147.         raise ImportError(msg)

Exception Type: ImportError at /users
Exception Value: Could not import 'rest_framework.pagination.PaginationSerializer' for API setting 'DEFAULT_PAGINATION_SERIALIZER_CLASS'. ImportError: cannot import name smart_urlquote.

It's weird because it fails when I'm just importing the generics module. I didn't touch anything else besides those attributes.

Cheers,

Nestor

Tom Christie

unread,
May 10, 2013, 6:12:19 PM5/10/13
to django-res...@googlegroups.com
Hi Nestor,

  Could you open a ticket for this, including the Django version you're using?

Thanks!


--
You received this message because you are subscribed to the Google Groups "django-rest-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nestor Manrique

unread,
May 10, 2013, 6:30:05 PM5/10/13
to django-res...@googlegroups.com
Hi! I'm sorry but when you say a ticket you mean an issue in github? I'm kind of new with this xD

Cheers,

Nestor

Nestor Manrique

unread,
May 10, 2013, 6:39:04 PM5/10/13
to django-res...@googlegroups.com
I just added the issue in github anyways. Thanks for the fast answer.

Nestor

P.D. googlegroups y u no let me edit my posts!!?
Reply all
Reply to author
Forward
0 new messages