0

管理アプリケーション内のブログ エントリ インターフェースに、パッケージ「django-wysiwyg-redactor」を使用しています。管理サイトが読み込まれると、パッケージは、リッチ テキスト エディターをレンダリングするために必要な JavaScript ファイルのいくつかのソース URL を挿入します。

<script type="text/javascript" src="/static/redactor/jquery.min.js"></script>
<script type="text/javascript" src="/static/redactor/jquery-migrate.min.js"></script>
<script type="text/javascript" src="/static/redactor/redactor.min.js"></script>
...and so on...

私が取り組んでいるプロジェクトでは、S3 バケットからファイルを提供するために Boto バックエンドを使用しています。管理ページをレンダリングするために Django によって挿入された URL は正しくレンダリングされ、バケットへの呼び出しを行うための適切な S3 データが追加されます。

<script type="text/javascript" src="https://siteName.s3.amazonaws.com/admin/js/jquery.min.js?Signature=signatureKeyGoesHere&amp;Expires=1454163206&amp;AWSAccessKeyId=AWSAccessKeyIDGoesHere"></script>
<script type="text/javascript" src="https://siteName.s3.amazonaws.com/admin/js/jquery.init.js?Signature=signatureKeyGoesHere&amp;Expires=1454163206&amp;AWSAccessKeyId=AWSAccessKeyIDGoesHere"></script>
<script type="text/javascript" src="https://siteName.s3.amazonaws.com/admin/js/actions.min.js?Signature=signatureKeyGoesHere&amp;Expires=1454163206&amp;AWSAccessKeyId=AWSAccessKeyIDGoesHere"></script>

何らかの理由で、Redactor URL が正しくレンダリングされません。S3 バケットへの呼び出しを行うために必要なデータが追加されます。ローカル開発中 (リモート ファイル バックエンドを使用している間) はすべて正常に動作していました。

また、最初の展開時にすべてが正常に機能していました。

ちょうど今晩、私は開発ブランチ サイトをいじりに行きました - プロダクションと同じコード ベースを持っていました (これは初期展開中に機能していました) - ブログ エントリ フォームがレンダリングされていないことがわかりました。ブラウザ内の JavaScript コンソールを確認したところ、Redactor が使用するファイルに関連するいくつかのリソース ロード エラー メッセージが見つかりました。

Failed to load resource: the server responded with a status of 404 (Not Found) http://siteName.herokuapp.com/static/redactor/jquery.min.js
Failed to load resource: the server responded with a status of 404 (Not Found)    http://siteName.herokuapp.com/static/redactor/css/redactor.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://siteName.herokuapp.com/static/redactor/css/django_admin.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://siteName.herokuapp.com/static/redactor/jquery-migrate.min.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://siteName.herokuapp.com/static/redactor/redactor.min.js

ご覧のとおり、これらの URL は上記のリストと同じ形式ではありません。

必要なすべてのファイルは、実際に S3 バケット内に存在します。

何が起こっているのか理解できないようです。

どんな助けでも大歓迎です。

ありがとう!

4

1 に答える 1