如果出现以下问题:
You have 14 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' toapply them.
[root@yao mysite]# python manage.py migrate
Operations toperform:
Apply all migrations: admin, auth,contenttypes, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applyingadmin.0002_logentry_remove_auto_add... OK
Applyingcontenttypes.0002_remove_content_type_name... OK
Applyingauth.0002_alter_permission_name_max_length... OK
Applyingauth.0003_alter_user_email_max_length... OK
Applyingauth.0004_alter_user_username_opts... OK
Applyingauth.0005_alter_user_last_login_null... OK
Applyingauth.0006_require_contenttypes_0002... OK
Applyingauth.0007_alter_validators_add_error_messages... OK
Applyingauth.0008_alter_user_username_max_length... OK
Applyingauth.0009_alter_user_last_name_max_length... OK
Applying sessions.0001_initial... OK
遇到django服务开启正常,浏览器无法打开,而虚拟机内通过
[root@yao mysite]#curl -L http://127.0.0.1:8000/
能够正常使用。应该
[root@yao mysite]# python manage.py runserver0.0.0.0:8000
这样才能同一网段下正常使用。只要在浏览器输入IP地址,就能正常访问了