Innopolis Library Management System
Let`s deploy system on your local machine First of all, you should download and unpack repository from here: https://github.com/slavagoreev/librarian/archive/master.zip
- Install Python 3.x: https://www.python.org/ftp/python/3.6.4/python-3.6.4.exe (Make sure you`ve installed pip (including in the Python Installer)) (Make sure that python and pip were added in system variable 'Path')
- Install Node.JS: https://nodejs.org/en/download/ (Make sure that node was added in system variable 'Path')
- Now let`s necessery libraries and frameworks - open console and type:
pip install django djangorestframework django-rest-auth django-allauth django-cors-headers djangorestframework-jwt social-auth-app-django mysqlclient django-rest-swagger
- You need to be sure about where is your .sock of MySQL.
Let's make begining preparation for Data Base (make migrations)
- Go to
librarian/server/
- Open console here and type:
python manage.py makemigrations lmsinno python manage.py migrate
- Now we need to go to to
../librarian/client/
, and do following in console:npm install -g @angular/cli npm install
Let's create local super user
- Go to
project_path/librarian-master/server
- Open console here and type:
python manage.py createsuperuser
- After that you should input username, email and password
Finally, let`s run our server on local machine:
- Go to
project_path/librarian-master/server
- Open console here and type:
python manage.py runserver localhost:80
- Go to localhost/admin and enter username and password from previous step
Moreover you can upload test dataset (about 500 books) (You server should have been runned)
- Go to
project_path/librarian-master/shared
- Open console here and type:
node dataset_loader.js
- It will take about 5 minutes
If you wish to see available books or checkout new book, you may enter the main page:
http://trainno.ru/
Also you can manage your profile.
To check orders and their statuses you may log in by librarian first, then type:
http://trainno.ru:41000/api/orders/
import requests as rq
admin = "JWT " + rq.post("https://trainno.ru/api/users/login/", data={"username": "librarian", "password": "librarian"}).json()['token']
student = "JWT " + rq.post("https://trainno.ru/api/users/login/", data={"username": "john.doe", "password": "FXM-HC3-JKc-WXa"}).json()['token']
faculty = "JWT " + rq.post("https://trainno.ru/api/users/login/", data={"username": "joseph.brown", "password": "joseph.brown"}).json()['token']
request = rq.get("https://trainno.ru/api/documents/", headers={"BEARER": admin}).json()
data = request['data']
status = request['status']
print(data, status)