Ask Your Question
1

Three different domains for js,css and images

asked 2013-09-26 05:55:32 -0600

anshprat gravatar image

updated 2013-09-26 11:40:36 -0600

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 ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-09-26 11:43:47 -0600

updated 2013-09-30 00:44:20 -0600

Evgeny gravatar image

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.

edit flag offensive delete link more

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 gravatar imageanshprat ( 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 gravatar imageFitoria ( 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 gravatar imageanshprat ( 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 gravatar imageFitoria ( 2013-09-29 11:34:11 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-09-26 05:55:32 -0600

Seen: 137 times

Last updated: Sep 30 '13