Saturday, November 3, 2018

Python Django error

Image result for django python
When I ran python panel/manage.py startapp APPNAME I got the following error.
"Error: 'APPNAME ' conflicts with the name of an existing Python module and cannot be used as an app name. Please try another name."

When you start an application you are creating an app with name APPNAME within the django project. When you create the project itself, a folder would have been created within the project folder with the same name of the project. So you application name is expected to be different than that project name. 



Create a python django project



django-admin.py startproject testproject
 
This will create a project container within which you can have multiple applications.
 
Creating a python django app 
#Get into the project folder 
cd testproject
 
#Creating an application named 'test' 
python manage.py startapp test
 
If the name of the project and the app are same, then the above mentioned error will appear
 
 
 
  


View My Stats

Click here to submit your site to the search engines for free!