2024-05-18 10:18:12 发布
网友
如何在OpenShift NextGen中为Django应用程序执行一些管理工作,如createsuperuser、makemigrations、migrate等?(一步一步)
createsuperuser
makemigrations
migrate
在OpenShift-V2中,我通过rhc ssh app_name登录到shell并运行命令python $OPENSHIFT_REPO_DIR/wsgi/myproject/manage.py createsuperuser(Reference)来完成同样的操作
rhc ssh app_name
$OPENSHIFT_REPO_DIR/wsgi/myproject/manage.py createsuperuser
方法1 步骤1:使用oc login登录到OpenShift-V3 第2步:使用oc project <project_name>选择您的项目 第3步:使用oc get pods列出您的所有pod 会是这样的
oc login
oc project <project_name>
oc get pods
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
第四步:找出运行状态下的名称。 步骤5:运行命令,oc rsh <Name_of_the_pod_at_running_state> 在我的例子中,oc rsh django-example-6-i0omn 步骤6:然后,运行python manage.py createsuperuser创建超级用户
oc rsh <Name_of_the_pod_at_running_state>
oc rsh django-example-6-i0omn
python manage.py createsuperuser
方法2 步骤1:使用Web-Console 第2步:转到Dashboard 第3步:通过Application -> Pods选择pods 第四步:选择运行状态的吊舱 步骤5:选择Terminal选项卡 步骤6:然后,运行python manage.py createsuperuser创建超级用户
Dashboard
Application -> Pods
Terminal
希望对你有用:)
方法1
步骤1:使用
oc login
登录到OpenShift-V3 第2步:使用
oc project <project_name>
选择您的项目 第3步:使用
oc get pods
列出您的所有pod 会是这样的
第四步:找出运行状态下的名称。
步骤5:运行命令,
oc rsh <Name_of_the_pod_at_running_state>
在我的例子中,
oc rsh django-example-6-i0omn
步骤6:然后,运行
python manage.py createsuperuser
创建超级用户方法2
步骤1:使用Web-Console
第2步:转到
Dashboard
第3步:通过
Application -> Pods
选择pods 第四步:选择运行状态的吊舱
步骤5:选择
Terminal
选项卡步骤6:然后,运行
python manage.py createsuperuser
创建超级用户希望对你有用:)
相关问题 更多 >
编程相关推荐