Re: Need help with CDN on Django App using heroku

2018-10-22 Thread Andrew Pinkham
On Oct 22, 2018, at 11:53, Akash Purandare  wrote:
> However the issue is not with Whitenoise. Whitenoise can be used to serve 
> static files, yes. But how do I use it to serve media assets in the project?

Sorry, missed the media part.

Michal is right, you will need to install and configure django-storages for S3. 

https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html

Related:
https://docs.djangoproject.com/en/2.1/ref/settings/#media-root
https://docs.djangoproject.com/en/2.1/ref/settings/#media-url

This tutorial may be useful (Updated in 2017):

https://www.caktusgroup.com/blog/2014/11/10/Using-Amazon-S3-to-store-your-Django-sites-static-and-media-files/

Andrew
https://jambonsw.com
https://django-unleashed.com

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16D1C20E-91C9-4E16-B4E3-F410F815FA3D%40andrewsforge.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help with CDN on Django App using heroku

2018-10-22 Thread Akash Purandare
Thank you for the fast reply.

However the issue is not with Whitenoise. Whitenoise can be used to serve 
static files, yes. But how do I use it to serve media assets in the project?

On Monday, October 22, 2018 at 9:11:02 PM UTC+5:30, Andrew Pinkham wrote:
>
> https://devcenter.heroku.com/articles/django-assets 
> 
>  
> http://whitenoise.evans.io/en/stable/django.html 
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/64d5e24a-7115-409e-b328-c45a0875f5b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help with CDN on Django App using heroku

2018-10-22 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Mon, Oct 22, 2018 at 08:38:25AM -0700, Akash Purandare wrote:
> I am trying to serve both static and media files on Heroku by using an S3 
> bucket, but I do not know how to properly configure the settings.py for the 
> same.
> Does anyone know how to do it? If you do, please direct me to the correct 
> set of information.

Django itself does not ship with built-in support for S3, you'll have
to use a third-party package for that. django-storages appears to be a
popular one, I suggest that you start here:
https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html

Good luck,

Michal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJbze/JAAoJEHA7T/IPM/klbT8QAOLnyQUXGiJWWyXk0p1bEDMN
cECp9OkfvZsugvSkubXJF1RppLS9dv4CaPoC2dplC/HjPJeE/4hTtdvZHzHfE/8Y
aFI6ga/grMNvoNFl2F1Khxcau75ZwrJhzWwCQGQDfTnbz4hzjJ9er9asv4IO30X7
+WCGJAg2yLi+GxVEuDM4zC8+7SUzPlVVEL3DsbL6M0UzbcYbWWlZ7laQne3H+BM1
6hQ7nr/u9eYUB3wFVYGbcbtXW1yzSUo/KrW/Xu2Ns3oyhubboDDVr/IsRsRuMwLm
FFkthwS9A2ej37rR1BpQl0ayEOPpsnxNCf3eSytRwfpvxGZkE67kg6qJJdwWaTX+
cteyG8q31LJ2HCpUuFaEUc4YA8D35mGt/4sWfYxXJwDBQ+s4StbhjK3Y/aRYwjdk
oM+ewO/dxm1OQzHWU/a0qcvS8GXAiwIB8AbrsxYwYKPsPqPgx5KDojshuxEH5+X7
kZ7nQZGj7mYRtGkEGjpH/9gaQP6yiVrmORixb6l0vcWLyemmgrC5uIMSfceMpwTH
bUcjyXUfsrOD23ugrv+OKOAYzmce+fHujmEuLe/gy7w4jxWLax+qknf/2MZIcnFV
AXLmRt/hkElTAKnxj8Af+vLtJR20wcrE1rrtt8V4EvxUjKf5yMZgmd7NKw9Bp8Sz
GWuOPu4mWyx1+1sVxzXS
=xJut
-END PGP SIGNATURE-

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20181022154202.GP18928%40konk.org.
For more options, visit https://groups.google.com/d/optout.


Re: Need help with CDN on Django App using heroku

2018-10-22 Thread Andrew Pinkham
https://devcenter.heroku.com/articles/django-assets
http://whitenoise.evans.io/en/stable/django.html

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5027F5EE-03B2-4124-94CB-F88D4E42000E%40andrewsforge.com.
For more options, visit https://groups.google.com/d/optout.


Need help with CDN on Django App using heroku

2018-10-22 Thread Akash Purandare
I am trying to serve both static and media files on Heroku by using an S3 
bucket, but I do not know how to properly configure the settings.py for the 
same.
Does anyone know how to do it? If you do, please direct me to the correct 
set of information.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c3db0ad0-9342-4ca1-ba6d-2c1895b6790a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.