Skip to content
Browse files

set graphite admin password script

  • Loading branch information...
1 parent d9ed236 commit dc5113309785f6514f02bea561a387cceacd54e3 @dje dje committed
Showing with 18 additions and 0 deletions.
  1. +18 −0 files/default/set_admin_passwd.py
View
18 files/default/set_admin_passwd.py
@@ -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.
Something went wrong with that request. Please try again.