The serverless framework lacks native support for outputting the endpoint url for a deployment:
serverless info --stage prod --region us-east-2Outputs
DOTENV: Loading environment variables from .env, .env.prod:
version: '3.9'
services:
db:
image: postgres
restart: always
ports:
- 5430:5432
volumes:compose.yaml
version: '3.9'
services:
redis:
image: redis
restart: always
ports:
- 6178:6379Visit https://ollama.com to download for your system.
In the ollama library we see all kinds of available models. We'll use Llama 2 and we have a few options:
Export your Pandas analysis really easily to a PostgresSQL database table with this tutorial. We used Docker Compose to create the postgres database with docker compose up and the related compose.yaml file.
Add requirements.txt from below.
python3 -m pip install -r requirements.txt
Python and many ways to create a Rest API endpoint. This one uses FastAP which is designed to easily create API endpoints for nearly anything.
REST APIs are here so software can talk to other software. REST APIs typically send JSON data types (instead of HTML like websites do for humans)
Create virtual environment, activate it, and install FastAPI and Uvicorn:
The Django Celery Redis github repo shows a full Django project leveraging the results of this blog post tutorial and this sample project.
git clone https://github.com/codingforentrepreneurs/Django-Celery-Redis
cd Django-Celery-Redismacos/linux
python3 -m venv venv
| #!/bin/bash | |
| # Public gist available at: | |
| # https://gist.github.com/codingforentrepreneurs/aef0968829883110e24b107f7278255f | |
| # Check if an argument is provided | |
| if [ "$#" -ne 1 ]; then | |
| echo "Usage: $0 new_hostname" | |
| exit 1 | |
| fi |
Claude says:
This code handles YouTube OAuth2 authentication in a Django application. Here's what's happening: The youtube_connect function initiates the OAuth2 flow. It creates a Flow object with the necessary client configuration, scopes, and redirect URI. It then generates an authorization URL and redirects the user to Google's authentication page. The youtube_callback function handles the callback after user authentication. It retrieves the authorization code from the query parameters, creates another Flow object, and attempts to exchange the code for an access token. If successful, it fetches the user's email and channel ID using the token. The function returns an HTTP response indicating success or failure of the authentication process. Both functions use environment variables for client credentials and implement security measures like HTTPS enforcement and state verification. The code also includes error handling and logging for debugging purposes.
| from typing import Dict, List, Optional | |
| import requests | |
| # pip install python-decouple | |
| from decouple import config | |
| NEON_API_KEY = config("NEON_API_KEY") |