jazzband / django-tinymce

TinyMCE integration for Django
http://django-tinymce.readthedocs.org/
MIT License
1.25k stars 317 forks source link

Problems with tinymce and image display after upload #459

Closed paulocoutinhox closed 3 months ago

paulocoutinhox commented 3 months ago

Hi,

I have problems with tinymce and image display after upload.

The upload is OK, but the URL after re-enter on customer form that has tinymce show image with wrong URL, it add "/admin" on it.

See:

image

My open source project: https://github.com/paulocoutinhox/pyaa

Settings: https://github.com/paulocoutinhox/pyaa/blob/main/main/settings.py#L183-L184

Can anyone help me?

paulocoutinhox commented 3 months ago

I discovery that the flow to reproduce:

https://github.com/jazzband/django-tinymce/assets/395096/b2d61ae7-fe61-4894-b6c9-1b64d84d63f7

paulocoutinhox commented 3 months ago

Before submit form the image src has path = /media/uploads/2024/3/8/bccff63b-15e2-4a9a-b719-3fd09457ff16.png:

image

After submit form the image src has path = ../../../../media/uploads/2024/3/8/bccff63b-15e2-4a9a-b719-3fd09457ff16.png:

image
paulocoutinhox commented 3 months ago

i solved the problem using this config in settings.py:

TINYMCE_DEFAULT_CONFIG = {
    [...]
    "relative_urls": False,
}