ytyng.com

Latest Articles

Page 10
DjangoMySQLPython
2020-10-11 02:52 (6 years ago)
NameError: name '_mysql' is not defined in Python (Django) (Especially During Local Development)

If a Django project that has been working until now fails to start after a long time with the following error: ``` version_info, _mysql.version_info, _mysql.__file__ NameError: name '_mysql' is not defined ```

Javascriptnuxt
2020-10-07 12:49 (6 years ago)
A TypeScript Decorator to Show a Toast When $axios.$get Fails in an Async Method with Nuxt

This article introduces a TypeScript decorator code that displays a toast notification when the $axios.$get method fails within an async method in a Nuxt.js application.

Django
2020-09-13 06:57 (6 years ago)
Starting Django on Docker Alpine Results in django.db.utils.OperationalError: (2000, 'Unknown MySQL error')

When running `python3 ./manage.py runserver 8080`, I encountered the error `django.db.utils.OperationalError: (2000, 'Unknown MySQL error')`. This error occurs when the `OPTIONS` setting includes `'charset': 'utf8mb4'`.

mac
2020-08-21 08:19 (6 years ago)
Logging in via Jump Host with i2cssh

Configure `~/.i2csshrc` so the `i2cssh` command can fan out SSH connections through a bastion / jump host to multiple servers.

mac
2020-07-24 05:36 (6 years ago)
mkmf.rb can't find header files for ruby (Error while trying to install i2cssh)

Resolve `mkmf.rb can't find header files for ruby` when installing the `i2cssh` Ruby gem — install `ruby-dev` (or `ruby-headers`) and retry the gem install.

AWSPythonkubernetes
2020-07-13 11:39 (6 years ago)
Python Script for Storing ECR Login Information as Kubernetes Secrets

Introduction to Python Script Code

GitShellscript(Bash/Zsh)
2020-07-13 07:07 (6 years ago)
Git Checkout Using Partial Branch Name Matching

Pitfalls when running a local server with `php -S` on macOS Big Sur or later, and how to terminate SSL with a separate proxy.

LinuxMySQLUbuntu
2020-06-01 01:18 (6 years ago)
Upgrading to Ubuntu 20 Results in ERROR 2026 (HY000): SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol

I upgraded Ubuntu to version 20.04, and when I tried to connect to MySQL, I encountered the following error: ERROR 2026 (HY000): SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol. As a result, I was unable to connect to MySQL.

Django
2020-05-19 06:34 (6 years ago)
Manually Operating Viewsets in Django Rest Framework to Retrieve Serialized Data

Introduction to Python Code for APIView.

Django
2020-05-18 02:16 (6 years ago)
Fix: MySQL error 1467 'Failed to read auto-increment value from storage engine' — AutoIncrement exhausted in Django

MySQL raises error 1467 'Failed to read auto-increment value from storage engine' when a Django int id hits the AUTO_INCREMENT limit 2147483647. Check information_schema, then migrate the primary key to BigAutoField.

nginx
2020-05-06 14:24 (6 years ago)
Outputting Request Headers in Nginx Logs

Output every request header and response info to the nginx access log via a custom `log_format`, with an Ansible playbook to deploy it.

Flutter
2020-02-12 06:35 (6 years ago)
The App Crashes When Using FlutterDownloader.initialize() with flutter_downloader

While using flutter_downloader 1.3.4 with Flutter, the app crashes at await FlutterDownloader.initialize() when debugging from Android Studio. However, the app does not crash when launched from XCode. If anyone knows how to fix this, please let me know.

kubernetes
2020-01-14 06:34 (6 years ago)
HTTP 413 Error When Uploading Files in Kubernetes Environment

Open a specific 1Password item directly from the Mac terminal with `open 'onepassword://...'` — also how to get the item URL.

nuxt
2020-01-02 11:53 (6 years ago)
When Using Nuxt Axios Proxy Mode, Axios Config's httpsAgent Injection Cannot Handle Self-Signed Certificates on the Proxy Server

Fix `ssl.SSLCertVerificationError` in Django `send_mail` — check `EMAIL_USE_SSL` / `EMAIL_USE_TLS` and certificate trust chain.

Django
2019-12-30 12:27 (6 years ago)
Fix: cross-origin session cookie not sent after upgrading to Django 3 (SESSION_COOKIE_SAMESITE)

Django 3 defaults SESSION_COOKIE_SAMESITE to 'Lax', so session cookies stop being sent on cross-origin requests. Set it to None and log in again to restore them, at the cost of weaker security.

Django
2019-12-25 06:14 (6 years ago)
Upgrading to Django 3: from_db_value() missing 1 required positional argument: 'context' Error Occurs

Fix `from_db_value() missing 1 required positional argument: 'context'` on custom Django fields after upgrading to Django 3 — adapt to the removed `context` arg.

Android
2019-09-13 10:45 (7 years ago)
When Running `flutter build apk`, Gradle Task `assembleRelease` Failed with Exit Code 1 and APK is Not Created

Change a DRF (Django REST framework) serializer's datetime output format away from ISO — use `format=` or override `to_representation`.

Android
2019-09-09 05:57 (7 years ago)
What to Do When Android Emulator's Network Connection Stops Working

1. Terminate the emulator 2. From AVD Manager, select Cold boot now

DockerLinux
2019-06-30 23:09 (7 years ago)
Docker on Ubuntu Won't Start

The `/usr/bin/dockerd` binary was missing. → Replaced `/usr/bin/docker` with `/usr/bin/docker-ce`. → The service started successfully.

DockerLinux
2019-06-29 05:23 (7 years ago)
Comparison of Docker Base OS Image Sizes 2019-06-29

Basic patterns for combining `async/await` with `Promise`-based functions in JavaScript, and the error-handling pitfalls to watch for.