![見出し画像](https://assets.st-note.com/production/uploads/images/67697023/rectangle_large_type_2_f78ae531da5891e8df5637556d336211.png?width=1200)
Photo by
shigekumasaku
【pythonanywhere】デプロイしてみた
WEBアプリを作成してネット上へ公開してみました。
公開するまでの最短手段を残します。
注意点として、セキュリティは踏まえてませんので、その他細かいところは他のページを参考にしてください。
事前準備
・djangoで作成したWEBアプリ
・作成したWEBアプリをGitHubのリポジトリに格納しておく
デプロイまでの流れ
1.PythonAnywhereにユーザ登録
![画像1](https://assets.st-note.com/production/uploads/images/67695094/picture_pc_6d7168e529c4cd503b35032acee7df87.png?width=1200)
![画像2](https://assets.st-note.com/production/uploads/images/67695394/picture_pc_f047386bdd947a4f3afdcd9ab62a6a92.png?width=1200)
![Cursor_と_PythonAnywhere_Sign-up](https://assets.st-note.com/production/uploads/images/67695529/picture_pc_922082fc095c33f63afb64c0ae835c59.png?width=1200)
2.APIキー作成
![画像4](https://assets.st-note.com/production/uploads/images/67695745/picture_pc_d52eebfb81a248ec11ecd2c05e001665.png?width=1200)
3.python anywhereのパッケージをインストール
![画像5](https://assets.st-note.com/production/uploads/images/67695895/picture_pc_be7642bd5b7e6a9f7f7403022796d76e.png?width=1200)
/bashで下記を入力
pip3 install --user pythonanywhere
4.アプリを作業環境にダウンロード
pa_autoconfigure_django.py --python=3.8 https://github.com/{ユーザ名}/{レポジトリ名}.git
あとはユーザやDB準備なりなんなりしてください。
※python manage.py createsuperuserなど
ブラウザ表示してみる!
![画像6](https://assets.st-note.com/production/uploads/images/67696967/picture_pc_1f35554e556af8dc600083a1a055d356.png?width=1200)
これで完了です!簡単ですね!
この記事が気に入ったらサポートをしてみませんか?