From 0eb03d6364396fba07fa5446d26424c6ea3f169b Mon Sep 17 00:00:00 2001 From: Jan Broer Date: Tue, 4 Aug 2015 01:46:36 +0200 Subject: [PATCH] Create admin account automatically on first start --- create_admin.py | 29 ----------------------------- wsgi.py | 18 ------------------ 2 files changed, 47 deletions(-) delete mode 100755 create_admin.py delete mode 100644 wsgi.py diff --git a/create_admin.py b/create_admin.py deleted file mode 100755 index 7b41e2ca..00000000 --- a/create_admin.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import sys -base_path = os.path.dirname(os.path.abspath(__file__)) - -# Insert local directories into path -sys.path.append(os.path.join(base_path, 'lib')) - -from cps import ub -from werkzeug.security import generate_password_hash - -nickname = raw_input('Please select a username: ') -password = raw_input("Please select a password: ") - -user = ub.User() -user.nickname = nickname -user.role = 1 -user.password = generate_password_hash(password) - -try: - ub.session.add(user) - ub.session.commit() - print "" - print "Admin User created: %s with password: %s" % (user.nickname, password) - print "Please start the server again: 'python cps.py'" -except: - print "There was an error creating the user: %s" % nickname \ No newline at end of file diff --git a/wsgi.py b/wsgi.py deleted file mode 100644 index 88736408..00000000 --- a/wsgi.py +++ /dev/null @@ -1,18 +0,0 @@ - -import os -import sys -base_path = os.path.dirname(os.path.abspath(__file__)) - -# Insert local directories into path -sys.path.append(os.path.join(base_path, 'lib')) - -from cps import web -from cps import config - -global title_sort - -def title_sort(title): - return title - -if __name__ == "__main__": - web.app.run(host="0.0.0.0",port=config.PORT, debug=True)