Upload Images to Django starcross gallery from External Script

first time question.

I have been playing with Django and needed a photo gallery, and made a basic one, then found starcross gallery (https://github.com/Starcross/django-starcross-gallery). It works really nice and easy to put into my app, but from what I can tell its made for dragging and dropping images in, or by adding them from the django-admin page.

I need to be able to add photos from an external script. I haven't dealt with ImageField before. I was able to import the gallery.models in my api views file, and make it so I can POST and add those ok. But I have been pulling my hair out trying to get actual images to upload.

From looking around, I found I think how to do it with curl (I make my requests with curl then port it to python), and it gave me CSRF issues with a 403 Forbidden.

How can I upload an image and bind it to an album, externally with curl or Python?

Thanks

Back to Top