This file contains hidden or 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
| import sys | |
| sys.path.append('CAMINHO_DO_PROJETO') | |
| from NOME_DO_PROJETO import settings | |
| from django.core.management import setup_environ | |
| setup_environ(settings) |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import json | |
| import boto3 | |
| def get_content_file(path): | |
| with open(path, 'rb') as content_file: | |
| data = content_file.read() | |
| return data |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import json | |
| import boto3 | |
| def create_topics(topics): | |
| client = boto3.client('sns') | |
| results = [] |
This file contains hidden or 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
| from .models import YourModel | |
| from .serializers import YourModelSerialize | |
| from .viewsets import CRUDViewSet | |
| # As good practice, create your viewset using the Resource as Prefix: YourModel | |
| class YourModelViewSet(CRUDViewSet): | |
| queryset = Invoice.objects.all() | |
| serializer_class = InvoiceSerializer | |
| lookup_field = 'id' | |
This file contains hidden or 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
| [ | |
| { | |
| "code":12, | |
| "initials":"AC", | |
| "name":"Acre", | |
| "cities":[ | |
| { | |
| "code":1200013, | |
| "name":"ACRELANDIA" | |
| }, |
NewerOlder