简体   繁体   English

为什么我不能用 django 运行“python manage.py startup APP_NAME”?

[英]Why can't I run "python manage.py startup APP_NAME" with django?

I'm trying to build a Django app, but it doesn't let me startup the app so I can bring it to the development server.我正在尝试构建一个 Django 应用程序,但它不允许我启动该应用程序,因此我可以将它带到开发服务器。 I run python manage.py startup APP_NAME , where I expect the app to run.我运行python manage.py startup APP_NAME ,我希望应用程序在其中运行。 Instead, I get an error saying there is no such file or directory called manage.py.相反,我收到一条错误消息,指出没有名为 manage.py 的文件或目录。 However, I have it open.但是,我打开它。

在此处输入图像描述

Is there a reason for this?是否有一个原因?

Perhaps what you need to ensure on your terminal what is the directory your project is located, by using command prompt "ls" if you are using Linux, or dir on Windows, then you need to activate your virtual environment using source virtual_env_name/bin/activate... then you can execute python manage.py也许你需要在你的终端上确保你的项目所在的目录是什么,如果你使用的是 Linux,或者使用 Windows 上的 dir,则使用命令提示符“ls”,那么你需要使用 source virtual_env_name/bin/ 激活你的虚拟环境activate... 然后你可以执行 python manage.py

You need to run:你需要运行:

python manage.py startapp APP_NAME

to create new app in django在 django 中创建新应用

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

相关问题 如何在一个命令中运行 django 的“python manage.py runserver”、celery 的“celery -A app_name worker -l info”和 redis-server - How to run django's “python manage.py runserver” , celery's “celery -A app_name worker -l info” and redis-server in one command 为什么我在安装 Django 2.2 时无法运行“manage.py runserver”? - Why can't I run “manage.py runserver” when I install Django 2.2? 我无法运行命令:python manage.py runserver - I can't run the command : python manage.py runserver python:创建Django应用时无法打开文件“ manage.py” - python: can't open file 'manage.py' when I create django app 无法从Venv运行Django Manage.py - Can't Run Django Manage.py from Venv Python Django 初学者:打不开manage.py - Python Django Beginner: can't open manage.py 无法运行 python manage.py runserver - Can't run python manage.py runserver 无法运行命令 python3 manage.py runserver - Can't run the command python3 manage.py runserver 为什么我不能对通过自定义manage.py命令创建的Django用户进行身份验证? - Why can't I authenticate a Django user created from a custom manage.py command? 我无法在 django VSC 中使用命令“python manage.py makemigrations” - I can't use the command ' python manage.py makemigrations' in django VSC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM