# indexHome **Repository Path**: nlb8310/indexHome ## Basic Information - **Project Name**: indexHome - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-11-04 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 基于django的首页项目 【问题原因】:django的生产环境不同开发环境,在生产环境下(DEBUG=False),django.contrib.staticfiles 是不起任何作用的,也就说 django.contrib.staticfiles 只对开发环境(DEBUG=True)开启。所以会导致xadmin样式丢失现象。 【解决方案】: ①在settings.py中添加如下配置 STATIC_ROOT = os.path.join(BASE_DIR, 'static') urlpatterns = [ path('xadmin/', xadmin.site.urls), //... re_path('static/(?P.*)', serve, {'document_root':STATIC_ROOT}), ] 运行 RUN manage.py Yask [collectstatic]