https://supabase.com/ logo
Join Discord
Powered by
# python
  • j

    J0

    10/18/2021, 3:27 AM
    ack, thanks @Deleted User ! 🙂
  • d

    Deleted User

    10/19/2021, 5:45 AM
    @User the response when trying to make a sign up twice with the same user when autoconfirmed is enabled is
    Thanks for registering, now check your email to complete the process.
    instead of
    A user with this email address has already been registered
    . The error message in the test of
    gotrue-js
    is
    A user with this email address has already been registered
    . Someone can explain was is the expected behavior in these cases? Thanks!
  • d

    Deleted User

    10/19/2021, 5:49 AM
    The
    GOTRUE_URL
    is correct, I checked the
    docker-compose.yml
    and the respective container seems to be configured correctly.
  • d

    Deleted User

    10/19/2021, 5:50 AM
    Copy code
    yml
    autoconfirm: # Signup enabled, autoconfirm on
        image: supabase/gotrue:latest
        ports:
          - '9998:9998'
        environment:
          GOTRUE_JWT_SECRET: '37c304f8-51aa-419a-a1af-06154e63707a'
          GOTRUE_JWT_EXP: 3600
          GOTRUE_DB_DRIVER: postgres
          DB_NAMESPACE: auth
          GOTRUE_API_HOST: 0.0.0.0
          PORT: 9998
          GOTRUE_DISABLE_SIGNUP: 'false'
          API_EXTERNAL_URL: http://localhost:9998
          GOTRUE_SITE_URL: http://localhost:9998
          GOTRUE_MAILER_AUTOCONFIRM: 'true'
          GOTRUE_SMS_AUTOCONFIRM: 'true'
          GOTRUE_LOG_LEVEL: DEBUG
          GOTRUE_OPERATOR_TOKEN: super-secret-operator-token
          DATABASE_URL: 'postgres://postgres:postgres@db:5432/postgres?sslmode=disable'
          GOTRUE_EXTERNAL_PHONE_ENABLED: 'true'
          GOTRUE_SMS_AUTOCONFIRM: 'true'
  • d

    Deleted User

    10/19/2021, 5:50 AM
    Copy code
    python
    GOTRUE_URL = "http://localhost:9998"
  • d

    Deleted User

    10/19/2021, 7:43 AM
    The same error is raised in the test of
    gotrue-js
  • d

    Deleted User

    10/19/2021, 8:00 AM
    When this question is clarified this PR (https://github.com/supabase-community/gotrue-py/pull/23) will be ready for review.
  • d

    Deleted User

    10/19/2021, 8:30 AM
    https://github.com/supabase/gotrue/blob/master/api/signup.go#L92 I see that in the implementation of
    supabase/gotrue
    of
    master
    it is in accordance with the results of the tests, so I suppose that the tests have to be updated.
  • d

    Deleted User

    10/19/2021, 8:53 AM
    This is the commit where the change was made in the response https://github.com/supabase/gotrue/commit/7961c799cf379f0bdd2f7c8899f60427cbdccd2e#diff-c8a2b3cbde5284846b2a4231b94df6b607fd908fdbaa9bd
  • d

    Deleted User

    10/19/2021, 9:20 AM
    @User @User this pull request currently is ready for review. Sorry about the size of the pull request 😅 I must improve my ability to create small pull requests. If you have any questions regarding the pull request, do not hesitate to ask me, thanks in advance. https://github.com/supabase-community/gotrue-py/pull/23
  • s

    silentworks

    10/19/2021, 12:12 PM
    @Deleted User you are spamming multiple channels with the same message, can you not do this please, also if you've opened an issue on GitHub there is no need to ping Team on here, someone will see it in time.
  • d

    Deleted User

    10/19/2021, 6:04 PM
    Sorry, the issue had to do with JavaScript too, that's why I mentioned it on the other channel as well. I'll stop reporting things around here, I'll just do it on GitHub. 👍 As a recommendation, it would be good to create channels for
    gotrue
    ,
    postgrest
    , etc. where information can be exchanged regardless of whether it is the server implementation or any of the clients.
  • w

    wiesson

    10/22/2021, 7:37 PM
    Has anyone tried to use supabase storage with django?
  • a

    anand

    10/23/2021, 4:33 AM
    are you having any issues?
  • a

    anand

    10/23/2021, 5:01 AM
    Heyo, I wanna suggest some changes to how we wrap the storage file API PR #61 adds a
    Bucket
    class that is returned as response from methods like `get_bucket`/`list_buckets`. I think it would be a good idea to move the methods of the
    StorageFileAPI
    class over to this
    Bucket
    class, renaming the
    StorageClient.StorageFileAPI
    method (which doesn't conform with PEP8 about method naming conventions) to something like
    StorageClient.from_
    or
    StorageClient.bucket
    , and have that method return an instance of
    Bucket
    . Currently, a user does something like
    Copy code
    py
    client.storage().StorageFileAPI("bucket-id").upload(...)  # or any other file API method
    My suggestion would allow something like:
    Copy code
    py
    bucket = client.storage().get_bucket("bucket-id")
    bucket.upload(...)
    and also
    Copy code
    py
    client.storage().from_("bucket-id").upload(...)
    client.storage().bucket("bucket-id").upload(...)
  • a

    anand

    10/23/2021, 5:02 AM
    I think we should also instantiate the StorageClient as an attribute of
    supabase.Client
    as well 🤔 (meaning methods would be callled like
    client.storage.from_("bucket").upload(...)
  • a

    anand

    10/23/2021, 5:04 AM
    Naming it
    from_
    would also match with the
    from
    method on the js library, and giving it an alias
    bucket
    would be similar to how we alias
    table
    for the table operations
  • w

    wiesson

    10/23/2021, 7:12 AM
    I haven't tried it but I was looking for an entry point to tell django to move files to supabase storage. I'm migrating a legacy app and I'd like to keep the django admin as long as possible. I started here https://docs.djangoproject.com/en/3.2/howto/custom-file-storage/ and I'm currently implementing all required methods.
  • a

    anand

    10/23/2021, 2:50 PM
    Ah sorry, unfamiliar with how django manages storage 😦
  • a

    anand

    10/23/2021, 4:56 PM
    @User actually, I'll take the swag for the PR 😆 Also, what do you think about ☝️ (suggestion re: storage api)?
  • j

    J0

    10/23/2021, 4:57 PM
    sure 🙂 ping you in a bit. Give me a sec, let me update the test instance, will get back to you within 15 mins or so if that's okay
  • j

    J0

    10/23/2021, 5:57 PM
    I think it makes sense to move
    StorageFileAPI
    methods over to the
    Bucket
    class. Naming it
    from_
    in accordance with the js library would be a lot more intuitive and has been something we've wanted to do but never got around to doing it. I think it's a great suggestion, feel free to file an issue or open a PR
  • j

    J0

    10/23/2021, 5:58 PM
    I see... I don't think we have something like that atm but would love to support your efforts. lmk if there's anything we can help you with
  • a

    anand

    10/24/2021, 4:52 AM
    Tests are failing 😦 It's failing on 3.7 because
    Literal
    was added to typing only in 3.8, so we have to import it from typing_extensions if the python version is below 3.8 Tests on 3.8 failing is a little odd, it seems like it is ignoring the
    __future__
    import at the top of the file, so trying to type hint directly with
    dict
    instead of
    typing.Dict
    fails
  • w

    wiesson

    10/24/2021, 6:16 AM
    Once it works, I'll like to submit an PR with an example. It doesn't look too complicated, because I simply have to implement the required methods - I just haven't done any python since years 😅
  • j

    J0

    10/24/2021, 8:57 PM
    oh I see I didn't know about typing extensions but I've patched it
  • j

    J0

    10/24/2021, 8:57 PM
    will adjust to use typing extensions later
  • a

    anand

    10/25/2021, 2:31 PM
    I've made a PR to realtime-py https://github.com/supabase-community/realtime-py/pull/19 to resolve issue supabase-py#71
  • a

    anand

    10/25/2021, 4:50 PM
    Btw I couldn't get realtime-py to work synchronously at all (the methods which are trying to provide a sync interface all call
    asyncio.get_event_loop
    which fails because there's no event loop running)
  • t

    Tito

    10/25/2021, 8:20 PM
    Hi Guys, is upsert working for supabase-py?
1...567...19Latest