Flask Mailinglist

« back to archive

Static file not loading when I have a URL like localhost:5000/do/something

Static file not loading when I have a URL like localhost:5000/do/something

From:
Mahesh Lal
Date:
2012-10-14 @ 07:02
Hi,

I have a URL defined as publish/new which is wired to a controller.

In the template being rendered, I am trying to get a js file using the
script tag in which I have *src="{{url_for('static',
filename='js/story/editor.js')}}" *which works and the JS loads.

However in the same template, I try to load another file using
*src="{{url_for('static',
filename='resources/tinymce/jscripts/tiny_mce/jquery.tinymce.js')}}" *and
it doesnt load.

The problem is that it is trying to fetch a file from*

http://localhost:5000/publish/static/resources/tinymce/jscripts/tiny_mce/tiny_mce.js
.*
*
*
Can someone help me out and point out what I might be doing wrong?

P.S. --> other urls like /login, /register work seamlessly

--  
*-- REGARDS* 
* 
 
MAHESH LAL* 
* 
* 

Re: Static file not loading when I have a URL like localhost:5000/do/something

From:
Christopher McComas
Date:
2012-10-14 @ 13:51
> src="{{url_for('static',  
filename='resources/tinymce/jscripts/tiny_mce/jquery.tinymce.js')}}" 

That path isn't the same as the path in the below example. 

> /static/resources/tinymce/jscripts/tiny_mce/tiny_mce.js 

Sent from my iPhone

On Oct 14, 2012, at 3:02 AM, Mahesh Lal <mahesh.2910@gmail.com> wrote:

> Hi, 
>  
> I have a URL defined as publish/new which is wired to a controller.  
>  
> In the template being rendered, I am trying to get a js file using the  
script tag in which I have src="{{url_for('static', 
filename='js/story/editor.js')}}" which works and the JS loads.
>  
> However in the same template, I try to load another file using and it  
doesnt load.
>  
> The problem is that it is trying to fetch a file from  
http://localhost:5000/publish.
>  
> Can someone help me out and point out what I might be doing wrong?  
>  
> P.S. --> other urls like /login, /register work seamlessly 
>  
> --  
> -- REGARDS 
>  
> MAHESH LAL 
>  
>