2

So I am learning Django. And I have made some websites with it. Now I am hosting those to Heroku. I am using free Dyno on Heroku. Also, I am using supabase.io database instead of Heroku's because supabase gives more space for the database on the free tier. Now the problem I am facing is with the media files. I can not access them on Heroku since I don't have any place to store them.

I have seen some addons on Heroku for the file storage but to use those I need to provide my credit card information, which I do not have.

But I have seen an object storage option on supabase.io. It gives 1 GB free storage which is more than enough for me now. But I don't know how can I use it with my Django application. That is why I am looking for help. Also if there are any free alternatives to store my media file without credit card information, please feel free to guide me. Since I do not own any card.

2 Answers 2

3

There is a community-supported Python library for Supabase that has support for Supabase Storage, which you can try:

https://github.com/supabase-community/supabase-py

see the storage code here:

https://github.com/supabase-community/supabase-py/tree/develop/supabase/lib/storage

Sign up to request clarification or add additional context in comments.

3 Comments

I read the doc and after connected, I can't upload anything in the Supabase storage bucket. url= "XXXXX" key = "XXXXXXXXX supabase: Client = create_client(url, key) my_file = os.path.dirname(os.path.abspath("__file__")) + "/file.jpg" storage.upload(path=supabase.storage_url, file=my_file) I doesn't work and don't print any error.
Sorry, I'm not a user of the Python library, but you can post your issue here in the Github repository: github.com/supabase-community/supabase-py/issues, or join our Discord to interact with other Supabase Python developers: discord.supabase.io
Hey! Thanks for the question! I'm one of the maintainers of the Supabase Python client library. I'm currently working on an integration with django-storages: github.com/jschneier/django-storages/issues/1099 . I'll publish a blog post once done but please you should be able to use the client lib that Mark has mentioned for now.
2

I know this might be an old question, but for future reference, you could probably try out django-cloudinary-storage. You can take a look at this answer here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.