FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bibtex-browser/scripts/init_db.py at master · frapac/bibtex-browser · GitHub
frapac
/
bibtex-browser
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
3
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
bibtex-browser
/
scripts
/
init_db.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (20 loc) · 544 Bytes
Breadcrumbs
bibtex-browser
/
scripts
/
init_db.py
Copy path
File metadata and controls
31 lines (20 loc) · 544 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
import
os
import
sys
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
".."
)))
from
apps
import
db
from
apps
.
models
.
models
import
*
from
load_bibfile
import
load_file_in_db
def
load_admin
():
# Add admin user
user
=
User
(
name
=
"admin"
,
passwd
=
"yourpasswd"
)
db
.
session
.
add
(
user
)
db
.
session
.
commit
()
def
main
():
db
.
create_all
()
load_admin
()
if
len
(
sys
.
argv
)
==
2
:
load_file_in_db
(
sys
.
argv
[
1
])
if
__name__
==
"__main__"
:
main
()
Back
|
FazBrowse Home
|
New Git URL