Django: How to restart webserver so that changes in sourcecode get applied

前端 未结 2 1367
清酒与你
清酒与你 2020-12-11 23:58

I using Eclipse with PyDev to develop Django Webapplication. I can start my webserver with

python manage.py runserver

and then I can test m

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 00:23

    First, configure the project as a django project in eclipse, if not already so. (Right click on the project, and select PyDev -> Set as Django Project).

    Second, click on the green run button at the top, and select "run configurations". Select the PyDev Django icon and hit the new launch configuration button at the top. Enter the project name, (let's say testproject), and "${workspace_loc:testproject}/${DJANGO_MANAGE_LOCATION}" for the main module.

    On the Arugments tab, enter "runserver 0.0.0.0:8000 --noreload" if you want to your server to be visible for machines outside yours, or "runserver --noreload" if you want access on your machine only, and change the working directory to "${workspace_loc:}".

    Click apply and you should be set to go!

    Here's what it should look like when running inside of eclipse: enter image description here

提交回复
热议问题