Easily rename Django project

django

Solution

Renaming the project is actually easier than renaming an app. This question explains how to rename an app.

To rename the project, you need to change the project name wherever it appears. `grep -nir oldname .` can help you find where it appears. In my case, I had to change the following places:

Rename the `oldprojectname` directory to `newprojectname`

`manage.py`: Change `os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oldprojectname.settings')`

`newprojectname/wsgi.py`: Change `os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oldprojectname.settings')`

`newprojectname/settings.py`: Change `ROOT_URLCONF = 'oldprojectname.urls'` and change `WSGI_APPLICATION = 'oldprojectname.wsgi.application'`

`newprojectname/urls.py`: Change oldprojectname in a line I had added

Problem

Is there an easy way to rename a project? I tried to rename the folder, but it didn't work.

Original source

Related problems