net::ERR_ABORTEDとエラーが出ました。Djangoでアプリケーションを作っています。
アプリケーションは以下のような階層になっています。
├── top │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── __init__.py │ │ └── __pycache__ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── static │ │ └── app │ │ └── top.css │ ├── templates │ │ └── top.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── db.sqlite3 ├── test-folder │ └── test.js ├── app │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── manage.py
今top.htmlで
<html lang="ja"> <head> <meta charset="UTF-8"> <title>Top</title> <script src="././test-folder/test.js"></script> </head> ・ ・ ・
とtest-folderの中にあるtest.jsを呼び出すと、
GET http://127.0.0.1:8000/top/test-folder/test.js net::ERR_ABORTED
と読み込みエラーが出ます。
試しに、
<script src="./test-folder/test.js"></script>
や
<script src="./././test-folder/test.js"></script>
と読み込み先を変えたのですが、同様のエラーが出ます。
何が問題で、どう直せばいいのでしょうか?
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。