Django: How to completely uninstall a Django app? -


what procedure uninstalling django app, complete database removal?

  1. django has handy management command give necessary sql drop tables app. see sqlclear docs more information. basically, running ./manage.py sqlclear my_app_name you'll sql statements should executed rid of traces of app in db. still need copy , paste (or pipe) statements sql client.

  2. to remove app project, need remove installed_apps in project's settings.py. django no longer load app.

  3. if no longer want app's files hanging around, delete app directory project directory or other location on pythonpath resides.

  4. (optional) if app stored media files, cache files, or other temporary files somewhere, may want delete well. wary of lingering session data might leftover app.

  5. (optional) remove stale content types.

like so.

from django.contrib.contenttypes.models import contenttype c in contenttype.objects.all():     if not c.model_class():         print "deleting %s"%c         c.delete() 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -