For those who can't write the CORS configuration in xml: [ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "POST", "GET", "PUT" ], "AllowedOrigins": [ "*" ] } ]
@@elmanotas4041 Exactly. As the above reply mentioned, you need tweak the security settings. Lookup something to change the permissions "available to everyone" or something like that
For everyone getting problems logging in, all of your previous customers, tags, products, are all deleted. They all got deleted in the previous video. What you need to do is to create a super user. if your are NOT able to create a superuser: Go to signals.py, and change "group = Group.objects.get(name='customer')" to "group, created = Group.objects.get_or_create(name='customer')". Once you create superuser with "python manage.py createsuperuser", log in to the admin panel (/admin). Go to the group section, create two groups with one being called (capitalisation does matter for both), "customer" and "admin". I would give all permissions to the admin group just because. Lastly, go to part 6 in the tutorial at 10:09-11:36 and 12:16-end of video. I spent four days trying to figure this out but after nothing else working, so I hope my frustration doesn't go to y'all.
I can't thank you enough. I recently learned django and just know basics, this is my first tutorial project. I'm following this course from the beginning. And today suddenly nothing works all I get is errors. No id can be logged in. I tried to create new super user but couldn't. Checked settings, decorators, views for an hour to see if I done any mistakes but nothing. Then I see this comment. thanks a ton. This helped me a lot.
Awesome tutorials. Instead of copying over the files from local 'static' folder, it's better to run 'python manage.py collectstatic' after configuring AWS settings. This command auto uploads all the local static files including 'admin' files.
I'm getting a 'net::ERR_ABORTED 400 (Bad Request) 'in console for every file in the s3 bucket and the static files are not loading in my project. can you help me out with this.
Those who are not able to load static files: add these following lines in settings.py AWS_S3_ENDPOINT_URL: 'sts.ap-south-1.amazonaws.com' AWS_S3_REGION_NAME = 'ap-south-1' change region code according to your account settings.
Okay dude I have been putting off the aws stuff in my current project for like 3 months because I wasn't sure why I couldn't get it to work the first time. I was missing the boto3 package and trying to do it without. 🙃 Now I know, thanks man.
If the Image is not loading/you get error when going to image link "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.", what you need to do is put " AWS_S3_REGION_NAME = 'us-east-2' " in settings.py. I live at the US east coast so this will work for me. If you live in another region, find the code that corresponds with you. Hope this helps.
If anyone is having issues with images not loading in after configuring settings... I kept getting this error when I followed Image URL "SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method. " I fixed it by adding AWS_S3_ADDRESSING_STYLE = "virtual" into my settings.py. Apparently this is a problem if you're using us-east-2 server. I hope this helps anyone out there I was stuck with this bug for 3 hrs. P.S If you're already deployed to heroku, make sure you update requirements.txt when new packages.
It seems the photo cannot render as expected. So I need to add something more based on Django-storages guidelines. First, AWS_S3_SIGNATURE_VERSION ='s3v4' Second: AWS_S3_REGION_NAME = "us-east-2" One more thing to point out, safari didn't render images successfully, while chrome work completely fine.... This took me a day to find out
this works for me ProfilePicture = models.ImageField(upload_to='ProfileImages/') Django will Automatically create the folder, You can name it any name you want. Just make sure you've configured you media url in your settings.py . Happy Coding 😉 ALL THE TIME WITH AWS
Hi Dennis, I can't fetch the logo from S3 Bucket The error message is This XML file does not appear to have any style information associated with it. The document tree is shown below. SignatureDoesNotMatch The request signature we calculated does not match the signature you provided. Check your key and signing method. I have set in settings.py AWS_S3_HOST = 'us-east-2.amazonaws.com' AWS_S3_REGION_NAME = 'us-east-2'
Hi Dennis, I've got a problem when using aws database (followed all the steps in the tutorial). After connecting and running the server, I'm UNABLE TO LOGIN WITH ANY REGISTERED USER & ITS CORRECT PASSWORD. However, when I switch to the default 'sqlite' database it works perfectly! Same happens with the /admin login too. Also, when I tried to create a new user, I get an error "DoesNotExist at /register/.....Group matching query does not exist.". Please suggest the solution.
what would be the reason that I can't see status part colors and logo on navbar? I have managed to see uploaded profile photos on account settings but not logo picture.
right click the page, inspect, click on console and see the error message in red. google the message and most likely there will be a stackoverflow article with the solution.
in between last video and this video , did you create your admin user and different user accounts ? I am getting and error while creating admin account as "django.contrib.auth.models.DoesNotExist: User matching query does not exist" please help how to create super user to proceed. Excited to learn more. Pls help
How to separate Media Files and Static Files in one bucket ? For example, In local I have "media" folder for file uploads, and "staticfiles" for collected static files. How can I define those folders in bucket? In the video you shown only putting DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' #for media STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' #for static Please advise..Thanks
Hello , I'm still a beginner at this, when i try creating custom storage, i cannot import s3boto3storages from storages.backends.s3boto3 , can you help me
I managed to upload the files, and in that moment the static files are loaded , but I loose any configuration to the admin pages, those look really basic. Anyone had this and know what happened or how to fix it ?
yes it happens when you don't configure correctly your remote s3 source and you just delete your local statics, In that case admin doesn't have the knowledge of the styling. Also remember to put in your S3 bucket the admin folder under static. (local: static/admin, in your s3 bucket: admin).
Also if you want your admin o other static info serve in your server instead of S3, just remove STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' from your settings and run python manage.py collectstatic
Hi wondering if anyone has seen a solution to this issue. Ever since I migrated from localhost to postgres/AWS, I am not able to login or register even as Admin. Seems all migrated tables to pgAdmin did not include any data. So the tables are empty and wont let me login. Can you help in any way?
So finally I was able to get all data migrated to postgres/AWS databases. This is how I did it after several hours unfortunately; -- First I followed this guide: www.vphventures.com/how-to-migrate-your-django-project-from-sqlite-to-postgresql/ -- But before I started I stripped the sqlite3 db of all data leaving only the superuser from "127.0.0.1:8000/admin" (Everything including customer, orders, customer group etc.) ---then I ran a TRUNCATE django_content_type CASCADE; from python manage.py dbshell on the sqlite3 db and postgres db. --Finally python manage.py loaddata db.json -- and boom it worked!! Took a little too long but paid off in the end. Gained a lot from the research. Thanks Dennis
@@elprinz6604 Hello, I have been stuck on this for a long time as well! Since I'm a beginner I didn't understand fully your solution, would you be able to give more details of how you were able to do it? Thanks!
Hello Dennis - thanks for sharing nice tuts. I am pretty new to Django. Can you pls advise me how do I configure boto3 so that I can able to upload (few) files like some CSV Data to s3 (for further processing) and others (like images etc) in local storage. So basically S3 will be for remote processing of CSV data through Lambda.
how to download media files which we are storing gin s3 bucket in django ? Now i am only able to open in browser only. I want to download the file directly from the link.
if anyone faces Access Denied Error even after trying all the things mentioned in the video and comments just add the bucket policy which will also help to render images and CSS styling. Use the following policy and just change the Resouce by pasting your bucket arn in it { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": "*", "Action": "s3:*", "Resource": "/*" } ] }
Sir, after attaching to AWS i can't able to access by old user names which we created in local server , even the admin , It says username or password incorrect But if i create new user, that able to access (login) correctly So sir please help me with how to fix this data loss issue.
I have a css background image set for body tag and it is not loading on the page through s3. The error i get is 403 forbidden. But the images in img tag like the logo are loading fine.
i try many ways for solve this in the end you can add this in your settings.py and will be fine ``` AWS_QUERYSTRING_AUTH=False ``` from s3 you have to make public directory , Gluck
When admin gets login and enter dasboard,there is feature of "create customer" and when admin view the customer,there is another feature "update customer" ..you haven't work in both yet.hope you will cover this too soon
I am also interested in the code for the "create customer" and "update customer". Earlier on, you also indicated that you'll show how to select multiple items with checkboxes from a dropdown. I have tried doing this using django-multiselectfield but no luck getting check box included. Please assist or point me in the right direction on these 3 items. Completed your tut, great stuff!
Those who are facing image is not showing issue Just upload (AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME) in setting.py Then, go to your AWS S3 make the folder which contains image, make that folder to public That's it your good to go
Great job bro. thank you so much for this, the static files for my application seems to be loading just fine, but by admin static file isn't loading, please help.
@@hugobritto9873 I got an error while creating a superuser after connecting AWS to my project, the error says: django.contrib.auth.models.DoesNotExist: Group matching query does not exist.
Hello Dennis, Thank you very much for sharing your knowledge and helping us, I am following your Django course (on 14th video currently) and learning much, enjoying much and evolving much from your course. What you are doing and how you are doing is really wonderful. very_grateful = True
the static files and images are not loaded when using s3 aws, I have tried all the suggestions in the comments but all of them did not work for me. I have tried to set the region and still nothing is loading. However when I inspect the elements in the page I can see the url like this "bucket-name.s3.amazonaws.com/image01.png" or "bucket-name.s3.amazonaws.com/project-name/css/bootstrap.min.css". However css not displayed all what I can see HTML and failed to load images. Can anybody help me with this?
@@sergimartinez7060 yes it the bucket policy need to be set you will find Denis written a code in one pf his videos that solves that issue. I think it was the portfolio website time lapse check it in the videos section
@@mohamedsameh3126 hello, this is the same issue i've been trying to solve for the past one week, can you kindly put me through how you were able to debug the issue?
Uhm... I would like to ask if you have alternative Storage Server aside from Amazon S3, based on their website, their free tier will only last for 12 months, then they will charge on your registered Credit card.
Thank you Dennis~ great course. I have a problem, after I set up the S3 Bucket when I collect static files, they are all uploaded to bucket with no problem. But when I run my server on the localhost, I got 400 (Bad Reqeust). Do you know what might cause that issue? If anyone runs into the same problem as me? Thank you!
For anyone who faces the same problem, I change my region from Canada-central to another region in the US. It solves my problem, but I still don't know what should I set up for bucket locate in Canada.
Are there any free CDNs available for a Django app hosted on Heroku (free tier)? My site is only for my personal portfolio and I don't want to spend just to get a custom domain (which Cloudflare requires).
Dennis can you put a video on launching complete django project meaning serving user uploaded image and databases and using s3 baucket. Simply everything uploading our django project to aws
If static files are not getting loaded. In settings.py add WS_S3_REGION_NAME = 'ap-south-1' mine is 'ap-south-1' your might be different, you can find it on AWS site on right of you name
@@RiccardoDiBiagio88 in settings.py add ADMIN_MEDIA_PREFIX = '/static/admin/' and in order to copy the CSS for the admin interface to the static folder that was moved on cloud run python manage.py collectstatic in terminal. Did the trick
in settings.py add ADMIN_MEDIA_PREFIX = '/static/admin/' and in order to copy the CSS for the admin interface to the static folder that was moved on cloud run python manage.py collectstatic in terminal. Did the trick
@@ElvisMunteanu i've admin file in the main directory so i've : ADMIN_MEDIA_PREFIX = 'admin/' but this doesen't work for me. my urls are: MEDIA_URL = '/media/' STATIC_URL = '/static/' I add that my admin directory has been added on s3 bucket by collectstatic
It gives me an error when I configure the cors and it does not let me save because Unknown error Unexpected error has ocurred. API response Expected params.CORSConfiguration.CORSRules to be an Array
I had the same error, replacing everything with this JSON worked for me: [ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET", "PUT", "POST", "HEAD", "DELETE" ], "AllowedOrigins": [ "*" ], "ExposeHeaders": [], "MaxAgeSeconds": 3000 } ] Reference: docs.aws.amazon.com/AmazonS3/latest/dev/cors.html#how-do-i-enable-cors
After doing Everything, I am unable to see CSS effects (even images ) to CRM dashboards. Please suggest if anyone faces same. I have followed proper CORS configuration and also created IAM user . All details updated in settings.py file with 'storages' as installed apps. Please help
Hello Dennis, thank you for your wonderful videos, just need your little help here. I'm getting this ERROR when i try to go to the uploaded image link of bucket at 10:45 image is also uploaded to bucket but it cannot be fetched """This XML file does not appear to have any style information associated with it. The document tree is shown below. InvalidRequest The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. C4C0828B6D0E5A13 ErzKAWxZHLovlnuNW2rQf6wIiYJaoklTU/17GEp0W4Frr6cLhGF49lXdqpzSmSUcDg7r886AQ5Q= """
According to docs.aws.amazon.com/general/latest/gr/rande.html#s3_region, there are 8 Regions that support v2 and v4: US East (Virginia Only) US West (Oregon) US West ( N. California) Asia Pacific (Singapore) Asia Pacific (Sydney) Asia Pacific (Tokyo) EU (Ireland Only) South America (São Paulo)
Understood that this is best practices, but if my project only has a few images, no users or updating is it worth it to get my static files hosted here? Or might that not be worth my time to do so? Thanks as always.
You should be fine if you only have a few images. I'll be filming "Pushing live to heroku" in a few minutes and in that video you will see that I I will upload images without using S3 buckets. I'll try to mention your question in there :)
Please make a video using Google Cloud Storage, on UA-cam there is not a single video with django and Google Cloud Storage, I tried it myself and can not figure it out.
Don't forget to check out my Complete Django course! dub.sh/NvGboTI
For those who can't write the CORS configuration in xml:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"POST",
"GET",
"PUT"
],
"AllowedOrigins": [
"*"
]
}
]
Thanks bro!
Thanks alot
i've access dennied for any image file
@@elmanotas4041 You may need to make the bucket publicly accessible, I did this and changed everyone's permission to only 'Read'.
@@elmanotas4041 Exactly. As the above reply mentioned, you need tweak the security settings. Lookup something to change the permissions "available to everyone" or something like that
For everyone getting problems logging in, all of your previous customers, tags, products, are all deleted. They all got deleted in the previous video. What you need to do is to create a super user. if your are NOT able to create a superuser: Go to signals.py, and change "group = Group.objects.get(name='customer')" to "group, created = Group.objects.get_or_create(name='customer')". Once you create superuser with "python manage.py createsuperuser", log in to the admin panel (/admin). Go to the group section, create two groups with one being called (capitalisation does matter for both), "customer" and "admin". I would give all permissions to the admin group just because.
Lastly, go to part 6 in the tutorial at 10:09-11:36 and 12:16-end of video. I spent four days trying to figure this out but after nothing else working, so I hope my frustration doesn't go to y'all.
Also, make sure to go to your super account in users, and give your self the admin group.
I can't thank you enough. I recently learned django and just know basics, this is my first tutorial project. I'm following this course from the beginning. And today suddenly nothing works all I get is errors. No id can be logged in. I tried to create new super user but couldn't. Checked settings, decorators, views for an hour to see if I done any mistakes but nothing. Then I see this comment. thanks a ton. This helped me a lot.
@@tusharvyavahare9229 No problem and good luck 😊
you are a life saver , can you please explain what happens in get_or_create?
Awesome tutorials. Instead of copying over the files from local 'static' folder, it's better to run 'python manage.py collectstatic' after configuring AWS settings. This command auto uploads all the local static files including 'admin' files.
why does it take time to collectstatic
Yes, But then why is that neither my admin css nor my app css are working, also the images are not been loaded, could you please help here
you are a god
@@hrishikeshkale8403 that's the reason collectstatic would be powerful...
It will collect the files of your admin too
Awesome. Your comment should be higher
if you are beginner to AWS like technology a single error can give you head attack.
I'm getting a 'net::ERR_ABORTED 400 (Bad Request) 'in console for every file in the s3 bucket and the static files are not loading in my project. can you help me out with this.
Those who are not able to load static files:
add these following lines in settings.py
AWS_S3_ENDPOINT_URL: 'sts.ap-south-1.amazonaws.com'
AWS_S3_REGION_NAME = 'ap-south-1'
change region code according to your account settings.
Thankx a lot..that worked!!!!!!!!!!!!!!!!!!!!!!!!!!!!✌✌✌✌✌✌✌✌✌✌
Although in AWS s3 its mentioned that region not required...but it works only if region is selected
Thank you sir! I was almost giving up
Okay dude I have been putting off the aws stuff in my current project for like 3 months because I wasn't sure why I couldn't get it to work the first time. I was missing the boto3 package and trying to do it without. 🙃 Now I know, thanks man.
Ох красавчик! Спасибо огромное) буду ждать видео о деплое на амазон с безлимитным масштабированием и лоад бэлэнсером) спасибо и удачи!
10:47
As he mentioned, we need to configure how to save the image in the images folder. Does anyone know how to do that??
I also have this problem, MEDIA_ROOT = os.path.join(BASE_DIR, 'static/images') does not solve it for me
If the Image is not loading/you get error when going to image link "The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.", what you need to do is put " AWS_S3_REGION_NAME = 'us-east-2' " in settings.py. I live at the US east coast so this will work for me. If you live in another region, find the code that corresponds with you. Hope this helps.
dude thanks this helped me vote+
@@akashno3542 No problem.
Thanks
@@joe16349 No problem.
How do we ensure that users can not access other users images by modify the S3 path in the inspector of the browser?
If anyone is having issues with images not loading in after configuring settings...
I kept getting this error when I followed Image URL "SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method. "
I fixed it by adding AWS_S3_ADDRESSING_STYLE = "virtual" into my settings.py. Apparently this is a problem if you're using us-east-2 server. I hope this helps anyone out there I was stuck with this bug for 3 hrs.
P.S If you're already deployed to heroku, make sure you update requirements.txt when new packages.
Thank you so much. It worked.
I was looking on internet for 2h, my region was eu-central-1, and i had this problem, thank you so much!!!
Life Savior
THANK YOU ! Even I was stuck at it for 3 hrs !
Beautiful answer! Thanks! This also works for eu-north-1
I am getting this error though I installed django-storages, boto3
Please make a video on how to set up an Elastic Beanstalk environment with Django. I'm super stuck at trying to access ENV variables
Amazing. I can believe I just upload my static files to Aws. It was incredible simple with your help. Thx so much.
Hi do you have the cors configuration? I need it. thanks
I've completed 14 videos thank u very much 🙏
So awesome to hear that! Keep up the hard work :)
thank u for support us @@DennisIvy sir 🙂
It seems the photo cannot render as expected. So I need to add something more based on Django-storages guidelines. First, AWS_S3_SIGNATURE_VERSION ='s3v4' Second: AWS_S3_REGION_NAME = "us-east-2"
One more thing to point out, safari didn't render images successfully, while chrome work completely fine.... This took me a day to find out
THANKS
You are a superstar !!!!!
Some people don't need to wear a cape to be heroes.
Lots of love from Germany. I hope you and your family stay safe :)
how to do configure it so that the image goes into the img folder on s3? I watched all the videos and i didnt see it. Thanks for the great tutorial!
this works for me
ProfilePicture = models.ImageField(upload_to='ProfileImages/')
Django will Automatically create the folder, You can name it any name you want. Just make sure you've configured you media url in your settings.py . Happy Coding 😉
ALL THE TIME WITH AWS
Hi Dennis,
I can't fetch the logo from S3 Bucket
The error message is
This XML file does not appear to have any style information associated with it. The document tree is shown below.
SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.
I have set in settings.py
AWS_S3_HOST = 'us-east-2.amazonaws.com'
AWS_S3_REGION_NAME = 'us-east-2'
oh i have to add
AWS_S3_SIGNATURE_VERSION = 's3v4'
to settings.py
Bro i can't debug that error what to do??
Thanks, helped a lot!!
in fact I have only set in
AWS_S3_REGION_NAME = 'us-east-2'
and worked fine.
Hi Dennis, I've got a problem when using aws database (followed all the steps in the tutorial). After connecting and running the server, I'm UNABLE TO LOGIN WITH ANY REGISTERED USER & ITS CORRECT PASSWORD. However, when I switch to the default 'sqlite' database it works perfectly! Same happens with the /admin login too.
Also, when I tried to create a new user, I get an error "DoesNotExist at /register/.....Group matching query does not exist.". Please suggest the solution.
Same here
when you migrated the database, all the created groups were deleted and you need to create them once again
@@adamsk2624 Thanks for the reply, I really appreciate that
@@adamsk2624 I'm sorry I'm unable to create a new group because I get an error while creating a new superuser
@@gen-ztiktok6990 what error did you have?
what would be the reason that I can't see status part colors and logo on navbar?
I have managed to see uploaded profile photos on account settings but not logo picture.
right click the page, inspect, click on console and see the error message in red. google the message and most likely there will be a stackoverflow article with the solution.
Dennis congrats, what should I do, about showing images com table field? like {{ table.image }} ? it is not working here.
I am getting putobject error while uploading profile pic , how do i fix this?
in between last video and this video , did you create your admin user and different user accounts ? I am getting and error while creating admin account as "django.contrib.auth.models.DoesNotExist: User matching query does not exist"
please help how to create super user to proceed. Excited to learn more. Pls help
images are not showing. they are working fine using direct address. but can't make them work while updating profile pictures.
How to separate Media Files and Static Files in one bucket ?
For example,
In local I have "media" folder for file uploads, and "staticfiles" for collected static files.
How can I define those folders in bucket?
In the video you shown only putting
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' #for media
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' #for static
Please advise..Thanks
How do you change the configuration so that the uploaded file goes into the images/ dir instead of the main dir in the S3 bucket?
Hello , I'm still a beginner at this, when i try creating custom storage, i cannot import s3boto3storages from storages.backends.s3boto3 , can you help me
I managed to upload the files, and in that moment the static files are loaded , but I loose any configuration to the admin pages, those look really basic. Anyone had this and know what happened or how to fix it ?
yes it happens when you don't configure correctly your remote s3 source and you just delete your local statics, In that case admin doesn't have the knowledge of the styling. Also remember to put in your S3 bucket the admin folder under static. (local: static/admin, in your s3 bucket: admin).
Also if you want your admin o other static info serve in your server instead of S3, just remove STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' from your settings and run python manage.py collectstatic
Thanks I was having a problem with this and the videos helped out a lot
I have multiple apps so how do I proceed uploading my static files on AWS?
Will this work on S3 services from another providers or just on Amazon AWS?
Hi wondering if anyone has seen a solution to this issue.
Ever since I migrated from localhost to postgres/AWS, I am not able to login or register even as Admin.
Seems all migrated tables to pgAdmin did not include any data. So the tables are empty and wont let me login. Can you help in any way?
I have had this same issue (as well as a few others in this comment section). I have been working to figure it out but have not been successful so far
So finally I was able to get all data migrated to postgres/AWS databases.
This is how I did it after several hours unfortunately;
-- First I followed this guide: www.vphventures.com/how-to-migrate-your-django-project-from-sqlite-to-postgresql/
-- But before I started I stripped the sqlite3 db of all data leaving only the superuser from "127.0.0.1:8000/admin" (Everything including customer, orders, customer group etc.)
---then I ran a TRUNCATE django_content_type CASCADE; from python manage.py dbshell on the sqlite3 db and postgres db.
--Finally python manage.py loaddata db.json
-- and boom it worked!!
Took a little too long but paid off in the end. Gained a lot from the research.
Thanks Dennis
@@elprinz6604 Hello, I have been stuck on this for a long time as well! Since I'm a beginner I didn't understand fully your solution, would you be able to give more details of how you were able to do it? Thanks!
Hello Dennis - thanks for sharing nice tuts. I am pretty new to Django. Can you pls advise me how do I configure boto3 so that I can able to upload (few) files like some CSV Data to s3 (for further processing) and others (like images etc) in local storage. So basically S3 will be for remote processing of CSV data through Lambda.
How would you make the images private such that they need a user session which corresponds to the "owner" of the image
Added STATICFILES_STORAGE but it still reads files from localhost. What is wrong?
how to download media files which we are storing gin s3 bucket in django ? Now i am only able to open in browser only. I want to download the file directly from the link.
if anyone faces Access Denied Error even after trying all the things mentioned in the video and comments just add the bucket policy which will also help to render images and CSS styling. Use the following policy and just change the Resouce by pasting your bucket arn in it
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": "/*"
}
]
}
Sir, after attaching to AWS i can't able to access by old user names which we created in local server , even the admin ,
It says username or password incorrect
But if i create new user, that able to access (login) correctly
So sir please help me with how to fix this data loss issue.
I have a css background image set for body tag and it is not loading on the page through s3. The error i get is 403 forbidden. But the images in img tag like the logo are loading fine.
i try many ways for solve this in the end you can add this in your settings.py and will be fine
```
AWS_QUERYSTRING_AUTH=False
```
from s3 you have to make public directory , Gluck
@@NiM44 Thank you can you give some information of it that after setting it what happen that all our files work fine
When admin gets login and enter dasboard,there is feature of "create customer" and when admin view the customer,there is another feature "update customer" ..you haven't work in both yet.hope you will cover this too soon
I am also interested in the code for the "create customer" and "update customer". Earlier on, you also indicated that you'll show how to select multiple items with checkboxes from a dropdown. I have tried doing this using django-multiselectfield but no luck getting check box included. Please assist or point me in the right direction on these 3 items. Completed your tut, great stuff!
Dennis sir whether it is free to use aws as a beginner person to test our application????
if i added STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage', then my admin page is broken, do you have any idea?
Damn man thank you SO much. Is people like you that go to heaven
Those who are facing image is not showing issue
Just upload (AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME) in setting.py
Then, go to your AWS S3 make the folder which contains image, make that folder to public
That's it your good to go
Nice tutorial! My portfolio is already running in Heroku server. Thanks for this tutorial Dennis!
do you help me on deploy my portfolio
@@nomanislam4946 hello! How may I help you?
I can't setup s3 bucket & its CORS configuration
@@nomanislam4946 does it displays error message about JSON format?
yes
Great job bro. thank you so much for this, the static files for my application seems to be loading just fine, but by admin static file isn't loading, please help.
Request! Next project React with Django new domain covering scratch to advance(complete). thank you.
I would love to see React on Django video with simple teaching method :)
@@beyzaaydn2896 yes that what i want too.
I am not able to write the CORS cofiguration in XML. AWS says that only JSON is valid. Please help.
This is the equivalent code in JSON: [
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"POST",
"PUT"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]
@@hugobritto9873 I got an error while creating a superuser after connecting AWS to my project, the error says: django.contrib.auth.models.DoesNotExist: Group matching query does not exist.
Hello Dennis,
Thank you very much for sharing your knowledge and helping us, I am following your Django course (on 14th video currently) and learning much, enjoying much and evolving much from your course. What you are doing and how you are doing is really wonderful.
very_grateful = True
the static files and images are not loaded when using s3 aws, I have tried all the suggestions in the comments but all of them did not work for me. I have tried to set the region and still nothing is loading. However when I inspect the elements in the page I can see the url like this "bucket-name.s3.amazonaws.com/image01.png" or "bucket-name.s3.amazonaws.com/project-name/css/bootstrap.min.css". However css not displayed all what I can see HTML and failed to load images. Can anybody help me with this?
same thing, did you solve it?
@@sergimartinez7060 yes it the bucket policy need to be set you will find Denis written a code in one pf his videos that solves that issue. I think it was the portfolio website time lapse check it in the videos section
@@mohamedsameh3126 hello, this is the same issue i've been trying to solve for the past one week, can you kindly put me through how you were able to debug the issue?
Uhm... I would like to ask if you have alternative Storage Server aside from Amazon S3, based on their website, their free tier will only last for 12 months, then they will charge on your registered Credit card.
amazon s3 is serving user uploaded images as expected, but it is not serving my static images.
Hey man, thanks for the new upload. Video 13 seems to be missing though
That was supposed to be "Pagination". It fell of the priority list but i'll add it soon :)
what if i want to store only media file to aws-backet and not the whole css, jss files
Great Video !!! Really helpful series !!
Can you help me with mayan edms S3 integration?
Thank you Dennis~ great course.
I have a problem, after I set up the S3 Bucket when I collect static files, they are all uploaded to bucket with no problem. But when I run my server on the localhost, I got 400 (Bad Reqeust).
Do you know what might cause that issue? If anyone runs into the same problem as me?
Thank you!
400 (Bad Request) only for those file on AWS bucket
For anyone who faces the same problem, I change my region from Canada-central to another region in the US. It solves my problem, but I still don't know what should I set up for bucket locate in Canada.
Keep getting this Error @ the CORS configuration.
The CORS configuration must be written in valid JSON.
Are there any free CDNs available for a Django app hosted on Heroku (free tier)? My site is only for my personal portfolio and I don't want to spend just to get a custom domain (which Cloudflare requires).
Do we need to configure (due to s3) , when we upload project to heroku
just the thing i was looking for
Dennis can you put a video on launching complete django project meaning serving user uploaded image and databases and using s3 baucket. Simply everything uploading our django project to aws
If static files are not getting loaded.
In settings.py add
WS_S3_REGION_NAME = 'ap-south-1'
mine is 'ap-south-1' your might be different, you can find it on AWS site on right of you name
still not loaded
Awesome video thank you so much! This really helped me :)
thank you man!! I'm from Brazil !
Do you know of a good tutorial to upload a site to AWS elastics beans?
SSL validation failed for (bucket name).... PLS sir help me🙏
Hi, I'm getting 403 error when Public access is denied for bucket. I want the images to be accessible only through my website. How can I do that?
me too, did you solve it?
For Media files / images, do we need to do the same configuration? or it is different then what is setup for static files / images.
actually you need to public your bucket in s3 you can use this link havecamerawilltravel.com/photographer/how-allow-public-access-amazon-bucket/
Why my app started loading much longer after this and all my data lost ?
Clearly explained. Thank you
Although in AWS s3 its mentioned that region not required...but it works only if region is selected
You're awesome Dennis, thanks a lot !!!!!!!
Very nice tutorial. Thank you
I am able to see the media files but not the css which show 403 forbidden error
Thank you mate for this tutorial!
can you provide me with thw link of this project ?
all is working but my 127.0.0.1:8000/admin has no staticfiles
sorry , has only html code and no css
@@RiccardoDiBiagio88 in settings.py add ADMIN_MEDIA_PREFIX = '/static/admin/' and in order to copy the CSS for the admin interface to the static folder that was moved on cloud run python manage.py collectstatic
in terminal. Did the trick
in settings.py add ADMIN_MEDIA_PREFIX = '/static/admin/' and in order to copy the CSS for the admin interface to the static folder that was moved on cloud run python manage.py collectstatic
in terminal. Did the trick
@@ElvisMunteanu i've admin file in the main directory so i've :
ADMIN_MEDIA_PREFIX = 'admin/'
but this doesen't work for me.
my urls are:
MEDIA_URL = '/media/'
STATIC_URL = '/static/'
I add that my admin directory has been added on s3 bucket by collectstatic
@@ElvisMunteanu where have you find the solution?
Hi Dennis, whats happending here. The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
When I start using aws my app doesn't allow me log in user or even register them. Somebody help me please.
Nick Selemogo in your Group table, add groups admin and customer
@@aneessyeda4704 how to add in groups. plz tell
@@aneessyeda4704 Thank you!
It gives me an error when I configure the cors and it does not let me save because
Unknown error
Unexpected error has ocurred.
API response
Expected params.CORSConfiguration.CORSRules to be an Array
I had the same error, replacing everything with this JSON worked for me:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"PUT",
"POST",
"HEAD",
"DELETE"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [],
"MaxAgeSeconds": 3000
}
]
Reference:
docs.aws.amazon.com/AmazonS3/latest/dev/cors.html#how-do-i-enable-cors
@@dianalovette2078 Thanks man
great video worked for me!
Thanks Dennis for the amazing tutorial....when i open Amazon S3 , I keep getting this Error "Unknown Error An unexpected error occurred".
After doing Everything, I am unable to see CSS effects (even images ) to CRM dashboards.
Please suggest if anyone faces same.
I have followed proper CORS configuration and also created IAM user .
All details updated in settings.py file with 'storages' as installed apps.
Please help
I'm facing the same issue man, please lemme know if you found a solution, Thanks!
@@shashwatpuri6496 have you solved the problem?
Just EXCELLENT! can you help us to do the same with Dropbox API?
Hello Dennis, thank you for your wonderful videos, just need your little help here.
I'm getting this ERROR when i try to go to the uploaded image link of bucket at 10:45
image is also uploaded to bucket but it cannot be fetched
"""This XML file does not appear to have any style information associated with it. The document tree is shown below.
InvalidRequest
The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
C4C0828B6D0E5A13
ErzKAWxZHLovlnuNW2rQf6wIiYJaoklTU/17GEp0W4Frr6cLhGF49lXdqpzSmSUcDg7r886AQ5Q=
"""
Thank you Kapil :)
It seems like you either didnt provide the right credentials or maybe didn't fully set the user permissions.
@@DennisIvy SOLVED.
All credentials were right, but needed extra parameter in my case i.e.;
AWS_S3_REGION_NAME = 'us-east-2'
thanks
According to docs.aws.amazon.com/general/latest/gr/rande.html#s3_region, there are 8 Regions that support v2 and v4:
US East (Virginia Only)
US West (Oregon)
US West ( N. California)
Asia Pacific (Singapore)
Asia Pacific (Sydney)
Asia Pacific (Tokyo)
EU (Ireland Only)
South America (São Paulo)
@@kapilpalotra6279 thank you very much !!
Thank you so much, Bro!
Understood that this is best practices, but if my project only has a few images, no users or updating is it worth it to get my static files hosted here? Or might that not be worth my time to do so? Thanks as always.
You should be fine if you only have a few images. I'll be filming "Pushing live to heroku" in a few minutes and in that video you will see that I I will upload images without using S3 buckets. I'll try to mention your question in there :)
@@DennisIvy Awesome. Good timing
Thanks alot sir it really help full
i can't access my website anymore, or login to the admin django site, what is happening
it's like my database just disappeared and now i cant log in to my site someone help
@@louzynerd129 after you create the postgreSQL database and connect it to your project, you need to create a new django superuser
God level
Thank you so much.. Its working..
Ivy please can you do something on react and django?
Excellent course
26/07/2020
This is killing me, but my S3 bucket gives me a restricted access 403 for everything. I followed you and Corey's lead on this exactly. Thoughts?
me too, did you solve it?
If you change the area zone thing for the bucket you will need to add more code. Don't know why but it pisses me off.
Please make a video using Google Cloud Storage, on UA-cam there is not a single video with django and Google Cloud Storage, I tried it myself and can not figure it out.
I'll have to look into it since its not something I've done myself. Appreciate the input :)
Great!! my bro