UE4&

Unreal Engine 4 ・プログラミング

Django: Run server automatically by one-click

Run Django server automatically by one-click

Run Django server automatically by one click on Windows 10.

Script

Please wait for few minutes or click "gist" below.

gistb9a7b8f1716732a2832419f4041a8179

How to use Django server

Before you make the bat file, you must install python3 and Django for Windows.

After that follow the document below.

English

Setting up a Django development environment - Learn web development | MDN

In Japanese

Django 開発環境の設定 - ウェブ開発を学ぶ | MDN

Making the bat file

First, get your path to your manage.py file.

My location was

C:\Users\Windows\AppData\Local\Programs\Python

I can use "call" bat file command to run python command on bat file.

I wrote like this.

call python manage.py runserver

Use "pause" in the end

This is for checking bat file execution result.

Result

f:id:UYCP:20200210114340p:plain

cmd
Run and check your website

http://127.0.0.1:8000/

Reference

How to Create a Batch File to Run Python Script

datatofish.com

In Japanese

Djangoのカスタムコマンドを作成してコマンドラインから実行する

qiita.com