-
Notifications
You must be signed in to change notification settings - Fork 0
/
help.txt
69 lines (46 loc) · 2.54 KB
/
help.txt
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
1. copy supermath.service into /etc/systemd/system/
2. sudo systemctl start supermath
3. systemctl status supermath.service
● supermath.service - SuperMath Rest Backend API
Loaded: loaded (/etc/systemd/system/supermath.service; disabled; vendor preset: enabled)
Active: active (running) since Mon 2020-02-03 18:33:03 UTC; 3s ago
Main PID: 11753 (python3)
Tasks: 1 (limit: 614)
CGroup: /system.slice/supermath.service
└─11753 /usr/bin/python3 /var/www/supermath_ng_rest_api/supermath.py
4. Server logs are available:
journalctl -u supermath.service -f
Restart:
service supermath stop
service supermath start
service supermath status
fivdrrlgzntzqtiz
mysql -uroot -pasdasd12 supermath_db;
/var/www/supermath/supermath_ng_react/
git pull origin
npm run build
Help links:
# https://flask-sqlalchemy.palletsprojects.com/en/2.x/queries/
Test commands:
curl -i -X POST -H "Content-Type: application/json" -d "{"""user""":"""miguel""","""pswd""":"""python"""}" http://127.0.0.1:5000/api/login
curl -i -X POST -H "Content-Type: application/json" -d "{"""user""":"""yura""","""pswd""":"""qwerty123"""}" http://supermath.xyz:3000/api/login
curl -i -X POST -H "Content-Type: application/json" -d "{"""email""":"""volokitin@bk.ru""","""pswd""":"""python"""}" http://supermath.xyz:3000/api/login
curl -i -X POST -H "Content-Type: application/json" -d "{"""email""":"""yurivolokitin@bk.ru""","""pswd""":"""python"""}" http://supermath.xyz:3000/api/registration
Python example calls:
from datetime import datetime
from sm_app.user import User
user = User(NAME='Dasha', AGE='1983-04-05 16:13:13', EMAIL='vo_da@bk.ru', PSWD='asdas12', CREATION_DATE=datetime.now())
from sm_app import sm_db
sm_db.session.add(user)
sm_db.session.commit()
from sm_app.user import find_user_by_email
u = find_user_by_email('volokitin@bk.ru')
from sm_app.user import User
user = User.query.filter_by(EMAIL='volokitin@bk.ru').first()
curl -i -X POST -H "Content-Type: application/json" -d "{"""email""":"""volokitin@bk.ru""","""pswd""":"""python"""}" http://supermath.xyz:3000/api/login
curl -i -X POST -H "Content-Type: application/json" -d "{"""id""":"""1""","""avatar""":"""test"""}" http://supermath.xyz:3000/api/login
curl -i -X POST -H "Content-Type: application/json" -d "{"""user_id""":"""1""","""operation""":"""results""","""passed""":"""2""","""failed""":"""0"""}" http://supermath.xyz:3000/api/update
{"fail":3,"id":1,"pass":15}
from sm_app import sm_app
from sm_app.tasks import Tasks
task = Tasks.query.order_by(random()).first()