idea: deploy static files on github pages CDN

32 views
Skip to first unread message

cmawe...@gmail.com

unread,
Jul 17, 2014, 11:09:50 AM7/17/14
to django...@googlegroups.com
I had an idea today that I wanted to share, if anyone finds it helpful or has feedback.

./manage.py collectstatic
cd $STATIC_ROOT
rm -rf .git/  # optionally don't keep history
git init .
git add .
git commit -m"static files"
git push -f g...@github.com:username/yourrepo master:gh-pages

then set STATIC_URL = '//username.github.io/yourrepo/'

It works just fine, even on private repositories.

Alejandro Perez

unread,
Jul 18, 2014, 9:19:55 AM7/18/14
to django...@googlegroups.com
I was just thinking about some free place where to put all my static files out of my server..
It would be wonderful if this works in a production server, maybe something with nginx and uwsgi.. Did you try that?

Thanks for this tip!

Cal Leeming [Simplicity Media Ltd]

unread,
Jul 18, 2014, 10:33:35 AM7/18/14
to django...@googlegroups.com
I'm curious, why would you put your static web app files on Github
Pages? This is not just inconvenient (due to the way it works, lack of
cache control etc), but is also quite a blatant abuse of their
service.

If you're looking for a CDN, why not just put Cloudflare in front of your sites?

Cal
> --
> 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 post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d1abc065-3658-4528-a3da-b835bfc8a440%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages