You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that the code in the version of the package installed via pip differs from the code in the GitHub repository. Specifically, the errors I encountered with the pip-installed package are not present in the GitHub version.
For example:
In apps.py, the name of the app in the pip-installed version is "yaml_converter", but in the GitHub version, it is "swagger_ui".
# apps.py on pipfromdjango.appsimportAppConfigclassYamlConverterConfig(AppConfig):
name='yaml_converter'
In views.py, line 10, the pip-installed version uses spec = yaml.load(file.read()), while the GitHub version uses spec = yaml.safe_load(file.read()).
# views.py on GitHubimportjsonimportyamlfromdjango.core.exceptionsimportImproperlyConfiguredfromdjango.shortcutsimportrenderfromdjango.confimportsettingsdefyaml_to_html(request):
ifhasattr(settings, 'SWAGGER_YAML_FILE'):
file=open(settings.SWAGGER_YAML_FILE)
spec=yaml.safe_load(file.read())
returnrender(request, template_name="swagger_base.html", context={'data': json.dumps(spec)})
else:
raiseImproperlyConfigured('You should define SWAGGER_YAML_FILE in your settings')
# views.py on pipimportjsonimportyamlfromdjango.core.exceptionsimportImproperlyConfiguredfromdjango.shortcutsimportrenderfromdjango.confimportsettingsdefyaml_to_html(request):
ifhasattr(settings, 'SWAGGER_YAML_FILE'):
file=open(settings.SWAGGER_YAML_FILE)
spec=yaml.load(file.read())
returnrender(request, template_name="swagger_base.html", context={'data': json.dumps(spec)})
else:
raiseImproperlyConfigured('You should define SWAGGER_YAML_FILE in your settings')
The text was updated successfully, but these errors were encountered:
I've noticed that the code in the version of the package installed via pip differs from the code in the GitHub repository. Specifically, the errors I encountered with the pip-installed package are not present in the GitHub version.
For example:
In
apps.py
, the name of the app in the pip-installed version is"yaml_converter"
, but in the GitHub version, it is"swagger_ui"
.In
views.py
, line 10, the pip-installed version usesspec = yaml.load(file.read())
, while the GitHub version usesspec = yaml.safe_load(file.read())
.The text was updated successfully, but these errors were encountered: