|Home | Stats | Downloads | Scripts | Wiki|
I’ve always been a big fan of beauty. Sure, you can’t judge a book by its cover but who wants to have sex with a book?-- Stephen Colbert Add quote.
If you see an error like below when you try to create a graphite user you will need to update the graphite database in order for user create to work.
django.db.utils.IntegrityError: NOT NULL constraint failed: auth_user.last_login
Unfortunately sqlite doesn't support the drop constraint syntax so you will need to create a new temporary table, copy over the existing table, and then rename.
CREATE TABLE "auth_user2" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "password" varchar(128) NOT NULL, "last_login" datetime NULL, "is_superuser" bool NOT NULL, "username" varchar(30) NOT NULL UNIQUE, "first_name" varchar(30) NOT NULL, "last_name" varchar(30) NOT NULL, "email" varchar(75) NOT NULL, "is_staff" bool NOT NULL, "is_active" bool NOT NULL, "date_joined" datetime NOT NULL); insert into auth_user2 select * from auth_user ; drop table auth_user ; alter table auth_user2 rename to auth_user ;
Now user creation should work.
root@graphite:/usr/local/lib/python2.7/site-packages/graphite # python manage.py createsuperuser Username (leave blank to use 'root'): wattersm Email address: email@example.com Password: Password (again): Superuser created successfully.