2

I'm sure I am missing something embarrassingly obvious here, but as I am following Tipfy's Hello World tutorial, I'm getting nothing but Werkzeug's 404 page whenever I try to load one of the URLs defined in my urls.py file (in /project/app/apps/hello_world).

I've ensured that 'apps.hello_world' is in the list of installed apps in the 'apps_installed' dictionary in config.py. Everything else seems to be in order, and I've read & followed the instructions in the tutorial and Getting Started guide carefully, but I can't see why Tipfy isn't detecting the rules I defined in get_rules() in my hello_world app's urls.py file.

Here is the code from that file:

from tipfy import Rule

def get_rules(app):
    rules = [
        Rule('/', endpoint='hello/world', handler='handlers.HelloWorldHandler'),
        Rule('/hello-jinja', endpoint='hello/jinja', handler='handlers.HelloJinjaHandler'),
        Rule('/hello-json', endpoint='hello/json', handler='handlers.HelloJsonHandler'),
        Rule('/hello-ajax', endpoint='hello/ajax', handler='handlers.HelloAjaxHandler'),
    ]

    return rules

Any help anyone can offer is greatly appreciated - thanks!

4

1 に答える 1

2

どうでも。私はそれを解決しました。Tipfy のドキュメントのどこにも見つけられませんでしたが、私はまだ Python の初心者であるという事実にもかかわらず、apps ディレクトリ内の「hello_world」ディレクトリに__init__.pyファイルが必要であることを知っておくべきだったと思います。モジュールとして扱われる

于 2011-03-11T05:10:05.730 に答える