WebFaction
Community site: login faq

I am trying to reset a django app with the usual command python2.6 manage.py reset *app_name*, and I get the following error:

Error: Error: *app_name* couldn't be reset. Possible reasons:
  * The database isn't running or isn't configured correctly.
  * At least one of the database tables doesn't exist.
  * The SQL was invalid.
Hint: Look at the output of 'django-admin.py sqlreset *app_name*'. That's the SQL this command wasn't able to run.
The full error: canceling statement due to statement timeout

Also if I try a full reset of the db using manage.py flush, I get the same "db not configured correctly" error. Any suggestions? I never have had this problem with the same app running local using sqlite3.

PS Not sure if this is connected to the problem or what it even means really, but for some of my table fields' id columns, the sqlall returns "DEFERRABLE INITIALLY DEFERRED".

asked 07 Dec '10, 05:06

H_n8
1136
accept rate: 0%

Did you try the sqlreset command as it says in the error message? If so, what was the output?

(07 Dec '10, 05:14) David L ♦♦

It says that my DJANGO_SETTINGS_MODULE is not defined. I found a solution on a forum for this error by adding:

import os

os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'

..to the init.py function of the app, which I tried but didnt seem to have any effect.

(07 Dec '10, 06:34) H_n8
1

Ah! Running from the command line won't set DJANGO_SETTINGS_MODULE and neither will adding it to your app.

You should be able to do this:

DJANGO_SETTINGS_MODULE='myapp.settings' python2.6 manage.py reset app_name
(07 Dec '10, 06:43) David L ♦♦

Excellent, worked like a charm thanks!!

(07 Dec '10, 06:52) H_n8

the reset command is deprecated. if you are using south, I wrote a management command for what you need: http://balzerg.blogspot.co.il/2012/09/django-app-reset-with-south.html

permanent link

answered 27 Sep '12, 12:48

Idan Zalzberg
1
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×109

question asked: 07 Dec '10, 05:06

question was seen: 5,067 times

last updated: 27 Sep '12, 12:48

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM