# Configuration

To use Twilio, we need a `trial number`, `account sid`, and `auth token`.

We can find our account-specific configuration credentials on the Dashboard page of the account console as shown below:

<figure><img src="https://www.section.io/engineering-education/how-to-send-sms-in-django-using-twilio/twilio-console.png" alt=""><figcaption></figcaption></figure>

```
pip install twilio
```

**import**

```
from twilio.rest import Client
```

Next, modify your `Score` class in `models.py`to look like the code below:

```python

#defining a simple class
class Score(models.Model):
    #integer field
    test_result = models.PositiveIntegerField()

    #string representation
    def __str__(self):
        return str(self.test_result)

    #save method
    def save(self, *args, **kwargs):
        #if test_result is less than 80 execute this
        if self.test_result < 80:
            #twilio code
            account_sid = 'YOUR_ACCOUNT_SID'
            auth_token = 'YOUR_AUTH_TOKEN'
            client = Client(account_sid, auth_token)

            message = client.messages.create(
                                        body=f'Hi, your test result is {self.test_result}. Great job',
                                        from_='YOUR_TRIAL_NUMBER',
                                        to='VERIFIED_NUMBER' 
                                    )

            print(message.sid)
        return super().save(*args, **kwargs)


```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://olee-tech.gitbook.io/django/send-sms-in-django/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
