A.Dumas
A.Dumas

Reputation: 3267

Django's REST framwork Quickstart Error

I followed all the steps from the tutorial here. But when I try to run the server I get the following error further down. Since I am new to django i am unsure where to start to debug.

The full console output can be found Here

Unhandled exception in thread started by <function wrapper at 0x7f4e9dc9c7d0>
Traceback (most recent call last):
  File "/home/user/Projects/djangoApi/tutorial/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 228, in wrapper
    fn(*args, **kwargs)
 .....
ValueError: Empty module name

My database settings in settings.py is

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
} 
REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.IsAdminUser',
    ],
    'DEFAULT_PAGINATION_CLASS': 'None',
    'PAGE_SIZE': 10
}

Upvotes: 0

Views: 48

Answers (1)

Raja Simon
Raja Simon

Reputation: 10305

The doc says DEFAULT_PAGINATION_CLASS and PAGE_SIZE are None by default. So you don't have to specify that unless you want. Just remove the DEFAULT_PAGINATION_CLASS from the REST_FRAMEWORK and all good to go.

Upvotes: 2

Related Questions