Forums

ImproperlyConfigured: Requested setting REST_FRAMEWORK

I received this error when I try toa cess my api:

Error running WSGI application 2019-12-09 15:47:16,374: django.core.exceptions.ImproperlyConfigured: Requested setting REST_FRAMEWORK, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

my wsgi:

# +++++++++++ DJANGO +++++++++++
# To use your own Django app use code like this:
import os
import sys
from rest_framework import viewsets

# assuming your Django settings file is at '/home/myusername/mysite/mysite/settings.py'
path = '/home/marcotelles123/sentinel/Sentinel.Solution/Server/sentinel.server/sentinel'
if path not in sys.path:
    sys.path.insert(0, path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'sentinel.settings'

## Uncomment the lines below depending on your Django version
###### then, for Django >=1.5:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
###### or, for older Django <=1.4
#import django.core.handlers.wsgi
#application = django.core.handlers.wsgi.WSGIHandler()

[edited by admin: formatting]

where is your settings.py?

My problem is solved removing the line from rest_framework import viewsets

thanks