How to add site models to Cookiecutter Django project

277 Views Asked by At

I have a Cookiecutter Django project in which I'd like to add a "SiteSettings" model to control constants. My first instinct was to run manage.py startapp site. However I received the following message:

CommandError: 'site' conflicts with the name of an existing Python module and cannot be used as an app name. Please try another name.

Upon closer inspection, it appears that Cookiecutter already created a sites module within contrib, but with no models.py file. So I decided to make a models.py with the SiteSettings model in this directory.

enter image description here

However when I run makemigrations it says: No changes detected in app 'sites'

How can I add my desired model to this module and get migrations working for this module?

1

There are 1 best solutions below

1
On

You will run into countless problems if you follow this path. Just use another name and do manage.py startapp newname.