django项目迁移碰到问题

今天对之前的一个老的python/django项目做了迁移,直接将代码copy过来之后,然后直接在控制台,

python manage.py runserver 127.0.0.1:5000

结果报错了:

The included URLconf ‘xx.urls’ does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.

碰到这个问题呢,找了很久的原因也没有说明白。

然后重新建了一个项目:

django-admin startproject hello

在控制台输出一句话引起我的注意:

You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run ‘python manage.py migrate’ to apply them.

这句话大概的意思是:项目迁移需要执行 python manage.py migrate

然后我试了一下,果然,然后在处理一些module not found的问题,项目就重新部署好了 !

这个问题,之前没有碰到过,所以mark一下,希望对其他小伙伴有帮助!