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
| class Product(models.Model): | |
| # other fields | |
| image = models.FileField(storage = MogileFSStorage(), upload_to = 'product_images') | |
| from django.core.files import File | |
| from django.core.files.temp import NamedTemporaryFile | |
| product = Product() | |
| # set all your variables here | |
| product.save() |
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
| 1) Quit Xcode, Simulator, Instruments, etc. | |
| 2) Run in Terminal: sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService | |
| 3) Run in Terminal: sudo rm -rf ~/Library/*/CoreSimulator | |
| # Was tested on Xcode 10.2 and iOS Simulator 12.2 |
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 json | |
| import logging | |
| import os | |
| from fastapi import FastAPI | |
| from openai import BaseModel | |
| from dotenv import load_dotenv | |
| import os | |
| from typing import Any | |
| import openai |
OlderNewer