简体   繁体   English

我正在尝试在python 3.4中的django中创建一个新项目,并收到以下错误

[英]i am trying to create a new project in django in python 3.4 and got the error below

Traceback (most recent call last):
  File "C:\Users\SAGAR\Desktop\venv\lib\site-packages\django\core\management\__init__.py", line 179, in fetch_command
    app_name = commands[subcommand]
KeyError: 'startprojecttest_project'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".\Scripts\django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "C:\Users\SAGAR\Desktop\venv\lib\site-packages\django\core\management\__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "C:\Users\SAGAR\Desktop\venv\lib\site-packages\django\core\management\__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\SAGAR\Desktop\venv\lib\site-packages\django\core\management\__init__.py", line 182, in fetch_command
    settings.INSTALLED_APPS
  File "C:\Users\SAGAR\Desktop\venv\lib\site-packages\django\conf\__init__.py", line 48, in __getattr__
    self._setup(name)
  File "C:\Users\SAGAR\Desktop\venv\lib\site-packages\django\conf\__init__.py", line 42, in _setup
    % (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

I am new at Django just now I installed Django and I am try to create a new_project using command ( (venv) C:\\Users\\SAGAR\\Desktop\\venv>python .\\Scripts\\django-admin.py startproject test_project ) but I got the error like that and I also set the environment variable like -- 我是Django的新手,我刚刚安装了Django,我尝试使用命令( (venv) C:\\Users\\SAGAR\\Desktop\\venv>python .\\Scripts\\django-admin.py startproject test_project(venv) C:\\Users\\SAGAR\\Desktop\\venv>python .\\Scripts\\django-admin.py startproject test_project但是我得到了这样的错误,我也将环境变量设置为-

C:\Python34;C:\Python34\Scripts;C:\Python34\python.exe;C:\Python34\Lib\site-packages\django\bin;

verify if you have added the path variable properly and try with the command 验证是否正确添加了path变量,然后尝试使用命令

    django-admin startproject <project_name>

instead of 代替

   django-admin.py startproject <project_name>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我是使用 mysql 的新手-当我尝试创建表时,出现以下错误 - I am new to using mysql - as i was trying to create a table i got the error below 我是 django 的新手,当我尝试 python manage.py runserver 时......我在下面收到一个错误......我现在必须做什么? 请让我知道 - I am new to django and when I am trying to python manage.py runserver... I was getting an error below... what I have to do now? please let me know 我是 python 的新手,我试图执行读/写操作,但出现此错误 -&gt;FileNotFoundError: [Errno 2] No such file or directory 错误? - I am new in python I was trying to perform read/write operations but I got this error ->FileNotFoundError: [Errno 2] No such file or directory error? 一个 python3 virtualenv 并且正在尝试创建 Django 项目。 我看到“ERROR:root:code for hash md5 was not found”错误中提到的python2.7? - A python3 virtualenv and am trying to create Django project. I see "ERROR:root:code for hash md5 was not found" with python2.7 mentioned in the error? 我正在尝试使用 request 和 bs4 python 模块从网站提取数据。 当我尝试访问此代码时,收到以下错误消息给 json - I am trying extract data from website using request and bs4 python module. when i try to access this code, got below error message to json 我正在尝试为以下练习(在学校中)使用python创建代码,但我被卡住了 - I am trying to create a code for the exercise below in python (for school) and I am stuck 我正在尝试在python 3.4版本中运行此功能 - I am trying to run this function in python 3.4 version 无法在 django 中创建新项目出错。 启动器中的致命错误:无法使用 &#39;&quot;&#39; 创建进程 - unable to create a new project in django got error. Fatal error in launcher: Unable to create process using '"' 我正在尝试导入这个 simpletransformers 得到了错误 - I am trying to import this simpletransformers got the error 我正在尝试使用 Python 进行网络抓取,并提出了如下请求并得到了响应。 但不知道如何处理 - I am trying to do web scraping with Python and have made a request like below and got the response. but don't know how to process it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM