如何在FreeBSD的virtualenv中修复Django不断重载

时间:2019-04-08 08:53:44

标签: django python-3.x raspberry-pi freebsd

我已经在具有Python3.6和virtualenv的Raspberry PI 3+上安装了全新的FreeBSD安装。

在virtualenv'web'内部,我创建了Django Project'prod'和uWSGI。

我可以毫无问题地启动uWSGI服务器实例。 但是,如果我尝试运行

public static UtilsEntity getGameDate() {
        EntityManager em = PersistenceManager.INSTANCE.getEntityManager();
        UtilsEntity gameDate = (UtilsEntity) em.createQuery("SELECT u FROM UtilsEntity u WHERE u.name = 'GAME_DATE'").getSingleResult();
        em.close();
        return gameDate;
    }

Django不断重新加载服务器,因为它检测到python文件的更改:

python manage.py runserver 0.0.0.0:8000

'/ usr / local / lib / python3.6 /'中的每个文件都会发生这种情况

我在VirtualBox上具有相同的设置(不是100%相同,VirtualBox是FreeBSD的amd64版本)

如果我跑步:

December 07, 2018 - 15:00:59
Django version 2.2, using settings 'prod.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
/usr/local/lib/python3.6/gettext.py changed, reloading.
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

December 07, 2018 - 15:01:05
Django version 2.2, using settings 'prod.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
/usr/local/lib/python3.6/uuid.py changed, reloading.
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

服务器可达且稳定

我重新格式化了SD卡,并重新启动了该项目,

我对文件所做的唯一更改:

python manage.py runserver 0.0.0.0:8000 --noreload

其中X.X.X.X是外部IP

1 个答案:

答案 0 :(得分:0)

同一问题。从Django 2.2降级到Django 2.1.7已为我修复。