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 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
""" | |
---------------------------------------------------------------------------- | |
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 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
# 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 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
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 |
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 PrefixedMixin: | |
def __init__(self, *args, **kwargs): | |
self._prefix = kwargs.pop("prefix", None) | |
super().__init__(*args, **kwargs) | |
def to_internal_value(self, data): | |
"""Dict of native values <- Dict of primitive datatypes.""" | |
if self._prefix: | |
data = { | |
key.replace(f"{self._prefix}_", ""): value |
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 --list-extensions | |
azemoh.one-monokai | |
bibhasdn.django-html | |
bokuweb.vscode-ripgrep | |
bradlc.vscode-tailwindcss | |
citycide.theme-material-cosmos | |
cschleiden.vscode-github-actions | |
DavidAnson.vscode-markdownlint | |
donjayamanne.githistory | |
dracula-theme.theme-dracula |
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
""" | |
2021-2024 - Jeff Triplett | |
gist: https://gist.github.com/jefftriplett/e7d4eade12e30001065eed2636010772 | |
pip install typer pydantic | |
Inspired/jumpstarted by: https://github.com/kjaymiller/Bunch_Alfred | |
""" |
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
""" | |
Django Management Command to print a "Magic Link" for one-click login | |
by Jeff Triplett <jefftriplett> / https://twitter.com/webology | |
https://gist.github.com/jefftriplett/e87b36d750f94e48080a2be46e71dbe1 | |
Relies on: https://github.com/aaugustin/django-sesame | |
$ pip install django-click | |
$ pip install django-sesame[ua] |
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
.PHONY: static | |
static: | |
@npx -p [email protected] tailwindcss build ./assets/index.css \ | |
--config ./assets/tailwind.config.js \ | |
--output ./frontend/css/output.css |
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
version: "3.3" | |
services: | |
web: | |
container_name: my-fancy-container | |
image: docker.pkg.github.com/jefftriplett/private-repo/private-project:latest | |
labels: | |
- "com.centurylinklabs.watchtower.enable=true" | |
- "com.centurylinklabs.watchtower.lifecycle.post-update='./post-update.sh'" |