0

After some testing with Django on PythonAnywhere, I want to get rid of my testing data before I import my actual data to the postgres database. I thought the best way would be to start from scratch and "reset" somehow the database.

Unfortunately there is no button for that on pythonanywhere.com and the documentation does not say anything.

So the question is: how can I "reset" or empty the postgres database on PythonAnywhere?

1 Answer 1

1

With the help of the PythonAnywhere support I found a way which worked for me: I deleted and re-created my database (called my_db_name) as follows:

Open a bash console (not a virtualenv console!) and execute the following commands:

dropdb -h xxx.postgres.eu.pythonanywhere-services.com -p 10077 -U super my_db_name
createdb -h xxx.postgres.eu.pythonanywhere-services.com -p 10077 -U super my_db_name

(replace above xxx with your data)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.