找不到:在此服务器上找不到请求的url。AWS Django弹性豆茎

2024-04-28 12:54:05 发布

您现在位置:Python中文网/ 问答频道 /正文

您好,让我提前道歉,因为我是一个初学者,这可能是一个非常简单的修复,但我刚刚启动了我的第一个弹性豆茎服务器,试图托管我的投资组合。我遵循了亚马逊在https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html发布的教程,但一定是出了什么问题。我会包括我的层次结构,我的applications.py和我的url.py的图片,如果你还需要什么,请不要犹豫,寻求任何帮助,非常感谢

"""
WSGI config for Portfolio project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Portfolio.settings')

application = get_wsgi_application()

这是我的application.py,现在是我的url.py

from django.contrib import admin
from django.urls import path, include

from . import views

urlpatterns = [
    path('', views.index, name='index'),
    path('admin/', admin.site.urls),
    path('sudoku/', views.sudoku, name='sudoku'),
]

最后是我的等级制度

enter image description here


Tags: pathdjangofrompyhttpsimportcomurl