web2py URL helper not building good URL's -
I'm starting in web2py and I need to link my still files in my view files.
I am trying to use the URL assistant to create the link, but I am not working properly ...
My application is called Red , My controller default and my function index My view is called index.html and inside the default folder, when I go to the page, I see the correct way, but my URL is all wrong ...
So far I tried:
URL ('static', 'css / bootstrap.min.css') who gave back: "/ static / css
URL: "/ Default / red / static / css / url (r = request, rgr = 'static / css / bootstrap.mmcsa ')
which was given: given: "/ default / static /css/bootstrap.min.css "
url (a = request.application, c = 'static / css / bootstrap.min.css', f = '') What was given: "/red/red/static/css/bootstrap.min.css"
I may have tried a bit, but no success was found. .
and my router:
router = dict (#boot router base) = Dict (application = ['red', 'admin I think it's also important to say that I do not know it by Goog. I'm testing on le app engine.
I have to get "/red/static/css/bootstrap.min.css".
I hope you want to link the CSS files in your view. You can do it tow methods.
1. In the controller file (in the index) :)
response.files.append (URL (request.application, ' < P> You can also use the same command in the view (index.html): {{Response.files.append (url (request.application, 'static / css',' See bootstrap.min.css'))}} see 2.in (index .html) You can refer to normal CSS linking.
& Lt; LINK rel = "stylesheet" type = "text / css" href = "{{= = URL ('static / css', 'bootstrap.min.css')}}"> < / Pre> If you want to link this file to the whole application then layout.html Mention Rokt line.
Comments
Post a Comment