THANK YOU SO MUCH! I spent the last 12 hours trying to get S3 to host my static files and media. Finally got everything working after watching your video.
Beautiful - I was able to deploy my static files on the AWS S3 service right away. Thank you for taking the time to create this video, it was very helpful!
Thank You!!! AWS a moving target as it evolves thru time.. This is an excellent tutorial covering your first encounter with S3 - as at least currently (13 Apr 2022). Even now though I have some doubts about the 'pulic-read' settings. I found that did not work as ACL was disabled. Setting it to 'none' works. Not sure about the security implications of that though as I would like to set the policy explicitly rather than relying on S2's default. That aside, excellent intro to securing your server via setting app-specific Group/User access. Superb work my friend. Appreciated.
OMG YOUR CHANNEL IS SO AWESOME!! You explain everything so well and so clearfully!!! Thank you so much!!! Hopefully to see more video on your channel!! and could you explain more about setting aws s3 acl?
Thank you, so clear and easy to follow. I also finally understand staticfiles and mediafiles and the whole saving process a lot more now, thank you i appreciate it
after following along with this successfully, what would your advice be for deployment to production? I would like to make a portfolio website i have been working on with Django live, i ask because i have seen you go through various methods on your channel. Thanks in advance
Not much to say really for a portfolio website, just keep it simple and easy to manage/update. It might serve its purpose very quickly and get you where you want it to - not knowing what the portfolio website is going to be used for - sorry I assume it is to help you get a job.
Hi there, thank you for all the videos, you are the go to option for anything related to Django. Do you happen to have a video about encrypting files on AWS (S3) ?
Try to include: 1. How can we handle log files(forint end & back-end) in AWS 2. How can we Handel sessions (after 15mts automatically logout like that)
How do you actually access the media files when using AWS? I've got it all set up like this, static and media both upload to the bucket correctly, and static files can be accessed properly (Like: {% static 'staticfile' %} works correctly), but media files still try and access the local files instead of the S3 bucket.
botocore.exceptions.ClientError: An error occurred (AccessControlListNotSupported) when calling the PutObject operation: The bucket does not allow ACLs i got this error any idea ??
I got permission denied for upload --- Tried deleting the bucket and recreating didnot work Finally I unchecked the option ACLs disabled (recommended) thought it was not recommended It worked!! I neeed to find a another solution
What if I only want to upload media files to s3 not the static files (since I have upload my static files using whitenoise) (When I followed the tutorial, my bootstrap end up not working)
Hi Dipsy, if you don't want to include static change the settings.py file so that static files are not included in s3. Regarding bootstrap - this tutorial is using bootstrap 4 not 5 if that is the problem. Also put the JS is the header of the page - that could solve it.
Hello Very. I am getting this error when i go to inspect source and try to open one of the css files: IllegalLocationConstraintException: The af-south-1 location constraint is incompatible for the region specific endpoint this request was sent to. Please assist
@@veryacademy Thank you Very much, I was able to solve that issue from that article. Your work is really really helpful, yes, even in the Jungles of Zimbabwe lol😂
I have hooked in S3 and serving my media files back into my application so users can click a button to view the document or documents they have uploaded. How can I mask the url so it’s not showing the access key and also how can you tie down the url so it can only be accessed when a user is logged into the system and not just a free url someone can send to anyone? Any help or direction is much appreciated Gareth
Much of the S3 security is done through permissions. Have a look at this to see if it helps stackoverflow.com/questions/54704669/how-to-hide-aws-s3-bucket-url-with-custom-cname
I have build websites with django and react but don't know how much price I want to ask for it pls help can you make a video about dynamic website pricing 🥺🥺🥺
great tutorial. I wanted a file storage application that is set up on my domain and it can view , add , delete files ( can be files / folders / images / audio ) any sources/ materials on how I can do that ???
Hello sir please im getting this error:Partial credentials found in explicit, missing: aws_secrect_access_key. And i have put in the secrect key as required
Sorry for the delay - that I am afraid is difficult to suggest an answer. I is very explicit - missing key so there must be something up with that - maybe a typo somewhere in the code stopping it from reading that line - let me know if you fix it
@@veryacademy Thanks. I was struggling with serving static files locally as well as s3. I solved it by learning about private and public read parts in more dept from you. Thanks for letting me know that I can use whitenoise as well for serving static files. I've seen people using that, but I didn't know why(didn't want to know as well). I think django-heroku module also has some settings to serve static files locally. Thank you so much.
Hi Jitender, sorry - I should have gone into more detail at the time. First and foremost just make sure you don't use your keys in your settings file. Save your environment variables into a .env file in your project folder. help.pythonanywhere.com/pages/environment-variables-for-web-apps/ From that point you just need to ensure that you have the right permissions for your files/folders. I will try and get back to this in the near future and give more information to support deployment.
My static files are being hosted, but not my media files. Very frustrating as I've quadruple-checked my settings and played around with different things. On to the next tutorial...
Strange one. Difficult here to give you an answer - I would first setup with just media files locally - then apply that only - backward engineer if you are not familiar
Let me know when you are ready for the deploy to Heroku. I will follow up this tutorial. For example you really dont want to keep the API keys in the settings file. We can sure things up later though, just have a play with it.
thank you for this wonderful tutorial. successfully deployed static files to s3
Thank you for actually explaining the process of setting up policies rather than just leaving the user with a completely unsecured bucket.
THANK YOU SO MUCH! I spent the last 12 hours trying to get S3 to host my static files and media. Finally got everything working after watching your video.
👍 Nice one
Beautiful - I was able to deploy my static files on the AWS S3 service right away. Thank you for taking the time to create this video, it was very helpful!
""If permission is denied, delete the bucket and create a new one. I promise that's the case. "" -- My man, I bet my life that was the case.
Turn it off and on again - forever the case 👍
This worked for me tbh XD
That is not working anymore!!!
Thank You!!! AWS a moving target as it evolves thru time.. This is an excellent tutorial covering your first encounter with S3 - as at least currently (13 Apr 2022). Even now though I have some doubts about the 'pulic-read' settings. I found that did not work as ACL was disabled. Setting it to 'none' works. Not sure about the security implications of that though as I would like to set the policy explicitly rather than relying on S2's default. That aside, excellent intro to securing your server via setting app-specific Group/User access. Superb work my friend. Appreciated.
OMG YOUR CHANNEL IS SO AWESOME!!
You explain everything so well and so clearfully!!!
Thank you so much!!!
Hopefully to see more video on your channel!!
and could you explain more about setting aws s3 acl?
Thank you so much!
Thank you, so clear and easy to follow. I also finally understand staticfiles and mediafiles and the whole saving process a lot more now, thank you i appreciate it
after following along with this successfully, what would your advice be for deployment to production? I would like to make a portfolio website i have been working on with Django live, i ask because i have seen you go through various methods on your channel. Thanks in advance
Not much to say really for a portfolio website, just keep it simple and easy to manage/update. It might serve its purpose very quickly and get you where you want it to - not knowing what the portfolio website is going to be used for - sorry I assume it is to help you get a job.
Very concise tutorial! Thanks for this tutorial
Glad it was helpful!
Thank you!, very well explained, It helps me a lot.
Glad it helped!
It's very helpful, thank you so much.
Glad it was helpful! I have another S3 with Docker container and Heroku on Monday coming out
Thanks Bro.. you saved my time
Happy to help
It was very much helpful... Thnx a lot Sir 👍🔥
Thanks Shakir 👍
Hi there, thank you for all the videos, you are the go to option for anything related to Django.
Do you happen to have a video about encrypting files on AWS (S3) ?
Thank you, super helpful and and easy to follow!
Glad it was helpful!
Raxmat
Thank you sir usefull video
All the best
Thank you!
Try to include:
1. How can we handle log files(forint end & back-end) in AWS
2. How can we Handel sessions (after 15mts automatically logout like that)
All great suggestions - thank you!
How do you actually access the media files when using AWS? I've got it all set up like this, static and media both upload to the bucket correctly, and static files can be accessed properly (Like: {% static 'staticfile' %} works correctly), but media files still try and access the local files instead of the S3 bucket.
botocore.exceptions.ClientError: An error occurred (AccessControlListNotSupported) when calling the PutObject operation: The bucket does not allow ACLs i got this error any idea ??
Should we leave the MEDIA_ROOT like that?
I got permission denied for upload --- Tried deleting the bucket and recreating didnot work
Finally I unchecked the option ACLs disabled (recommended) thought it was not recommended
It worked!! I neeed to find a another solution
Have a read see if this helps you django-storages.readthedocs.io/en/latest/backends/amazon-S3.html
What if I only want to upload media files to s3 not the static files (since I have upload my static files using whitenoise)
(When I followed the tutorial, my bootstrap end up not working)
Hi Dipsy, if you don't want to include static change the settings.py file so that static files are not included in s3. Regarding bootstrap - this tutorial is using bootstrap 4 not 5 if that is the problem. Also put the JS is the header of the page - that could solve it.
Hello Very. I am getting this error when i go to inspect source and try to open one of the css files:
IllegalLocationConstraintException: The af-south-1 location constraint is incompatible for the region specific endpoint this request was sent to.
Please assist
github.com/boto/boto3/issues/2622
@@veryacademy Thank you Very much, I was able to solve that issue from that article.
Your work is really really helpful, yes, even in the Jungles of Zimbabwe lol😂
I have hooked in S3 and serving my media files back into my application so users can click a button to view the document or documents they have uploaded.
How can I mask the url so it’s not showing the access key and also how can you tie down the url so it can only be accessed when a user is logged into the system and not just a free url someone can send to anyone?
Any help or direction is much appreciated
Gareth
Much of the S3 security is done through permissions. Have a look at this to see if it helps
stackoverflow.com/questions/54704669/how-to-hide-aws-s3-bucket-url-with-custom-cname
@@veryacademy thank you, unfortunately doesn’t mean a lot to me at the moment :-) but will keep researching 🧐, keep up the great work
I want to delete folder when file is saved in S3. remove foloder "media"
def user_directory_path(instance, filename):
return '{0}'.format(filename)
Hello, sorry my friend - when do you want to delete folder?
I have build websites with django and react but don't know how much price I want to ask for it pls help can you make a video about dynamic website pricing 🥺🥺🥺
Been thinking about this today. Maybe. It is tricky, their are lots of variables here.
great tutorial. I wanted a file storage application that is set up on my domain and it can view , add , delete files ( can be files / folders / images / audio ) any sources/ materials on how I can do that ???
You mean you want a CRUD type admin system for S3 files for your app?
@@veryacademy sort of. I want to explore how to create such a system. can you help me with that.
I upload with different approach but i have 2 websites one of them is give error access dennied
Strange one - sorry I cant really assist you - hope you get it sorted 👍
Can we call the images via ajax from S3 bucket??
Yes you can...
Hello sir please im getting this error:Partial credentials found in explicit, missing: aws_secrect_access_key. And i have put in the secrect key as required
Sorry for the delay - that I am afraid is difficult to suggest an answer. I is very explicit - missing key so there must be something up with that - maybe a typo somewhere in the code stopping it from reading that line - let me know if you fix it
If I am not wrong, I think Django doesn't allow to serve static files being served locally in production mode?
whitenoise.evans.io/en/legacy-2.x/django.html WhiteNoise will now serve your static files
@@veryacademy Thanks. I was struggling with serving static files locally as well as s3. I solved it by learning about private and public read parts in more dept from you. Thanks for letting me know that I can use whitenoise as well for serving static files. I've seen people using that, but I didn't know why(didn't want to know as well). I think django-heroku module also has some settings to serve static files locally. Thank you so much.
hey can you make a video with azure.
Sir can you tell me what we have to do when we go on production. What are the changes required ??
Hi Jitender, sorry - I should have gone into more detail at the time. First and foremost just make sure you don't use your keys in your settings file. Save your environment variables into a .env file in your project folder. help.pythonanywhere.com/pages/environment-variables-for-web-apps/
From that point you just need to ensure that you have the right permissions for your files/folders. I will try and get back to this in the near future and give more information to support deployment.
@@veryacademy I am waiting for that notification.
My static files are being hosted, but not my media files. Very frustrating as I've quadruple-checked my settings and played around with different things. On to the next tutorial...
Strange one. Difficult here to give you an answer - I would first setup with just media files locally - then apply that only - backward engineer if you are not familiar
🔥🔥🔥🔥🔥🔥
Thanks - am on a mission today - hopefully 3/4 more to come today! Next Celery today - then Testing tomorrow.
@@veryacademy wow.... great 👍
Sweet
Let me know when you are ready for the deploy to Heroku. I will follow up this tutorial. For example you really dont want to keep the API keys in the settings file. We can sure things up later though, just have a play with it.
@@veryacademy exactly. Thanks sir. But I'm not gonna do this for now, until am done with the project.