Paulo Barros
Paulo Barros

Reputation: 2770

python regular expression appengine

i have an application that uses appengine with python. Its a social network that maps places. I want to have each place in this kind or url: www.mysite.com/place/nameoftheplace

for that i did this regular expression as a parameter of mine WSGIApplication:

r'/place/(.*)' 

and on the get requisition i have:

def get(self, placeName=""):

but for some reason, if i call www.mysite.com/place/theplace, it enters the get with placeName = "theplace" and after the get ends, it call itself over and over, with a diferent placename like "/css/something". Can anyone help me? Thank you very much.

Upvotes: 0

Views: 259

Answers (1)

Wooble
Wooble

Reputation: 89977

It sounds like you're using relative URLs in your <link rel-'stylesheet' href='css/something'> tags in your HTML, so the browser is trying to fetch /place/css/something.


In your HTML, use, e.g., <link rel='stylesheet' href='/static/something.css'>, and in app.yaml use:

- url: /static/
  static_dir: static

then place your CSS in the static directory.

Upvotes: 2

Related Questions