Giter Club home page Giter Club logo

Comments (7)

Bouke avatar Bouke commented on July 21, 2024

Thanks for the translation, it's great to see everyone's involvement from all over the world!

Regarding implementing a new gateway, have a look at the Twilio gateway, and most notably the interface of the gateway class. If you implement a class with the signature shown below, it's enough. Depending on how phone calls are made, you might need to wire some Django views and urls, as is also shown in the Twilio gateway. Finally, you can also have a look at the "fake gateway", which also shows an implementation of the gateway.

class MyGateway(object):
    def make_call(self, device, token):
        raise NotImplementedError()

    def send_sms(self, device, token):
        raise NotImplementedError()

Sadly I'm not traveling to DjangoCon this round, but would love to visit some year in the future. Have a great week!

from django-two-factor-auth.

Bouke avatar Bouke commented on July 21, 2024

If you have any additional questions, please let me know :).

from django-two-factor-auth.

Bashar avatar Bashar commented on July 21, 2024

Hello again @Bouke :)
I've worked on fake.py and sms is now getting sent and working perfectly.

How do i show you my work? paste here or add you to the fork i did to review before submitting pull request?

I based fake.py on another django app which made it work within minutes!

from django-two-factor-auth.

Bashar avatar Bashar commented on July 21, 2024

and I believe i need help in testing what i did?

from django-two-factor-auth.

Bouke avatar Bouke commented on July 21, 2024

For reviewing your code, you could post it here. I'm not very inclined to add extra gateways, as the burden of supporting it and updating it with API changes would also be mine.

from django-two-factor-auth.

Bashar avatar Bashar commented on July 21, 2024

@Bouke actually its a complete ready app so maintaining it is not going to be handled by django-two-factor-auth but django-nexmo

What I did is installed django-nexmo and updated fake.py to the following:

from nexmo import send_message

class Fake(object):
    @staticmethod
    def send_sms(device, token):
        send_message(device.number,'Your token is: %s' % token)

and worked, my next addition is to have django-nexmo supports voice then would add another staticmedhod for make_call to call since Nexmo supports voice too.

from django-two-factor-auth.

Bouke avatar Bouke commented on July 21, 2024

That looks like a nice and simple solution. However you could consider renaming the class to NexmoGateway instead of Fake, but looks great otherwise.

from django-two-factor-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.