Django hello world appを作成しようとしています。hello world appでサーバーが起動しない
私は、次のコードを持っている:/smartQuiz/smartQuiz/hello.py
に位置
import sys
from django.conf import settings
from django.http import HttpResponse
settings.configure(
DEBUG=True,
SECRET_KEY='badkey',
ROOT_URLCONF=sys.modules[__name__],
)
def index(request):
return HttpResponse('Hello, World')
urlpatterns = [
(r'^hello-world/$', index),
]
、smartQuiz
は私のプロジェクトのルートディレクトリです。
hello.py
があるディレクトリからpython hello.py runserver
を実行すると、サーバーは起動しません。
私は間違っていますか?
どのようなエラーが表示されますか? – jape
これは実際にあなたがDjangoをどのように実行するかではありません。これはうまくいくと思いましたか? –
私は何の誤りもありません。私は何のメッセージも得ていない。私はここで探していた:https://ultimatedjango.com/learn-django/lessons/create-the-hello-world-web-app/ – octavian