进入settings.py 找到
LANGUAGE_CODE = 'en-us' 修改为
LANGUAGE_CODE = 'zh-hans'
然后 pycharm 选择终端 (Terminal) 看当前目录是否为项目地址,不确定的话 可以输入 python man 然后按Tab 键 如果能正常补全,证明路径是对的 ,不能补全 请进入对应的目录
输入 python manage.py runserver 然后回车
如果报错 NameError: name 'os' is not defined
在settings.py 引入 os 模块
import os
解决后 再次回车
(untitled4) F:\py_学习\untitled4>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
You have 18 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.
June 19, 2021 - 12:06:04
Django version 3.2.4, using settings 'untitled4.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
访问 127.0.0.1:8000,出现下面界面 表示 Django 安装成功