Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
0eb03d63
Commit
0eb03d63
authored
Aug 03, 2015
by
Jan Broer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create admin account automatically on first start
parent
a5fe21c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
47 deletions
+0
-47
create_admin.py
create_admin.py
+0
-29
wsgi.py
wsgi.py
+0
-18
No files found.
create_admin.py
deleted
100755 → 0
View file @
a5fe21c9
#!/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
wsgi.py
deleted
100644 → 0
View file @
a5fe21c9
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment