This is a common case in django ORM.
from django.db import models
class Author(models.Model):
When applications are running in production, they become black boxes that need to be traced and monitored. One of the simplest, yet main, ways to do so is logging. Logging allows us - at the time we develop our software - to instruct the program to emit information while the system is running that will be useful for us and our sysadmins.
title | subtitle | author | date | source |
---|---|---|---|---|
npm vs Yarn Command Translation Cheat Sheet |
CLI commands comparison |
yarn |
February 15, 2020 |
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build Jekyll site | |
- name: Generate CSV with MD5 Hashes | |
run: | | |
cd build | |
find . -type f -exec md5sum {} + | sed 's/\.\///' | sort -t $'\t' -k 2 > file_hashes.csv | |
working-directory: ${{ github.workspace }} |
name: CI | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: |
# See: https://olegk.dev/go-linters-configuration-the-right-version | |
run: | |
# Depends on your hardware, my laptop can survive 8 threads. | |
concurrency: 8 | |
# I really care about the result, so I'm fine to wait for it. | |
timeout: 30m | |
# Fail if the error was met. |
from django.db import models | |
class Person(models.Model): | |
name = models.CharField(max_length=200) | |
groups = models.ManyToManyField('Group', through='GroupMember', related_name='people') | |
class Meta: | |
ordering = ['name'] | |
def __unicode__(self): |