wq/django-data-wizard

getting 401 Unauthorized when trying to run wizard

Closed this issue · 5 comments

i've followed the instructions in the readme and but i'm getting a 401 when trying to import from an uploaded csv file

datawizard/9/serializers/
returns a 401

what am i missing?

Not sure if this is the issue, but is the account you are accessing the API with an administrator?

I have the same problem and when trying either from admin page or the direct link datawizard/
I managed to make it work with this... but I don't think it is how it should be

DATA_WIZARD = {
    'BACKEND': 'data_wizard.backends.threading',
    'LOADER': 'data_wizard.loaders.FileLoader',
    'PERMISSION': 'rest_framework.permissions.AllowAny',
}

Are you using Django REST Framework for another purpose in the same project? The wizard assumes that 'rest_framework.authentication.SessionAuthentication' is one of the DEFAULT_AUTHENTICATION_CLASSES. (Perhaps the wizard should have its own authentication defaults.)

Hi,
Thank you so much for your fast reply:
In fact, I was using for something else:

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
    ),
}

I confirm it works with this:

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.SessionAuthentication',
    ),
}

Now, related to your comment, how would I do to make this valid only for the wizard?

For the next release, I added a new DATA_WIZARD["AUTHENTICATION"] setting that defaults to SessionAuthentication. Feel free to try it out on the master branch. You could also create a subclass of data_wizard.views.RunViewSet and override the authentication_classes directly. You would need to point your urlconf to that view instead of data_wizard.urls.