This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./manage.py dumpdata --exclude auth.permission --exclude contenttypes > db.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psql -U postgres # "postgres" is the username. You'll be prompted to put in a password like "admin" | |
# You'll be presented with the postgres shell | |
# Create your new user and table | |
CREATE USER <name> WITH PASSWORD '<password>'; # Remove the "<>" symbols | |
CREATE DATABASE <db_name> WITH OWNER <name>; # Remove the "<>" symbols |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numbersJSON = requests.get( | |
# Start with the URL | |
f'https://api.twilio.com/2010-04-01/Accounts/{self._account_sid}/AvailablePhoneNumbers/US/local.json?AreaCode={self.area_code}', | |
# Pass through your credentials like this | |
auth=(self._account_sid, self._auth_token)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Packages: Django-graphene, django | |
from graphene_django.types import DjangoObjectType | |
import graphene | |
class FetchTwilioToken(graphene.Mutation): | |
# Define the arguments that are passed from the client in the mutation | |
class Arguments: | |
identity = graphene.String(required=True) | |
# Define the arguments that might be returned that are not defined | |
# elsewhere. Give them a graphene type |