I want to create a django project without all the auto generated comments in different files (such as reference links on settings.py and descriptions in urls.py)

I try to remove all those stuff after the project creation with some tools like pyminifier and that works fine, but I find myself doing these tedious comment removing stuff every time I start a new project.

Is there any way that I can get prevent django from generating these data?

Something similar to this:

django-admin startproject <name> --no-comment

2 Answers

ruddra On Best Solutions

There is no way to remove the comments from settings or anywhere else from commandline.

But, in my humble opinion, the quickest or easiest way to fix this is to create a cookie-cutter variant of the Django which you want without any comments and use that for creating new django projects.

For doing it quicker, I would also recommend to look into pydanny/django-cookiecutter or any other django cookie-cutter variants which suits your need most, fork them, remove the comments inside the project and push them in your git repository. Then you can simply use it like this:

pip install cookiecutter
cookiecutter  your-repo-git-url
Baruch G. On

Unfortunately, as far as I know, there is no such way in their documentation. The second option is to create the files manually, I guess it will be more tedious