django - How to clear a database on OpenShift -


i'm using django sqlite3 on openshift , need reset database (clear tables). how do that?

you can run flush command clear data tables.

python manage.py flush 

note command irreversibly destroy data in database.

to run manage.py command in openshift,

  • make sure have ssh access repository.

step 1

method 1: redhat client

the easiest way install rhc,

you can install rhc following official guide

after installation , configuration, run

rhc ssh <app name> 

if gone correct, logs app repo.

(or) method 2: without redhat client

add public key on console settings

copy ssh command remote access section on console.

login repo ssh openshift

the command looks like,

ssh <some random string >@your-domain.rhcloud.com 

paste command terminal window , press enter

step 2

now navigate source directory, run

cd app-root/repo/ 

step 3

now @ repo, can run manage.py task

python manage.py makemigrations 

or

python3 manage.py migrate 

this how run manage.py command in repo.

make sure don't share keys.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -