Skip to content

Instantly share code, notes, and snippets.

@Julynx
Julynx / 15_python_tips.md
Last active April 4, 2024 06:20
15 Python Tips To Take Your Code To The Next Level!
@jefftriplett
jefftriplett / chatgpt.py
Last active March 1, 2023 20:14
ChatGPT API using their OpenAI Python library to generate a TailwindCSS template
# 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=[
@mihow
mihow / load_dotenv.sh
Last active May 4, 2024 12:32
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@gcko
gcko / related.py
Last active August 7, 2023 09:32
Django Custom Model ForeignKey Field for Spanning Databases
@taddeimania
taddeimania / chaos.py
Last active January 7, 2022 22:49
Proposal for Maybe type in python (True OR False)
import ast
import random
class MaybeType(type):
def __repr__(cls):
return str(bool(random.randint(0, 1)))
def __nonzero__(cls):
return ast.literal_eval(repr(cls))

Where people struggle learning Django

Over the last 3 years or so I've helped a bunch of companies, small and large, switch to Django. As part of that, I've done a lot of teaching Django (and Python) to people new to the platform (and language). I'd estimate I've trained something around 200-250 people so far. These aren't people new to programming — indeed, almost all of them are were currently employed as software developers — but they were new to Python, or to Django, or to web development, or all three.

In doing so, I've observed some patterns about what works and what doesn't. Many (most) of the failings have been my own pedagogical failings, but as I've honed my coursework and my skill I'm seeing, time and again, certain ways that Django makes itself difficult to certain groups of users.

This document is my attempt at organizing some notes around what ways different groups struggle. It's not particularly actionable — I'm not making any arguments about what Django should or shouldn't do (at least