How to modify uploaded image via plugin

16 views
Skip to first unread message

J Daniels

unread,
Jun 14, 2020, 6:54:51 PM6/14/20
to django CMS users
I'm new to django, and I'm having difficulty understanding the process when a user uploads an image through a plugin. I want to be able to modify that image before it is saved to the db, but I'm unsure how to do that. The documentation suggests using file handlers, but they appear to be used in the views.py file displaying the upload page and I'm unsure how to either access that py file or how to extend it. Does any one have any suggestions?

Garth Johnson

unread,
Jun 19, 2020, 1:58:03 PM6/19/20
to djang...@googlegroups.com
Do you mean like adding a permanent watermark to an image as it is uploaded?  A quick Google for "Django add watermark to uploaded images" netted several great projects (Django-watermark among others), articles (several from stack overflow), and plenty of other rabbits to chase.  Depending on the specifics of your needs, these can easily be used as examples of methods or even a drop-in solution in some cases.

On Sun, Jun 14, 2020 at 3:54 PM J Daniels <phoenixd...@gmail.com> wrote:
I'm new to django, and I'm having difficulty understanding the process when a user uploads an image through a plugin. I want to be able to modify that image before it is saved to the db, but I'm unsure how to do that. The documentation suggests using file handlers, but they appear to be used in the views.py file displaying the upload page and I'm unsure how to either access that py file or how to extend it. Does any one have any suggestions?

--
You received this message because you are subscribed to the Google Groups "django CMS users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-cms+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/django-cms/9b364e3b-8c01-42be-bc63-cc92427dd991o%40googlegroups.com.


--
______________________________
Garth Johnson
(360) 320-6626 (M-F 9-4 PST)
Reply all
Reply to author
Forward
0 new messages