ytyng.com

Latest Articles

Page 11
Django
2019-06-22 13:07 (7 years ago)
When Django's DecimalField quantize Fails on Alpine Linux

Stop PyCharm / JetBrains project view from opening files on a single click — how to require a double click instead.

mac
2019-06-18 23:59 (7 years ago)
If the "Jump to Source" Shortcut (Command + Click) Stops Working in Jetbrains Editor

If `Command + Click` (Jump to Source) stops working in a JetBrains IDE (PyCharm / IntelliJ), here are the settings to re-check.

kubernetes
2019-05-18 16:14 (7 years ago)
When Pods Fail to Start with ContainerCreating (FailedMount) in Kubernetes

When a Kubernetes Pod is stuck in `ContainerCreating` with `FailedMount` events, check Secret / ConfigMap / PVC references and RBAC — common root causes.

Django
2019-03-25 23:57 (7 years ago)
How to Use freezegun in Django Tests to Set the Date One Day Ahead with USE_TZ=True

Use freezegun in Django tests so that "one day later" or relative offsets work correctly under `USE_TZ=True`.

DjangoPHP
2019-03-14 15:19 (7 years ago)
Using Vue.js Webpack Dev Server Proxy for Social Provider Authentication with Django + Python Social Auth

When developing with Vue, if you are running a webpack dev server and using Django for the API backend along with Django's authentication using Python social auth and an external Auth provider, you may encounter an issue.

css
2019-02-10 06:23 (7 years ago)
Displaying Differences in CSS Styles: A Memo

Auto-redirect logged-in users to an internal app from a Django Allauth SocialAccount flow — customize `LOGIN_REDIRECT_URL`.

Javascript
2019-02-04 04:15 (7 years ago)
Differences in Behavior with and without Await in Functions that Create and Return Promises Inside JS Promises

Here's an English translation of the summary for the Japanese blog article: "Whether it gets resolved or not: A JavaScript code example." If you need further assistance or more details, feel free to ask!

Linux
2018-12-04 12:21 (7 years ago)
Samba AD DC Malfunction -> Stopping slapd Resolved the Issue

System packages (`libmysqlclient-dev` etc.) and env vars needed when Python's MySQLdb fails with `mysql_config not found`.

Python
2018-10-11 12:31 (8 years ago)
Downloading Files with Requests Using Selenium Webdriver Session Cookies

Pass a logged-in session cookie from Selenium WebDriver into `requests` to download files that require a browser-bound session.

LinuxPython
2018-09-27 03:26 (8 years ago)
Rebuild Python3.5 to Fix pip install uwsgi Error on Ubuntu18

Override the URL patterns (`urls.py`) in a Django test to inject a test-only view — use `@override_settings(ROOT_URLCONF=...)`.

Django
2018-09-27 02:37 (8 years ago)
Preventing "table already exists" error when canceling migrations in Django tests

Avoid `table already exists` failures in Django tests when running with `--keepdb` after cancelling migrations — how to forcibly reset the test DB migration state.

Django
2018-09-25 10:10 (8 years ago)
Unit Testing Abstract Models in Django

Django: Best way to unit-test an abstract model - Stack Overflowhttps://stackoverflow.com/questions/4281670/django-best-way-to-unit-test-an-abstract-model

Python
2018-09-21 03:37 (8 years ago)
Replacing Version Numbers with Python re (Regex Replacement Only Within Parentheses)

Use a lambda callback with Python's `re.sub` to replace only a captured group (e.g. a version number) inside a larger pattern.

2018-09-19 06:33 (8 years ago)
Apache2 URL without .html returns the content of the html file

MultiViews is enabled

Linux
2018-09-04 01:53 (8 years ago)
When Starting AD Domain Controller (samba-ad-dc) on Ubuntu 18 with Samba 4.7, It Fails Due to DNS Errors

When you start samba-ad-dc using the command `$ sudo systemctl start samba-ad-dc`, and check either /var/log/samba/log.smbd or /var/log/samba/%m, it appears that port 53 is unavailable.

Linux
2018-09-03 11:11 (8 years ago)
When Apache on Ubuntu 18.04 is Forcefully Terminated

Apache suddenly crashes, and upon checking the logs, I found the following messages: "AH00050: Child 7815 returned a Fatal error... Apache is exiting!" and "AH02818: MPM run failed, exiting."

LinuxUbuntu
2018-09-03 08:36 (8 years ago)
What to Do If Your Update to Ubuntu 18.04 Gets Stuck

When `do-release-upgrade` to Ubuntu 18.04 hangs on libnih1 or upstart packages, here is how to unstick and complete the release upgrade.

LinuxPythonBrowser Automation
2018-08-16 06:07 (8 years ago)
Notes on Installing chromedriver

Strip 4-byte characters (emoji, some kanji) from a Python 3 `requests` response — useful when storing into MySQL utf8 (3-byte) columns.

LinuxPython
2018-08-14 06:45 (8 years ago)
When python3.6 -m venv Errors Occur on Ubuntu

If `python3.6 -m venv venv` fails on Ubuntu, the `python3.6-venv` package is missing — install it via apt to enable virtual environment creation.

Django
2018-07-12 11:24 (8 years ago)
Issues with Redirect URLs Being HTTP Instead of HTTPS in Python Social Auth Django or AllAuth

One-liner to count upgradable packages with `apt list --upgradable`, plus a shell script to surface the number in the MOTD login banner.