WebFaction
Community site: login faq

hi guys, im a little stuck here. tried running python manage.py test some_app here and got stuck @

Destroying old test database 'default'...
Got an error recreating the test database: (1044, "Access denied for user 'foo'@'localhost' to database 'test_foo'"

I might have terminated my tests some time back and left the test database lingering behind. Tried deleting it or search for this database but doesn't seem to work.

please advise.

asked 28 Dec '12, 00:45

carrier24sg
125
accept rate: 0%

edited 28 Dec '12, 00:47


You should be able to see all your databases at our Databases control pane page.

If your database in question is not listed there, try creating it and changing its password to the one in your settings file and run your command to see if it overwrites it, completes or finishes with any other error.

If you are still unable to get it running, feel free to open a support ticket and we can take a closer look at your deployment.

permanent link

answered 28 Dec '12, 06:19

iliasr ♦♦
2.1k14
accept rate: 35%

The problem is that, as a regular user, you don't have permission to create and drop MySQL/PostgreSQL databases via Django. You can only do it via our control panel, or via the control panel API.

There are a few ways you can work around this:

  • Hack Djano's test code to make it use an existing database for tests, without creating it or dropping it.
  • Hack Django's test code to make it use our control panel API to create/drop databases.
  • Use sqlite for your tests.
  • Run your own database server on your WebFaction server and use that with your Django app.
  • Run your own database server on your local system, and test locally.
permanent link

answered 28 Dec '12, 08:44

seanf
12.2k41836
accept rate: 37%

edited 28 Dec '12, 08:46

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
×168
×84

question asked: 28 Dec '12, 00:45

question was seen: 7,755 times

last updated: 28 Dec '12, 08:46

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