Skip to main content

Overview

GSpot Auth is a Django app for GSpot project https://github.com/DJWOMS/GSpot

Installation

$ pip install gspot-django-auth

Quick start

  1. Add "gspot_auth" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
    ...
    'gspot_django_auth',
]
  1. Define these parameters in settings.py
  • REDIS_ACCESS_PREFIX
  • REDIS_ACCESS_DB
  • REDIS_HOST
  • REDIS_PORT
  • REDIS_PASSWORD
  • GET_TOKEN_FROM - 'headers' or 'cookies'
  1. Add CustomJWTAuthentication to DEFAULT_AUTHENTICATION_CLASSES in settings.py
REST_FRAMEWORK = {
    ...
    'DEFAULT_AUTHENTICATION_CLASSES': [
        'gspot_django_auth.authentication.CustomJWTAuthentication'
    ],
}
  1. Load tokens to redis for development
$ python manage.py load_test_tokens

Token and data for Admin

admin_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiaWF0IjoxNjg5NjgyNzczLCJleHAiOjE2ODk2ODMwNzN9.Q-_Lz4GmjTJuprbsKv4jSW3OGZ-ixxCmRGHva8KLkoM"
admin_data = {
    "username": "admin_username",
    "first_name": "admin_first_name",
    "last_name": "admin_last_name",
    "user_id": "7fff5488-a091-44a1-9a4e-cb9f535a7f34",
    "role": "administrator",
    "avatar": "",
    "permissions": [],
    "email": "admin@gmail.com",
    "phone": "88005553535",
    "country": None,
    "created_at": "2023-07-08 21:04:32.226941+00:00",
    "update_at": "2023-07-08 21:04:32.226953+00:00",
    "is_superuser": False,
    "is_banned": False,
    "is_active": True,
    "groups": [],
    "user_permissions": [],
    "developer_groups": [],
    "developer_permissions": []
}

Token and data for SuperUser Admin

admin_superuser_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiaWF0IjoxNjg5NjgyNzcwLCJleHAiOjE2ODk2ODMwODB9.47CONTJjEqoL6JMjyERM5WJYYA5jna55w6CXaoW55PI"
admin_superuser_token = {
    "username": "admin_username",
    "first_name": "admin_first_name",
    "last_name": "admin_last_name",
    "user_id": "7fff5488-a091-44a1-9a4e-cb9f535a7f34",
    "role": "administrator",
    "avatar": "",
    "permissions": [],
    "email": "admin@gmail.com",
    "phone": "88005553535",
    "country": None,
    "created_at": "2023-07-08 21:04:32.226941+00:00",
    "update_at": "2023-07-08 21:04:32.226953+00:00",
    "is_superuser": True,
    "is_banned": False,
    "is_active": True,
    "groups": [],
    "user_permissions": [],
    "developer_groups": [],
    "developer_permissions": []
}

Token and data for Developer

dev_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiaWF0IjoxNjg5NjgzMTI3LCJleHAiOjE2ODk2ODM0Mjd9.h-pqm9eDO9yOs2FrHIW0nPTwT45kT9rHvieYfvJoUXc"
dev_data = {
    "username": "dev_username",
    "first_name": "dev_first_name",
    "last_name": "dev_last_name",
    "user_id": "9c490b97-4423-4fae-8beb-7e0a128f469f",
    "role": "developer",
    "avatar": "",
    "permissions": [],
    "email": "developer@gmail.com",
    "phone": "88005553535",
    "country": {
        "id": 1,
        "name": "Russia"
    },
    "created_at": "2023-07-18 12:15:50.005936+00:00",
    "update_at": "2023-07-18 12:18:50.540200+00:00",
    "is_active": True,
    "is_banned": False,
    "is_superuser": False,
    "groups": [],
    "user_permissions": [],
    "company": {}
}

Token and data for Company Owner

owner_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiaWF0IjoxNjg5NjgzNTQwLCJleHAiOjE2ODk2ODM4NDB9.o8QLclmTxUOEUiVlvHyEghdjtKRbEYn9eAk_jXCswhQ"
owner_data = {
    "username": "owner_username",
    "first_name": "owner_first_name",
    "last_name": "owner_last_name",
    "user_id": "36041f78-e46a-4c62-81a6-c0c9e7cce5a4",
    "role": "developer",
    "avatar": "",
    "permissions": [],
    "email": "company_owner@gmail.com",
    "phone": "88005553535",
    "country": {
        "id": 1,
        "name": "Russia"
    },
    "created_at": "2023-07-18 12:30:50.413011+00:00",
    "update_at": "2023-07-18 12:32:17.309680+00:00",
    "is_active": True,
    "is_superuser": False,
    "is_banned": False,
    "groups": [],
    "user_permissions": [],
    "company": {
        "created_by": "9c490b97-4423-4fae-8beb-7e0a128f469f",
        "title": "Test Company",
        "description": "Test Company Description",
        "email": "test_company@gmail.com",
        "image": "",
        "is_confirmed": True,
        "is_active": True,
        "is_banned": False,
        "contact": []
    }
}

Token and data for Customer

customer_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiaWF0IjoxNjg5Njg0MDMxLCJleHAiOjE2ODk2ODQzMzF9.07kcY4cQWmw20PMf9NWrvxR7NbuVIoCmlN2Gi-hIi7A"
customer_data = {
    "username": "customer_username",
    "first_name": "customer_first_name",
    "last_name": "customer_last_name",
    "user_id": "fd3e3c48-96fc-4863-9aa8-68d1e43a6750",
    "role": "customer",
    "avatar": "",
    "permissions": [],
    "age": 18,
    "email": "customer@gmail.com",
    "phone": "88005553535",
    "created_at": "2023-07-18 12:36:56.545791+00:00",
    "update_at": "2023-07-18 12:37:13.736690+00:00",
    "friends": ["dcada25f-b104-4b12-8ac1-9364252b9e7d"],
    "birthday": "2023-07-18",
    "is_banned": False,
    "is_active": True,
    "country": {
        "id": 1,
        "name": "Russia"
    }
}

Release files for gspot-django-auth 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gspot-django-auth 0.1.5
File Size Uploaded
gspot_django_auth-0.1.5.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gspot-django-auth 0.1.5
File Interpreter ABI Platform
gspot_django_auth-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 20.9 kB

Release files / gspot_django_auth-0.1.5.tar.gz

Download URL gspot_django_auth-0.1.5.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5ddefaf5180fa36a1a3e6be6f6a707f510e8d4ddf2f7f5906d9c980a2b78299a
BLAKE2b-256 checksum
How to use checksums
b5912481bb41e42214b63b7c178a16e4d1eadfbcb296d9fab2642cf2b9b077ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release files / gspot_django_auth-0.1.5-py3-none-any.whl

Download URL gspot_django_auth-0.1.5-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75eca75674bf587bcfbd72f7b87b087aa9f4795895db9c830257c2790caaa755
BLAKE2b-256 checksum
How to use checksums
5abd6473389632b76a0c92d9b39c216a1878b9b091e60d12b3a9e7f7ef5448b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page