Client-Barcode: Added install script to add db entries
This commit is contained in:
parent
bef462a86d
commit
ff7ef54e7e
|
@ -0,0 +1,30 @@
|
|||
import os, sys
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print "Please provide the path to your k4ever webinterface installation"
|
||||
sys.exit(0)
|
||||
|
||||
sys.path.append(sys.argv[1])
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = "settings"
|
||||
os.chdir(sys.argv[1])
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from main.models import Plugin
|
||||
|
||||
USERNAME = "BarcodePlugin2"
|
||||
|
||||
print "Creating user %s..." % USERNAME
|
||||
pw = User.objects.make_random_password(length=20)
|
||||
user = User.objects.create_user(USERNAME, email="", password=pw)
|
||||
|
||||
print "Adding Plugin entry to database..."
|
||||
descr = u"Dieses Plugin l\u00e4uft auf dem Notebook \u00fcber dem K\u00fchlschrank. Die Bedienung erfolgt \u00fcber den Barcode-Scanner, Login ist aber auch \u00fcber das RFID-Leseger\u00e4t m\u00f6glich. Im Feld \"authblob\" muss der Barcode deiner ID-Karte (z.B. dein Studentenausweis oder Mensakarte) eingetragen werden. Es k\u00f6nnen auch mehrere IDs eingetragen werden - eine ID pro Zeile."
|
||||
plugin = Plugin(name="BarcodePlugin", descr=descr, author="Sping", version="1.0",
|
||||
user=user, maxLinesPerAuthblob=3, uniqueAuthblob=True,
|
||||
pluginCanReadAuthblob=False, pluginCanWriteAuthblob=False,
|
||||
userCanReadAuthblob=True, userCanWriteAuthblob=True)
|
||||
plugin.save()
|
||||
|
||||
print "Done"
|
||||
|
||||
|
Loading…
Reference in New Issue