Enabling internal routing in uWSGI

前端 未结 2 467
粉色の甜心
粉色の甜心 2021-01-18 06:57

I have a Django app working with uWSGI. My uWSGI config is:

[uwsgi]
http = 127.0.0.1:8000
env = DJANGO_SETTINGS_MODULE=my_django_app.settings
module = my_dja         


        
相关标签:
2条回答
  • 2021-01-18 07:37

    I had to install uWSGI with pcre support. It solved problem with routing.

    To do it I had to install pcre lib(for Ubuntu the package called libpcre3) and reinstall uWSGI then. Since PCRE is already in your system uWSGI will be automatically compiled with pcre support.

    There are also points from @tobias.mcnulty comment that also might be useful:

    • libpcre3-dev package on Ubuntu also needs to be installed
    • afterwards you may want to run pip install -I --no-cache-dir uwsgi to reinstall it, otherwise you might just get the same cached wheel.
    • the error in the logs is !!! no internal routing support, rebuild with pcre support !!!
    0 讨论(0)
  • 2021-01-18 07:53

    [uwsgi]

    base = /var/www/html/poopbuddy-api

    chdir = %(base)

    app = app

    I don't exactly know what chdir does, but I think it fixed it... I'm guessing it at least sets the default location to the app's root folder. Something like this also happens to me when I'm using PyCharm, I have to set "working directory" from the "Edit Configurations" or "edit/debug configuration" window.

    0 讨论(0)
提交回复
热议问题