Базовое веб-приложения сервиса, к которому подключаются остальные модули.
stucked_s cd91d4d7e1 final renamings and databasefixes | 11 сар өмнө | |
---|---|---|
SharixAdmin | 11 сар өмнө | |
bin | 11 сар өмнө | |
core | 11 сар өмнө | |
.gitattributes | 1 жил өмнө | |
.gitignore | 11 сар өмнө | |
README.md | 1 жил өмнө | |
license-eng.md | 1 жил өмнө | |
license-ru.md | 1 жил өмнө | |
manage.py | 1 жил өмнө | |
requirements.txt | 1 жил өмнө |
The base Django project of a service web application to which other modules are connected.
Download or clone repository.
For the initial configuration, run:
For basic project configuration when deploying, use the core/settings_vars.py. This file is automatically created during the installation script execution, in case this file has not been created yet. It is a copy of core/_settings_vars.py and contains some default settings that allow the project to run locally and is more suitable for development.
Be careful when adding new settings during development and remember to add them to core/_settings_vars.py, as core/settings_vars.py is ignored by Git for security reasons.
Utilities provides important functionality to web-application, so it is important to know and understand how they work. They are stored in core/utils.
That class provides the ability to authenticate an application account through the API and store these authentication tokens.
Modules using the API should log in ShariX system using this class.
# core/settings_vars.py
API_URL = 'http://127.0.0.1:8000'
# <module>/apps.py
from core.utils.AuthAPI import AuthAPI
auth_api = AuthAPI("<module_login>", "<module_password>")
# <module>/<file>.py
import requests
from <module>.apps import auth_api
from core.settings import API_URL
# You can use api.headers to get the corret authorization header in your requests.
requests.get(f"{API_URL}/tickets/api/tickets/", headers=auth_api.headers)
# Or you can get just token.
print(auth_api.token)
To start the web application on Unix, run bin/start.sh.