11 July 2013
comments powered by Disqus
What to do when you forgot the Django admin password on OpenShift
So, you created a django app on OpenShift, added some changes, push the changes, ... and forgot to note the admin password!What to do next?
It's actually quite easy:- ssh into your application
- start the virtual env:
source $OPENSHIFT_HOMEDIR/python/virtenv/bin/activate
- change to the app dir:
cd $OPENSHIFT_HOMEDIR/app-root/repo/wsgi/openshift/
- open the django shell:
python manage.py shell
- Reset the password:
from django.contrib.auth.models import User u=User.objects.get(username__exact=’admin’) u.set_password(‘whatever’); u.save()