Staticfiles on S3

35 views
Skip to first unread message

Elias Coutinho

unread,
Sep 4, 2019, 4:06:29 PM9/4/19
to Django users
Guys good afternoon,

I managed to put my static folder in s3, the problem is that my effects already lost power. lol

The staticfiles folder where the auxiliary applications are installed stop working, in my case it was django-material, select2 and others.



If I comment this code that is in the settings of my project it works but does not send anything to Amazon s3.



Any suggestion?

mohammed habib

unread,
Sep 4, 2019, 4:36:44 PM9/4/19
to django...@googlegroups.com
Did you run python manage.py collectstatic

Are you using static template tags to heed your html link href fields 

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/70f224ee-f7a4-468f-9609-db2f8a0be161%40googlegroups.com.

sachinbg sachin

unread,
Sep 4, 2019, 10:35:26 PM9/4/19
to django...@googlegroups.com
Mention aws key value in setting 

Elias Coutinho

unread,
Sep 16, 2019, 4:01:27 PM9/16/19
to django...@googlegroups.com
It seems that one of the problems is occurring while downloading the files.

See this error image:

image.png

If I go to Direct Link it usually downloads:

https://gsm-gervas.s3.amazonaws.com/static/material/fonts/roboto/fonts/Roboto-Medium.woff2

You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/ainBAyaKDCc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOs61rziOACLNEH8jhT95zOcJWX6uomoxSLiQAVuU6eb43rNkQ%40mail.gmail.com.


--
Elias Coutinho.
Aprender sobre alguns assuntos é fundamental.
Aprender sobre Deus é indiscutivelmente o melhor conteúdo.

Anthony Goslar

unread,
Sep 16, 2019, 4:44:50 PM9/16/19
to django...@googlegroups.com
Try using Django-storages and follow the tutorial on simpleisbetterthancomplex.com

This looks like a permissions issue.

I had similar issues with Google Buckets and sorted it out by reading the django-storages methods for Google buckets in the source code and then making sure all the settings were correct.

Anthony


Aldian Fazrihady

unread,
Sep 16, 2019, 7:19:05 PM9/16/19
to django...@googlegroups.com

Elias Coutinho

unread,
Sep 19, 2019, 2:11:37 PM9/19/19
to Django users
I put in S3 in Permissions> CORS Configuration the following:

     <CORSConfiguration>
      <CORSRule>
        <AllowedOrigin> * </AllowedOrigin>
        <AllowedMethod> GET </AllowedMethod>
        <AllowedMethod> PUT </AllowedMethod>
        <AllowedMethod> POST </AllowedMethod>
        <AllowedMethod> DELETE </AllowedMethod>
        <MaxAgeSeconds> 3000 </MaxAgeSeconds>
        <AllowedHeader> * </AllowedHeader>
      </CORSRule>
     </CORSConfiguration>

And solved! It would be interesting if you could send these CORS through the system.

Thank you guys.
Reply all
Reply to author
Forward
0 new messages