$ php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-intl/intl.so' - dlopen(/usr/local/opt/php56-intl/intl.so, 9): Library not loaded: /usr/local/opt/icu4c/lib/libicuuc.57.dylib
Referenced from: /usr/local/opt/php56-intl/intl.so
Reason: image not found in Unknown on line 0
となったら
/usr/local/opt/icu4c/lib/ を見てみると、icu の 58 はインストールされている。
サーバ上で permission denied になっちゃうことがよくあるので
ubuntu で Selenium を Python から動かそうとして
ubuntu で、
けっこう何回もミスってしまうのでメモ。
{
元々は
AWS ELB -> Apache2 -> mod_wsgi という構成だったが、
AWS ELB -> Apache2 -> uwsgi と、Djangoサーバを uwsgi に変えたら、
ログインフォームを送信する時など、django csrf 認証に失敗するようになった。
DEBUG = True で見てみると
アクセス禁止 (403)
CSRF検証に失敗したため、リクエストは中断されました。
Help
Reason given for failure:
Referer checking failed - https://example.com.com/some-path/ does not match any trusted origins.
In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django's CSRF mechanism has not been used correctly. For POST forms, you need to ensure:
Your browser is accepting cookies.
The view function passes a request to the template's render method.
In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL.
If you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those that accept the POST data.
You're seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed.
You can customize this page using the CSRF_FAILURE_VIEW setting.
ELB で HTTPS を受け、Apache には 80 でリクエスト、uwsgi は HTTP プロトコルをリッスンしている(uwsgiプロトコルではない)
Apacheの設定は
ProxyPass / http://127.0.0.1:8081/
ProxyPassReverse / http://127.0.0.1:8081/
Alias /static/ /var/django/xxxxx/staticfiles/
ProxyPass /static/ !
こんな感じ。
Django のコードを検索してみると
csrf.py
REASON_BAD_REFERER = "Referer checking failed - %s does not match any trusted origins."
こうなっていて、コードを読んで見ると CSRF_TRUSTED_ORIGINS にドメインを入れれば良いっぽい。
CSRF_TRUSTED_ORIGINS = [".example.com"] これで良い
ブログのコメントシステムに Disqus を使ってる場合
まったく定量的な話でないのですが。
Python 3, Django 1.9
mac 10.11 El Capitan で、ダウンロードした Steam を起動しようとしたら「アプリケーション"Steam.app"を開けません。」というエラーが出て起動できなかった場合。
/url-path-before/feature/hoge/ にアクセスした人を、 /url-path-after/feature/hoge/ にリダイレクトしたい。
iOSアプリのビルド時 duplicate symbol _OBJC_CLASS_ が大量に出て焦った時
WebFont を使っていると、フォントが読み込まれないと文字が表示されない FOUT という現象が発生する。
MySQL5.6 の、InnoDB にバイグラムでフルテキストインデックスを作っているのですが、 TWIN という文字を検索しようとした所、
SSL証明書の有効期限を timedelta で取得
下記記事が参考になりました。
Django に標準搭載の django.views.generic.TemplateView。
Bootstrap で、ヒーローエリアの大カルーセルを表示する時、初期位置をランダムで変更する方法です。
apple developer の、テスト用デバイスのUDIDを1年ごとにチェックして、古い端末を消しちゃうやつ
チェックボックスを入れたのを残すのか、消すのかの判断まちがって、全部のUDID消えたわ
5 months, 3 weeks ago
うちの会社 TORICO の 代表が今TV出てます #漫画全巻ドットコム #激レアさんを連れてきた
6 months ago
Proofpoint にブロックされているIPアドレスからでも icloud など Apple メールアドレスにメール送信されてもブロックされてない…?
6 months, 3 weeks ago