首页 > 解决方案 > Django app conflicts with an existing Python module

问题描述

I have a function that generates a bash script file '.sh' to create a django project and a few apps.

This is the bash file I generate:

#! /bin/bash
cd projectx
source projectxenv/Scripts/activate
python manage.py startapp app1
python manage.py startapp app2
deactivate

When I execute the bash I generated, it gives me the following errors:

django.core.management.base.CommandError: 'app1' conflicts with the name of an existing Python module and cannot be used as an app name. Please try another name.

django.core.management.base.CommandError: 'app2' conflicts with the name of an existing Python module and cannot be used as an app name. Please try another name.

I don't think app1 and app2 are existing modules, and also, I tried running these commands manually and they work, but when I try ./bash.sh, it doesn't work.

标签: djangobash

解决方案


推荐阅读