I'm trying to configure the API using Django Rest, I tried using a quick start guide, but all I can get is the error:
'Module_six_moves_urllib_parse' object has no attribute 'urlsplit'
I cannot find a link to this error on the Internet, not to mention how to solve it.
Here is my urls file:
from django.conf.urls import patterns, include, url from django.contrib.auth.models import User from django.contrib import admin from rest_framework import routers, serializers, viewsets admin.autodiscover() class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ('url', 'username', 'email', 'is_staff') class UserViewSet(viewsets.ModelViewSet): queryset = User.objects.all() serializer_class = UserSerializer router = routers.DefaultRouter() router.register(r'users', UserViewSet) urlpatterns = patterns('', url(r'^', include(router.urls)), url(r'^', include('logs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), )
Full trace:
Environment:
Request Method: GET
Django Version: 1.6 Python Version: 2.7.6 Installed applications: ("rest_framework", "south", "django.contrib.admin", 'django.contrib.admindocs',' django.contrib.auth ',' django.contrib .contenttypes ',' django.contrib.sessions ',' django.contrib.messages ',' django.contrib.staticfiles ',' logs ',' django_nose ') Installed middleware: (' Django.contrib.sessions.middleware. SessionMiddleware ',' Django.middleware.common.CommonMiddleware ',' Django.middleware.csrf.CsrfViewMiddleware ',' Django.contrib.auth.middleware.AuthenticationMiddleware ',' Django.contrib.messages.middlewareMessdle. middleware.clickjacking.XFrameOptionsMiddleware ')
Template error: in the template /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/rest_framework/templates/rest_framework/base.html, the error in line 87 is 'Module_six_moves_urllib_parse' the object does not have the attribute 'url 77' urplpl :
rel = "nofollow" title = "Make a GET request to the {{name}} resource"> GET
78:
79:
80: title = "Specify the format for the GET request">
81:
82:
83:
84: {% for format in AvailableFormats%}
85:
86:
87: href = '{% add_query_param request api_settings.URL_FORMAT_OVERRIDE format%}'
88:
rel = "nofollow"
89: title = "Make a GET on the resource {{name}} with the format set to {{ format }} ">
90: {{format}}
91:
92:
93: {% endfor%}
94:
95:
96:
97:
Traceback: File "/Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 139. response = response.render () File "/ Users / taylorhobbs / .virtualenvs / Workout_log / lib / python2.7 / site-packages / django / template / response.py "in visualization 105. self.content = self.rendered_content File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/ python2.7 / site-packages / rest_framework / response.py "in rendered_content 59. ret = renderer.render (self.data, media_type, context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/ site-packages / rest_framework / renderers.py "in visualization 733. ret = template.render (context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/django/template/base. py "in visualization 140. return self._render (context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/dja ngo / template / base.py "in _render 134. return self.nodelist.render (context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/django/template/base.py "in visualization 840. bit = self.render_node (node, context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/django/template/debug.py "in render_node 78. return node.render (context) File "/Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/django/template/loader_tags.py" in visualization 123. return compiled_parent._render (context) File "/ Users / taylorhobbs / .virtualenvs / Workout_log / lib / python2.7 / site-packages / django / template / base.py "in _render 134. return self.nodelist.render (context) File" /Users/taylorhobbs/.virtualenvs/ Workout_log / lib / python2.7 / site-packages / django / template / base.py "in visualization 840. bit = self.render_node (node, conte cst) File "/Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/django/template/debug.py" in render_node 78. return node.render (context) File "/ Users / taylorhobbs / .virtualenvs / Workout_log / lib / python2.7 / site-packages / django / template / loader_tags.py "in visualization 62. result = block.nodelist.render (context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib /python2.7/site-packages/django/template/base.py "in visualization 840. bit = self.render_node (node, context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site -packages / django / template / debug.py "in render_node 78. return node.render (context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/django/template/defaulttags. py "in visualization 305. return nodelist.render (context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-package s / django / template / base.py "in visualization 840. bit = self.render_node (node, context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/django/template/ debug.py "in render_node 78. return node.render (context) File" /Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/django/template/defaulttags.py "in visualization 196. nodelist .append (node.render (context)) File "/Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/django/template/base.py" in visualization 1125. return func (* resolved_args, ** resolved_kwargs) File "/Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/rest_framework/templatetags/rest_framework.py" in add_query_param 86. return escape (replace_query_param (uri, key) val File "/Users/taylorhobbs/.virtualenvs/Workout_log/lib/python2.7/site-packages/rest_framework/templatetags/rest_framework.p y "in replace_query_param 22. (scheme, netloc, path, query, fragment) = urlparse.urlsplit (url)
Exception Type: AttributeError at / Exception Value: Object 'Module_six_moves_urllib_parse' does not have the attribute 'urlsplit'