Initially, I had a single project in Django now I want to delete the last project and start a fresh new project with the same name as the last one. How should I do so? Can deleting the project folders be sufficient.
To remove the app from your project, all you need to do is remove it from INSTALLED_APPS in your project's settings.py . Django will no longer load the app. If you no longer want the app's files hanging around, delete the app directory from your project directory or other location on your PYTHONPATH where it resides.
I would use 'DELETE FROM %s' % (table_name, ) for that bit, leaving the table empty but intact.
You need to remove or check the following: Remove the app from INSTALLED_APPS . Remove any database tables for the models in that app (see app_name_model_name in your database). Check for any imports in other apps (it could be that they're importing code from that app).
Deleting the project folder is sufficient and make changes in your apache server too[if you have one].
To delete the project you can delete the project folder. But this method is good only if you use SQLite as a database.
If you use any other database like Postgresql with Django, you need to delete the database manually.
If you are on VPS. Simply go to the folder where your project folder resides and put command rm -r projectfoldername
This should delete the folder and it's contents.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With