Easy way to rename a django project
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 tonewprojectname
manage.py
: Changeos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oldprojectname.settings')
newprojectname/wsgi.py
: Changeos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oldprojectname.settings')
newprojectname/settings.py
: ChangeROOT_URLCONF = 'oldprojectname.urls'
and changeWSGI_APPLICATION = 'oldprojectname.wsgi.application'
newprojectname/urls.py
: Change oldprojectname in a line I had added
I think the best solution here is to simply open your settings.py, urls.py, views.py and any other file that might rely on your project's name and then use the find&replace function in your text editor.
Or, if you haven't done much work yet, start a new project with django-admin.py and copy/paste.