description | newsletter | number | published | title | url |
---|---|---|---|---|---|
PSF News, building a desktop app with Django + Electron, Meilisearch, bulk admin actions, and more! |
Django News |
160 |
2022-12-30 11:00:00 +0000 |
Happy Django New Year! |
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
# | |
# To run this application, use: | |
# uv run demo-duckdb.py | |
# | |
# /// script | |
# requires-python = ">=3.10" | |
# dependencies = [ | |
# "duckdb", | |
# "rich", | |
# "typer", |
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
default_language_version: | |
python: python3.12 | |
# See https://pre-commit.com for more information | |
# See https://pre-commit.com/hooks.html for more hooks | |
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v3.2.0 | |
hooks: | |
- id: trailing-whitespace |
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
from __future__ import annotations | |
import inspect | |
import djclick as click | |
from django import forms | |
from django.core.management.base import CommandError | |
from django.utils.module_loading import import_string | |
from rich import print |
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
import sys | |
def main(): | |
# Check if a name argument is provided | |
if len(sys.argv) > 1: | |
name = sys.argv[1] | |
else: | |
name = "World" # Default name if no argument is provided | |
print(f"Hello, {name}!") |
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
... | |
- repo: https://github.com/astral-sh/ruff-pre-commit | |
# Ruff version. | |
rev: v0.1.4 | |
hooks: | |
- id: ruff | |
args: [--fix, --exit-non-zero-on-fix] | |
- id: ruff-format | |
... |
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
# https://medium.com/@dave1010/amazingly-alarming-autonomous-ai-agents-62f8a785e4d8 | |
# https://github.com/dave1010/hubcap | |
# to run we need a few libraries: | |
# pip install rich typer | |
import os | |
import subprocess | |
import sys | |
import time |
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
""" | |
---------------------------------------------------------------------------- | |
Author: Jeff Triplett <https://github.com/jefftriplett> | |
Copyright (c) 2023 - Jeff Triplett | |
License: PolyForm Noncommercial License 1.0.0 - https://polyformproject.org/licenses/noncommercial/1.0.0/ | |
---------------------------------------------------------------------------- | |
1. To extract video URLs, titles, and descriptions from a YouTube playlist using Python, you can use the google-api-python-client library. Here's a step-by-step guide on how to do this: | |
Install the google-api-python-client library: |
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
# https://platform.openai.com/docs/guides/chat/chat-vs-completions | |
# | |
# python -m pip install openai | |
# | |
import openai | |
completion = openai.ChatCompletion.create( | |
model="gpt-3.5-turbo", | |
messages=[ |
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
ADMIN_URL=op://django-news/$APP_ENV/ADMIN_URL | |
ALLOWED_HOSTS=op://django-news/$APP_ENV/ALLOWED_HOSTS | |
AWS_ACCESS_KEY_ID=op://django-news/$APP_ENV/AWS_ACCESS_KEY_ID | |
CURATED_API_KEY=op://django-news/$APP_ENV/CURATED_API_KEY | |
CURATED_PUBLICATION_KEY=op://django-news/$APP_ENV/CURATED_PUBLICATION_KEY | |
DATABASE_URL=op://django-news/$APP_ENV/DATABASE_URL | |
DJANGO_DEBUG=op://django-news/$APP_ENV/DJANGO_DEBUG | |
USE_S3=op://django-news/$APP_ENV/USE_S3 |
NewerOlder