我正在使用Windows操作系统,尝试在名为Apps的公共文件夹中创建一个新的应用程序。 myApp文件夹已经存在于Apps中。我正在从项目根目录运行:
python manage.py startapp myApp Apps\myApp
然后我得到:
Error: 'Apps\\myApp' is not a valid app name. Please use only numbers, letters and underscores.
我不知道为什么要使用双斜杠。我尝试了使用正斜杠来确保:
python manage.py startapp myApp Apps/myApp
我得到了这个:
Error: 'myApp' conflicts with the name of an existing Python module and cannot be used as an app name. Please try another name.
我无法确定这是Windows的问题还是Python的问题。
Apps\__init__.py
文件,同步了数据库,看起来似乎可以工作。但是,我认为这只是一个解决方法而不是解决方案... - Leonardo