6π
I think you make be looking for a rich text editor if I understand your question correctly.
There are two rich text editors that are (seemingly) the most popular tinymce and ckeditor.
Hereβs a link to a few answers that may be of use to you for the admin part:
django-ckeditor-to-django-admin and django-admin-tinymce-integration
Both of which can turn your text area into rich text editors with the ability to insert code, images, even math etcetera.
You stated in your question:
I want my users to be able to upload images or adding code sample inside the text area.
Which seems to fit the above options (or another editor).
1π
A lightweight option would be to use Markdown instead of a raw text field.
This project : https://github.com/jamesturk/django-markupfield provides a field that you can choose to parse with Markdown or other parsers. This way, you can add code samples (with ```
, like in StackOverflow).
Note : the code blocks arenβt colored.
You can also include images with ![my alt text](http://example.com/image.png)
, though you have to upload them somewhere on the internet.
For uploading images directly through the Django admin page, you may use an ImageField
- [Django]-How to get access to context from Jinja2 extension
- [Django]-Django Tests: User.authenticate fails
- [Django]-Reading RSS feed and displaying it in Django Template | feedparser
- [Django]-JQuery Ajax function called twice with same data
- [Django]-In stripe checkout page display Country or region fields how to remove it