How to change a Django Project name

If you are reading this, then, most probably you are already working on your project in Django. Running the command django-admin startproject ProjectName easily starts the project for you. Nothing complicated here. Imagine you have already worked on your project for a while and you want to rename it.

The default project structure is:


The root ProjectName can easily be renamed in your file explorer. Renaming this folder wont affect your project in anyway, except, having to relocate your git repository folder. Renaming the second ProjectName can also be done in your file explorer, but this has to be followed by these steps:

  1. Change
    ROOT_URLCONF = 'NewProjectName.urls'
    WSGI_APPLICATION = 'NewProjectName.wsgi.application'
  2. Change
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "NewProjectName.settings")
  3. Change in the root folder
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "NewProjectName.settings")

Renaming the apps is much more complicated. More on that, later.