First time here? Check out the FAQ!
1

Three different domains for js,css and images

hi,

I want to host my different types of static files on different domains. I have all the static files from domain other than the main askbot domain but I want to break it down to three different domains by type to increase parallel download. How can I do it in django / askbot settings.py ?

anshprat's avatar
46
anshprat
asked 2013-09-26 05:55:32 -0600, updated 2013-09-26 11:40:36 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

You'll have to modify the STATIC_URL and MEDIA_URL in your settings.py

There is no support currently for separate domains for css, js or other static files. They must all go in one domain, which however could be different from the main application domain.

Fitoria's avatar
1.1k
Fitoria
answered 2013-09-26 11:43:47 -0600
Evgeny's avatar
13.2k
Evgeny
updated 2013-09-30 00:44:20 -0600
edit flag offensive 0 remove flag delete link

Comments

@Fitoria I am using STATIC_URL but that sets all static urls to just one another domain. I want something like js being loaded from a.com and css from b.com and images from c.com

anshprat's avatar anshprat (2013-09-26 12:44:43 -0600) edit

Not sure on how to make it with this case, maybe making a template tag/filter for static media that changes the url according to the media type?

Fitoria's avatar Fitoria (2013-09-27 16:12:35 -0600) edit

@Fitoria if there could be something like STATIC_JS_URL , STATIC_CSS_URL and STATIC_IMG_URL with default values being STATIC_URL, makes sense?

anshprat's avatar anshprat (2013-09-28 07:56:07 -0600) edit

@anshprat there are not such settings for that, let me do some research on how to do it

Fitoria's avatar Fitoria (2013-09-29 11:34:11 -0600) edit
add a comment see more comments