如何修复“在这个服务器上找不到请求的URL”apache2+Django+ec2?

2024-03-29 14:46:07 发布

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

我正在一个EC2实例上部署一个用django和python2.7构建的网站,并使用apache2。在

我一直在听一些教程,但没有一个对我有用。我现在安装了apache,配置它以查看项目,甚至配置了权限。在

项目目录:

    |
    |-ubuntu
       |
       |- jendalma
              |--apps
              |--media
              |--promotions
              |--sellerlogin
              |--templates
              |--frobshop
                    |
                    |---frobshop
                            |
                            |---setting.py
                            |---wsgi.py
                            |---urls.py
                            |---static

000个-默认.conf-阿帕奇

^{pr2}$

网址:

js_info_dict = {
    'packages': ('stores',),
}

admin.autodiscover()

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^i18n/', include('django.conf.urls.i18n')),

    # Stores extension
    url(r'^stores/', stores_app.urls),
    url(r'^dashboard/stores/', dashboard_app.urls),

    # PayPal extension
    url(r'^checkout/paypal/', include('paypal.express.urls')),

    # Datacash extension
    url(r'^dashboard/datacash/', datacash_app.urls),
    url(r'^dashboard/login/$', DashAccountAuthView.as_view(), name='login'),
    url(r'^dashboard/register/$', DashAccountRegistrationView.as_view(), name='register'),
    url(r'^dashboard/methods/shipping/$', methods),
    url(r'^dashboard/methods/shipping/change/$', change_method),
    url(r'^currencies/', include('currencies.urls')),
    url(r'^customer/', include('sellerlogin.urls')),
    url(r'', application.urls),
]

if settings.DEBUG:
    import debug_toolbar
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
    urlpatterns += [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ]


admin.site.site_header = "Jendalma Express Admin"
admin.site.site_title = "Jendalma Express Admin"
admin.site.index_title = "Welcome to Jendalma Express"

尝试访问url时收到的错误:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at <> to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.


Tags: thepyappurlsettingsincludeadminextension