只有Django Admin页面可见,而剩余的Site网站在生产中为空白

问题描述

我正在尝试将我的网站托管在本地主机上的heroku上,我的项目很好,没有问题,在部署它时,我得到的只是空白页(我检查了它并且显示了元素,但网页上什么都看不见),除了管理页面我在部署时安装了所有必要的软件包,即gunicorn和whitenoise以及设置STATIC_ROOT和STATICFILES_STORAGE。我首先将disABLE_COLLECTSTATIC = 1设置,然后在部署时将其设置为0,但我没有看到可能导致此问题的任何错误

我的一些上下文文件

设置

STATIC_URL = '/static/'
STATICFILES_Dirs = [os.path.join(BASE_DIR,'static_dev')]
STATIC_ROOT = os.path.join(BASE_DIR,'static')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesstorage'

网址

from django.contrib import admin
from django.urls import path,include
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import handler404


urlpatterns = [
    path('admin/',admin.site.urls),path('users/',include('user.urls')),include('django.contrib.auth.urls')),path('accounts/',include('allauth.urls')),path('',include('pages.urls')),path('store/',include('store.urls')),#path("djangorave/",include("djangorave.urls",namespace="djangorave")),] + static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)


#error handlers
handler404 = 'store.views.error_404'
#handler500 = 'store.views.my_custom_error_view'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)