2010-11-20 12 views
1

を失敗し、私はそうのようなファイル構造を持っている:Google App Engineの(パイソン) - インポート

... 
- url: /test 
    script: something/test.py 

test.py輸入models.py

app.yaml 
something/ 
    __init__.py 
    models.py 
    test.py 

を私はapp.yamltests.pyを実行するように設定URLを持っています

http://myapp.appspot.com/test/に移動しようとすると、次のエラーが表示されます。

Error: Server Error The server encountered an error and could not complete your request. If the problem persists, please report your problem and mention this error message and the > query that caused it

そして、私はダッシュボード上のログを確認するとき、私は次のようなエラーが発生した参照:私は適切にファイルをインポートするにはどうすればよい

<type 'exceptions.ImportError'>: No module named models 

from something.models import * 

この:あなたのようなトップ何かを書くことができますtest.py内部

import something.models as models 
+1

を持っている必要があります - 私たちはあなたが欠落している可能性があり、何かを見つけるかもしれません。 – Glycerine

+0

SDKでアプリを実行するとどうなりますか? – SingleNegationElimination

答えて

0

は、このようなmodelsをインポートしようあなたのモデルをインポートします。是正コードの場合 けれども - ワイルドカード「*」は素晴らしいではないですし、明示的にモデルをインポートあなたの使用して:

from something.models import ModelName, OtherModel 

のように。あなたが私達にあなたのコードを表示することができれば

+0

それは動作しませんでした - 私はまだ同じエラーが発生しています。 – Peter

+0

@Peter、回答を編集して詳細を追加してください:) – systempuntoout

1

test.pyはimports models、ないimports models.py