robert-godlewski / ghost_pants_website

https://0fd6eadc-3d96-4eab-91ea-961d9c91cff9.e1-us-cdp-2.choreoapps.dev/login
1 stars 0 forks source link

Add in text editor #41

Open robert-godlewski opened 5 hours ago

robert-godlewski commented 5 hours ago

Will need to add this for posts.content and comments.content text area tags.

robert-godlewski commented 5 hours ago

For the frontend in React it might be best to use something like TinyMCE as a WYSIWYG in JavaScript to integrate the data

For the backend might need to apply the following and make sure to apply the appropriate validators for the data coming in. The example below renders the text_field as a textarea browsable API through HTML forms:

serializers.py from rest_framework import serializers from django.forms import Textarea

class MySerializer(serializers.Serializer): ... text_field = serializers.CharField(widget=Textarea)