Skip to content

Commit

Permalink
set graphite admin password script
Browse files Browse the repository at this point in the history
  • Loading branch information
dje committed Dec 3, 2011
1 parent d9ed236 commit dc51133
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions files/default/set_admin_passwd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env python

# cribbed from https://gist.github.com/97863dc8171c7b473c94#file_set_admin_password.py

import os,sys
sys.path.append("/opt/graphite/webapp/graphite")
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from django.contrib.auth.models import User

username = sys.argv[1]
password = sys.argv[2]

try:
u = User.objects.get(username__exact=username)
u.set_password(password)
u.save()
except:
print "%s is not a user" % username

0 comments on commit dc51133

Please sign in to comment.