#django #django-rest-framework #pyinstaller
Вопрос:
Я пытаюсь создать исполняемый файл из приложения django rest framework с помощью pyinstaller. Но когда я запускаю pyinstaller, я получаю эти ошибки:
Traceback (most recent call last):
File "<string>", line 21, in walk_packages
File "c:userssebacenvsmyapplibsite-packagesrest_frameworkschemas__init__.py", line 25, in <module>
from . import coreapi, openapi
File "c:userssebacenvsmyapplibsite-packagesrest_frameworkschemasopenapi.py", line 15, in <module>
from rest_framework import (
File "c:userssebacenvsmyapplibsite-packagesrest_frameworkrenderers.py", line 53, in <module>
class JSONRenderer(BaseRenderer):
File "c:userssebacenvsmyapplibsite-packagesrest_frameworkrenderers.py", line 60, in JSONRenderer
ensure_ascii = not api_settings.UNICODE_JSON
File "c:userssebacenvsmyapplibsite-packagesrest_frameworksettings.py", line 218, in __getattr__
val = self.user_settings[attr]
File "c:userssebacenvsmyapplibsite-packagesrest_frameworksettings.py", line 209, in user_settings
self._user_settings = getattr(settings, 'REST_FRAMEWORK', {})
File "c:userssebacenvsmyapplibsite-packagesdjangoconf__init__.py", line 79, in __getattr__
self._setup(name)
File "c:userssebacenvsmyapplibsite-packagesdjangoconf__init__.py", line 60, in _setup
raise ImproperlyConfigured(
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.
collect_submodules: failed to import 'rest_framework.schemas'!