Julian Jordan
Julian Jordan

Reputation: 11

Django polls tutorial - would like to delete and start again

I'm working through the django 1.6 tutorial here:

https://docs.djangoproject.com/en/1.6/intro/tutorial01/

Various things have gone wrong along the line (the database now contains several non-functioning entries) and what I'd really like to do would be to blow away all traces of the "polls" app and start again, without deleting everything else in the database.

My database is postgresql. I've tried running python manage.py sqlclear polls and deleting the polls app files, but when I run through the tutorial again, the same duff information is still in the database from the time before.

Thanks for your help,

Julian

Upvotes: 0

Views: 601

Answers (2)

ancho
ancho

Reputation: 1060

If you are having some problem deleting polls app files with command line you can manually delete your polls app tables in postgresql. Probabily they will be in 'db_name'/public/tables.

Upvotes: 0

Stuart Leigh
Stuart Leigh

Reputation: 856

if you want to clear the polls table from your database then you can use

./manage.py dbshell

to get into a database shell and then execute sql commands

DROP TABLE poll_polls

you could also just enter a db shell from the command line, but the management command handles logging you in and selecting the correct database.

Upvotes: 2

Related Questions