5👍
✅
Actually your settings.py
is missing the xml parser config.
- install rest_framework_xml :
pip install djangorestframework-xml
- Update INSTALLED_APPS in settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_framework_xml',
'books',
'users',
]
- Add xml parser in settings.py:
REST_FRAMEWORK = {
'DEFAULT_PARSER_CLASSES': (
'rest_framework_xml.parsers.XMLParser',
),
'DEFAULT_RENDERER_CLASSES': (
'rest_framework_xml.renderers.XMLRenderer',
),
}
👤Dhia
0👍
It is adviceable that you use virtual environment. Check how to use pipenv here
- [Django]-NameError: name '_mysql' is not defined — On airflow start in MacOSX
- [Django]-Access to module denied from within GAE dev server
- [Django]-Simple Django Project Structure
- [Django]-Attribute Error: 'dict' object has no attribute 'endswith'
- [Django]-How to use django-taggit similar_objects() with Class-based views
Source:stackexchange.com