Skip to content

Commit 3abd1b2

Browse files
author
Carlos Villavicencio
committed
Code Exchange upgrade
1 parent 2a98102 commit 3abd1b2

8 files changed

+167
-43
lines changed

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Environment variables
22
# Copy to a file named .env and add your values
3+
FLASK_APP=verify
4+
FLASK_ENV=development
35

46
# Secret key
57
SECRET_KEY=replace-me-in-production

.github/workflows/flask.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Flask
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
max-parallel: 4
15+
matrix:
16+
python-version: [3.6, 3.7, 3.8]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v1
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install Dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
- name: Set up project
29+
run: |
30+
flask init-db
31+
env:
32+
FLASK_APP: verify
33+
FLASK_ENV: development
34+
SECRET_KEY: some_secret
35+
TWILIO_ACCOUNT_SID: sid
36+
TWILIO_AUTH_TOKEN: token
37+
VERIFICATION_SID: vesid

.mergify.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
pull_request_rules:
2+
- name: automatic merge for Dependabot pull requests
3+
conditions:
4+
- author=dependabot-preview[bot]
5+
- status-success=build (macos-latest, 10)
6+
- status-success=build (macos-latest, 12)
7+
- status-success=build (windows-latest, 10)
8+
- status-success=build (windows-latest, 12)
9+
- status-success=build (ubuntu-latest, 10)
10+
- status-success=build (ubuntu-latest, 12)
11+
actions:
12+
merge:
13+
method: squash

CODE_OF_CONDUCT.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org

CONTRIBUTING.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Contributing to Twilio
2+
3+
All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.

LICENSE

+17-27
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
1-
Copyright © 2010 by the Pallets team.
1+
MIT License
22

3-
Some rights reserved.
3+
Copyright (c) 2020 Twilio Labs
44

5-
Redistribution and use in source and binary forms of the software as
6-
well as documentation, with or without modification, are permitted
7-
provided that the following conditions are met:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
811

9-
* Redistributions of source code must retain the above copyright notice,
10-
this list of conditions and the following disclaimer.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1114

12-
* Redistributions in binary form must reproduce the above copyright
13-
notice, this list of conditions and the following disclaimer in the
14-
documentation and/or other materials provided with the distribution.
15-
16-
* Neither the name of the copyright holder nor the names of its
17-
contributors may be used to endorse or promote products derived from
18-
this software without specific prior written permission.
19-
20-
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21-
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
22-
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
23-
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24-
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25-
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26-
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27-
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30-
THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
31-
SUCH DAMAGE.
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,49 @@
1+
<a href="https://www.twilio.com">
2+
<img src="https://static0.twilio.com/marketing/bundles/marketing/img/logos/wordmark-red.svg" alt="Twilio" width="250" />
3+
</a>
4+
15
# Verify Quickstart
26

7+
![](https://github.com/TwilioDevEd/verify-v2-quickstart-python/workflows/Flask/badge.svg)
8+
39
> We are currently in the process of updating this sample template. If you are encountering any issues with the sample, please open an issue at [github.com/twilio-labs/code-exchange/issues](https://github.com/twilio-labs/code-exchange/issues) and we'll try to help you.
410
5-
Simple phone verification with Python, Flask, and Twilio Verify.
11+
Simple phone verification with Python, Flask, and Twilio Verify.
612

7-
Full Quickstart instructions available at https://www.twilio.com/docs/verify/api-beta/quickstarts/python-flask
13+
[Read the full quickstart here](https://www.twilio.com/docs/verify/api-beta/quickstarts/python-flask)!
814

915
## Install
1016

17+
```
1118
python3 -m venv venv
1219
. venv/bin/activate
20+
```
1321

1422
Or on Windows cmd:
1523

24+
```
1625
py -3 -m venv venv
1726
venv\Scripts\activate.bat
27+
```
1828

19-
Install Verify:
29+
Install the dependencies:
2030

31+
```
2132
pip install -r requirements.txt
33+
```
2234

2335
## Run
2436

25-
export FLASK_APP=verify
26-
export FLASK_ENV=development
27-
flask init-db
28-
flask run
29-
30-
Or on Windows cmd:
31-
32-
set FLASK_APP=verify
33-
set FLASK_ENV=development
37+
```
3438
flask init-db
3539
flask run
40+
```
3641

37-
Open http://127.0.0.1:5000 in a browser.
42+
Open [http://127.0.0.1:5000](http://127.0.0.1:5000) in a browser.
3843

3944
## Meta
4045

4146
* No warranty expressed or implied. Software is as is. Diggity.
47+
* The CodeExchange repository can be found [here](https://github.com/twilio-labs/code-exchange/).
4248
* [MIT License](http://www.opensource.org/licenses/mit-license.html)
4349
* Lovingly crafted by Twilio Developer Education.

requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
flask==1.0.2
2-
python-dotenv==0.9.1
3-
twilio==6.27.1
1+
flask==1.1.1
2+
python-dotenv==0.12.0
3+
twilio==6.38.0

0 commit comments

Comments
 (0)