pycharm创建django APP项目时出错,请教是什么原因
<p>(venv) D:\untitled>python manage.py startapp index Traceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py", line 18, in main execute_from_command_line(sys.argv) File "D:\untitled\venv\lib\site-packages\django\core\management__init__.py", line 401, in execute_from_command_line utility.execute() File "D:\untitled\venv\lib\site-packages\django\core\management__init__.py", line 345, in execute settings.INSTALLED_APPS File "D:\untitled\venv\lib\site-packages\django\conf__init__.py", line 83, in getattr self._setup(name) File "D:\untitled\venv\lib\site-packages\django\conf__init__.py", line 70, in _setup self._wrapped = Settings(settings_module) File "D:\untitled\venv\lib\site-packages\django\conf__init__.py", line 177, in init mod = importlib.import_module(self.SETTINGS_MODULE) File "D:\python\Python38-32\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "D:\untitled\untitled\settings.py", line 57, in <module> 'DIRS': [os.path.join(BASE_DIR, 'templates')] NameError: name 'os' is not defined</p>
评论 1
import os