Django sso server package for Kodland
Project description
Для работы необходим RabbitMQ.
Consumer запускается так:
python3 manage.py rabbit_consumer
После установки
Добавить приложения в список INSTALLED_APPS в settings.py
INSTALLED_APPS = [
...
'rest_framework',
'rest_framework_swagger',
'sso_server'
]
Добавить в settings.py переменную, содержащую корневой домен для установки cookies
DOMAIN = '.local'
Добавить в settings.py следующую строку:
import os
import pika
REST_FRAMEWORK = { 'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema' }
RABBIT_PARAMS = {
'host': os.environ.get('RABBIT_HOST', 'localhost'),
'port': os.environ.get('RABBIT_PORT', 5672),
'credentials': pika.PlainCredentials(os.environ.get('RABBIT_USER', 'guest'), os.environ.get('RABBIT_PASSWORD', 'guest'))
}
Выполнить миграции:
python manage.py migrate
Добавить в settings.py в middleware:
'sso_server.middleware.UserCookieMiddleWare'
Добавить в urls.py следующий маршрут:
urlpatterns = [
...
path('sso/', include('sso_server.urls'))
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file kodland_sso_server-0.3.0.tar.gz
.
File metadata
- Download URL: kodland_sso_server-0.3.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e95a3ca7a06313e4bced259b3ed711b4013c94df0fd8ec0fe2745da6df93de42 |
|
MD5 | 23b5103bfffe9e56511d6c5b8cd3a210 |
|
BLAKE2b-256 | e43dfa362720c44defaf5e65ae843192c38a2aebb08f1761f1ffe2660d37746b |
File details
Details for the file kodland_sso_server-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: kodland_sso_server-0.3.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c02347b9a590f671689ba649ae508aef3f34165a67724a59ce4f565f03593fa |
|
MD5 | a4dac7ef4d64a4cd98208986d4c67ce7 |
|
BLAKE2b-256 | 63a41f9f0da77c4bfa0ce7f5138f2ab3347e2de0b9efd6caced21912bc366cc0 |