ytyng.com

Latest Articles

Page 12
Django
2018-02-05 08:02 (8 years ago)
How to Unit Test a Django Model with managed = False

When using Django, setting `Meta: managed = False` in a model can sometimes lead to a `ProgrammingError` during unit tests from other apps when attempting operations such as `create()`. This is a memo on how to address this issue.

2018-01-31 09:27 (8 years ago)
Uploading to the New PyPI pypi.org

Using twine.

mac
2018-01-18 10:40 (8 years ago)
My Mac Freezes When I Connect an HDMI Display

The cause is unknown, but sometimes when I connect a display to my Mac using an HDMI cable, it freezes.

Django
2018-01-11 05:48 (8 years ago)
When Updating Django from 1.6 to 2.0, django.db.utils.InternalError: (1364, "Field 'name' doesn't have a default value") Occurs During Migration

When I tried to migrate a project using Python 2.7 + Django 1.6 to Python 3.5 + Django 2.0 and recreated the migration files, running ./manage.py migrate resulted in the following error:

Linux
2018-01-10 06:40 (8 years ago)
If You Want to Log in Without a Password Using an SSH Key File on a Server, It’s Better Not to Use "Home Directory Encryption"

Depending on the use case, this serves as a personal memo. Ubuntu.

2017-12-21 09:39 (8 years ago)
Connecting with TLS1.2 using Zend_Http_Client in PHP

$client = new Zend_Http_Client($url);$response = $client->request('GET'); I was doing it like this, but due to an issue with the OS, I couldn't connect using TLS 1.2.

2017-12-19 13:10 (8 years ago)
Creating Test-Specific URL Patterns and View Functions in Django

Until Django 1.9, it seems that the urls attribute was written in SimpleTestCase, but when reading the code:

2017-10-19 08:45 (8 years ago)
"pkg_resources.DistributionNotFound: pip==1.5.6 Error with pip"

If you have an old version of pip, running pip install -U pip can break pip.

AWS
2017-09-26 02:28 (8 years ago)
Change AWS EC2 EBS Volume Size Online

AWS EBS page → Right-click on EBS → Modify Volume

HTMLJavascript
2017-09-25 09:42 (8 years ago)
Retrieve the ACE Editor Instance from an HTML Element

I wanted to use the save shortcut key (Ctrl + S / Command + S) while using ACE in Django-ACE.

DjangoLinux
2017-09-11 08:35 (8 years ago)
Install libgconf2 if Python Selenium ChromeDriver Fails to Start with Error 127

On Ubuntu 14.04, Selenium ChromeDriver exits with status 127 when `libgconf-2.so.4` is missing. Run `sudo apt install libgconf2-4` to fix it.

DjangoPython
2017-09-01 02:10 (8 years ago)
What to Do When You Encounter AuthAlreadyAssociated with Django Social Auth

I'm writing this down because I always get flustered.

nginx
2017-08-14 00:55 (8 years ago)
Add CORS Headers to Font File Responses in Nginx

Here's something often used in Django.

BootstrapJavascript
2017-08-01 10:40 (8 years ago)
Displaying AJAX-Fetched Content in a Bootbox Dialog

Here is a code example demonstrating how to display content retrieved via AJAX in a dialog using Bootbox.

css
2017-06-18 14:07 (9 years ago)
Fixing Aspect Ratio with CSS (LESS)

It's a common one, but I always forget it.

Linux
2017-06-06 10:56 (9 years ago)
Install ChromeDriver on Ubuntu

This is a guide on how to install ChromeDriver on Ubuntu.

Javascript
2017-05-21 13:33 (9 years ago)
Specifying Tooltip Position with JQuery ValidationEngine

```html

2017-05-21 07:02 (9 years ago)
Creating Directories in the uWSGI Configuration File

Replace deprecated `from django.utils.translation import ugettext` (broken on Django 4) with `gettext` to fix the import error.

Django
2017-05-09 08:49 (9 years ago)
Base View Class for Downloading CSV in SJIS with Django

Base View Class for Downloading SJIS CSV in Django

PHP
2017-04-28 03:25 (9 years ago)
Remote Debugging via Reverse Port Forwarding with PHP SSH

When remote debugging PHP on a production server or another distant environment: