You can use pure Python to do it:
import json
list = [1, 2, (3, 4)] # Note that the 3rd element is a tuple (3, 4)
json.dumps(list) # '[1, 2, [3, 4]]'
More Related Contents:
- is not JSON serializable
- django-rest-framework 3.0 create or update in nested serializer
- Check if a dictionary contain data true of false, then send a response back
- How to make a class JSON serializable
- How to get string objects instead of Unicode from JSON?
- NumPy array is not JSON serializable
- Making object JSON serializable with regular encoder
- How to convert JSON data into a Python object?
- How to JSON serialize sets?
- Creating a JSON response using Django and Python
- Serializing class instance to JSON
- Where’s my JSON data in my incoming Django request?
- How to compare two JSON objects with the same elements in a different order equal?
- Django JSONField inside ArrayField
- Loading initial data with Django 1.7 and data migrations
- Convert a python dict to a string and back
- Django REST Framework POST nested objects
- Django Rest Framework writable nested serializers
- Trying to parse `request.body` from POST in Django [duplicate]
- Flask jsonify a list of objects
- Django REST: Uploading and serializing multiple images
- When to use Serializer’s create() and ModelViewset’s perform_create()
- Serialising an Enum member to JSON
- Accessing dictionary by key in Django template
- List of objects to JSON with Python
- TypeError: Object of type ‘bytes’ is not JSON serializable
- Serialize the @property methods in a Python class
- Rendering JSON objects using a Django template after an Ajax call
- is not JSON serializable
- Json Encoder AND Decoder for complex numpy arrays