createsuperuser django openshift v3

287 views Asked by At

How can I do some managing works such as createsuperuser ,makemigrations, migrate ect in OpenShift-NextGen for a Django Application ? (Step-by-Step)

In OpenShift-V2, I did the same by login to shell by rhc ssh app_name and run the command python $OPENSHIFT_REPO_DIR/wsgi/myproject/manage.py createsuperuser (Reference)

1

There are 1 answers

0
AudioBubble On

Method 1
Step 1: Login to OpenShift-V3 using oc login
Step 2: Select your project using oc project <project_name>
Step 3: List your all pods using oc get pods
It would be something like this,

NAME                     READY     STATUS      RESTARTS   AGE
django-example-4-build   0/1       Completed   0          1h
django-example-5-build   0/1       Completed   0          1h
django-example-6-i0omn   1/1       Running     0          1h

Step 4: Find out the name which is at Running state.
Step 5: Run the command, oc rsh <Name_of_the_pod_at_running_state>
In my case it is, oc rsh django-example-6-i0omn
Step 6: Then, run python manage.py createsuperuser to create super user


Method 2

Step 1:Login to your OpenShift-v3 using Web-Console
Step 2:Go to Dashboard
Step 3:Select pods by Application -> Pods
Step 4:Choose the pod which is at running state
Step 5:Choose Terminal tab
Step 6:Then, run python manage.py createsuperuser to create super user

Hope, It will work for you :)