Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6904545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:04:29+00:00 2026-05-27T08:04:29+00:00

I have changed the name of an app in Django by renaming its folder,

  • 0

I have changed the name of an app in Django by renaming its folder, imports and all its references (templates/indexes). But now I get this error when I try to run python manage.py runserver

Error: Could not import settings 'nameofmynewapp.settings' (Is it on sys.path?): No module named settings

How can I debug and solve this error? Any clues?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:04:29+00:00Added an answer on May 27, 2026 at 8:04 am

    Follow these steps to change an app’s name in Django:

    1. Rename the folder which is in your project root
    2. Change any references to your app in their dependencies, i.e. the app’s views.py, urls.py , manage.py , and settings.py files.
    3. Edit the database table django_content_type with the following command: UPDATE django_content_type SET app_label='<NewAppName>' WHERE app_label='<OldAppName>'
    4. Also, if you have models, you will have to rename the model tables. For postgres, use ALTER TABLE <oldAppName>_modelName RENAME TO <newAppName>_modelName. For mysql too, I think it is the same (as mentioned by @null_radix).
    5. (For Django >= 1.7) Update the django_migrations table to avoid having your previous migrations re-run: UPDATE django_migrations SET app='<NewAppName>' WHERE app='<OldAppName>'. Note: there is some debate (in comments) if this step is required for Django 1.8+; If someone knows for sure please update here.
    6. If your models.py ‘s Meta Class has app_name listed, make sure to rename that too (mentioned by @will).
    7. If you’ve namespaced your static or templates folders inside your app, you’ll also need to rename those. For example, rename old_app/static/old_app to new_app/static/new_app.
    8. For renaming django models, you’ll need to change django_content_type.name entry in DB. For postgreSQL, use UPDATE django_content_type SET name='<newModelName>' where name='<oldModelName>' AND app_label='<OldAppName>'
    9. Update 16Jul2021: Also, the __pycache__/ folder inside the app must be removed, otherwise you get EOFError: marshal data too short when trying to run the server. Mentioned by @Serhii Kushchenko
    10. Update the apps.py file in the app you’re renaming to use the new name. Change the "<old_app_name>Config" class name to "<new_app_name>Config" and within this class change name = ‘<old_app_name>’ to name = ‘<new_app_name>’

    Meta point (If using virtualenv): Worth noting, if you are renaming the directory that contains your virtualenv, there will likely be several files in your env that contain an absolute path and will also need to be updated. If you are getting errors such as ImportError: No module named ... this might be the culprit. (thanks to @danyamachine for providing this).

    Other references: you might also want to refer to the below links for a more complete picture:

    1. Renaming an app with Django and South
    2. How do I migrate a model out of one django app and into a new one?
    3. How to change the name of a Django app?
    4. Backwards migration with Django South
    5. Easiest way to rename a model using Django/South?
    6. Python code (thanks to A.Raouf) to automate the above steps (Untested code. You have been warned!)
    7. Python code (thanks to rafaponieman) to automate the above steps (Untested code. You have been warned!)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have changed a lot of things in a java code but now I
I am using Django's built-in comments app. But I have met one problem. The
I have recently changed domain name for a webapp I run on Google App
I changed the name of my app by editing the @string/app_name string resource. Now
I have a model name called StoreEntry. Django admin changes it to look like
I have a form in my Django app (not in admin) that allows staff
I have searched and figured out how to change the name of my app
I have an App already live on the App Store and I am now
I have a django app running on heroku. I would like to run my
In my django application I have an app called projects and and app called

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.