Skip to content

成功正常运行 #4

@xyxywan

Description

@xyxywan

不提供技术支持,只说明成功的方法。
首先在pycharm打卡项目,安装各种缺失的组件django,运行manege.py报错,No module named 'corsheaders'
然后pip install django-cors-headers,
然后由于django4版本问题,把mainlist/urls.py里改成
from django.urls import path
下面的全都改成path(xxxxx)
控制台输出正常,输出了一堆像是 -help的东西
后面操作都在cmd里面进行
python .\manage.py runserver,此时应该正常监听8000端口
但是打开还是提示缺少资源文件
然后把mainlist/urls.py里的第一个path(xxxxx)改成
path('', TemplateView.as_view(template_name="index.html")),
http://127.0.0.1:8000/页面就能正常打开了,后面有什么问题的还没看

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions