How to change project name on Django

 Hello, welcome to the devmaesters website. In this post I am going to show you how you can easily change the name of your Django project without any errors.

So please follow the steps here and if there are any questions then feel free to leave a comment down below. 

Step 1

Go to your project's wsgi.py file and change the project name to the one you want 

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oldname.settings')#change old name here

application = get_wsgi_application()
app = application

to

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'newname.settings')

application = get_wsgi_application()
app = application

Step 2

Go to your project's asgi.py file and change the project name to the one you want

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oldname.settings')#change old name here

application = get_asgi_application()

to

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'newname.settings')

application = get_asgi_application()

Step 3

Go to your settings.py file and edit the project names in the following settings to the new one you want

ROOT_URLCONF = 'oldname.urls' 
WSGI_APPLICATION = 'oldname.wsgi.application' 

to

ROOT_URLCONF = 'newname.urls'
WSGI_APPLICATION = 'newname.wsgi.application'

Step 4

Finally go to your manage.py file and edit the project name

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oldname.settings')

to

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'newname.settings')

 

Author
author-image

Hello, my name is Abubakar Zakari. Am a budding fullstack developer from Nigeria who loves developing softwares and learning new frameworks and langauges.

Comment

Select image


Comments
message profile
Ali
2023-07-15
Thank you so much!
message profile
Admin
2023-07-18
You are welcome @Ali

DEVMAESTERS

Newsletter

Services

Frontend Development |Backend Development |Full Website Development |Bootstrap Website upgrades | Website Debbugging | Website Hosting & deployment

Contact

Interested in hiring me or collaborating with me on a project, click on any of the links below to get my social media handle

Or contact me via Tel: (+234)-806-225-7480 | Email: abubakarzakari1703@gmail.com

Copywright@devmaesters.com
Privacy Policy

By using our website,
you agree that devmaesters can store cookies on your device and disclose information in accordance with our privacy policy.