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)
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,
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 userMethod 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
tabStep 6:Then, run
python manage.py createsuperuser
to create super userHope, It will work for you :)