GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — No way to inject custom requests.Session (Django application) · Issue #3 · openapi/openapi-python-sdk

No way to inject custom requests.Session (Django application) #3

New issue
Copy link
New issue
Copy link
Open
Open
No way to inject custom requests.Session (Django application)#3
Copy link
Labels
good first issueGood for newcomersGood for newcomers

Description

@francescobianco
francescobianco
opened on Mar 18, 2026
Issue body actions

No way to inject custom requests.Session (Django application)

Description
In Django projects, it's common to reuse a configured requests.Session, but the SDK does not allow it.

Code snippet

import requests
from openapi_sdk import Client

session = requests.Session()
session.headers.update({"User-Agent": "my-app"})

client = Client("token")
response = client.request("GET", base_url, "/advance", params={})

Issue
Cannot pass custom session for connection pooling and retries.

Activity

  1. francescobianco
    added
    good first issueGood for newcomersGood for newcomers
    on Mar 18, 2026
  2. IlyasFardaouix commented on Mar 19, 2026

    @IlyasFardaouix
    IlyasFardaouix
    on Mar 19, 2026
    More actions

    I think the issue is due to the fact that the Client class in openapi_python_sdk is using the requests library's default session internally, and doesn't provide a way to inject a custom session. This is because the Client class is using the requests.Session object to manage connection pooling and retries. To fix this, you could try creating a custom requests.Session object and passing it to the Client constructor, like so: client = Client(token=token, session=session). However, I'd like to confirm whether the Client class is designed to accept a custom session object. Can you clarify if the Client class is intended to be extensible in this way?

  3. francescobianco commented on Mar 24, 2026

    @francescobianco
    francescobianco
    on Mar 24, 2026
    MemberAuthor
    More actions

    That’s a great observation, thanks @IlyasFardaouix for the detailed breakdown.

    We’re also experimenting with Django on our side, so this kind of feedback is super valuable. The Client isn’t fully designed yet with that level of extensibility in mind, but it’s definitely something we’re considering as we evolve the API.

    Also — since you’re quite active on this — if you’d like to put together a small demo showing how to use the library within a Django setup, we’d be happy to review it and potentially publish it officially on our GitHub channels.

    Let us know if that sounds interesting 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.