aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-11-10 00:50:05 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-11-10 00:50:05 +0100
commitccf608a05d617a9fa415570c5fb78dc45b871440 (patch)
tree1f2f26f2d03173353602d2d306d639a9c4a4e8ed /pyaggr3g470r
parentTest if the user is subscribed to a feed. (diff)
downloadnewspipe-ccf608a05d617a9fa415570c5fb78dc45b871440.tar.gz
newspipe-ccf608a05d617a9fa415570c5fb78dc45b871440.tar.bz2
newspipe-ccf608a05d617a9fa415570c5fb78dc45b871440.zip
Added initialization script.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/initialization.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/pyaggr3g470r/initialization.py b/pyaggr3g470r/initialization.py
new file mode 100644
index 00000000..5777ca12
--- /dev/null
+++ b/pyaggr3g470r/initialization.py
@@ -0,0 +1,28 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""initialization.py
+
+Initialization script.
+"""
+
+import sys
+from mongoengine import *
+from werkzeug import generate_password_hash
+
+import models
+
+if __name__ == "__main__":
+ # Point of entry in execution mode
+ database = sys.argv[1]
+ firstname = sys.argv[2]
+ lastname = sys.argv[3]
+ email = sys.argv[4]
+ password = sys.argv[5]
+
+ db = connect(database)
+ db.drop_database(database)
+
+ user = models.User(firstname=firstname, lastname=lastname, \
+ email=email, pwdhash=generate_password_hash(password))
+ user.save() \ No newline at end of file
bgstack15