E
E
Ed10242016-01-24 12:52:11
css
Ed1024, 2016-01-24 12:52:11

.tpl page with html code doesn't load css, why doesn't link tag work?

on the .tpl page, only inline styles work (through the tag), and external ones do not load

<html>
<head>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>

  <div class="wrapper">

        %for i in books:
            <p>{{i['author']}}</p>
        %end


        <h1>Hello {{name}}!</h1>

    </div>
</body>
</html>

import pymongo
import bottle

connection = pymongo.MongoClient()
db = connection.bookstore


@bottle.route('/')
def hello():
  collection = db.books
  book = collection.find()
    


  return bottle.template('index', name="Edgar", books=book)

bottle.run(host="localhost", port=8080)

body{
  color: blue;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-01-24
@Ed1024

bottlepy.org/docs/dev/tutorial.html#routing-static...
IMO better learn flask, better yet django

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question