Tutorial part 7 broken (schema_title)

115 views
Skip to first unread message

john_doe

unread,
Jul 15, 2016, 1:16:06 AM7/15/16
to Django REST framework
Just so you know, when running part 7 of the tutorial, it doesn't work. 

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/core/management/__init__.py", line 327, in execute
    django.setup()
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate
    app_config.ready()
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/debug_toolbar/apps.py", line 15, in ready
    dt_settings.patch_all()
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/debug_toolbar/settings.py", line 228, in patch_all
    patch_root_urlconf()
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/debug_toolbar/settings.py", line 216, in patch_root_urlconf
    reverse('djdt:render_panel')
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/core/urlresolvers.py", line 568, in reverse
    app_list = resolver.app_dict[ns]
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/core/urlresolvers.py", line 360, in app_dict
    self._populate()
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/core/urlresolvers.py", line 293, in _populate
    for pattern in reversed(self.url_patterns):
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/core/urlresolvers.py", line 417, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/me/.virtualenvs/rest_tutorial/lib/python2.7/site-packages/django/core/urlresolvers.py", line 410, in urlconf_module
    return import_module(self.urlconf_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/me/Code/new-django/rest_tutorial/urls.py", line 10, in <module>
    router = DefaultRouter(schema_title="My REST API")
TypeError: __init__() got an unexpected keyword argument 'schema_title'

If I remove the argument/value from the following line:

router = DefaultRouter(schema_title='Pastebin API')

to get this:

router = DefaultRouter()

then it works as in Part 6, but there is no additional coreapi functionality. Just a heads up!

Anoop Malav

unread,
Jul 15, 2016, 6:05:35 AM7/15/16
to Django REST framework
Hi John,

Please make sure you are running recent version of Django Rest Framework, which has been released recently.


Can you please provide Django and DRF versions you are using?

john_doe

unread,
Jul 15, 2016, 2:03:30 PM7/15/16
to Django REST framework
Sure, absolutely:

In [1]: import rest_framework
In [2]: rest_framework.__version__
Out[2]: '3.3.3'
In [3]: import django
In [4]: django.__version__
Out[4]: '1.9.7'

Using coreapi seems to pre-date 3.4.x series, so 3.3.3 should be fine, yes?
Message has been deleted

Mateusz Urbańczyk

unread,
Jul 16, 2016, 1:24:13 PM7/16/16
to Django REST framework
I receive same error as i try to add `schema_title` to router

Kevin Brown

unread,
Jul 16, 2016, 6:09:15 PM7/16/16
to Django REST framework
The schema feature was added in 3.4.0, so you must have (at least) that version installed in order to use it.

--
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/d/optout.

John Calcote

unread,
Nov 14, 2016, 5:32:17 PM11/14/16
to Django REST framework
Don't know why no one ever completed this thread, but the solution to the problem is that the parameter is called "title" and not "schema_title".

John
Reply all
Reply to author
Forward
0 new messages