Using static from /static folder from uwsgi when DEBUG is False

I have uwsgi and django.

Now I want to use uwsgi without nginx

So,I would like to use static from uwsgi even when DEBUG is false.

My static setting is like this ,and

STATIC_ROOT = 'static'
STATIC_URL = '/static/'

pytohn collectstatic.

Every static files are gathered under static folder.

Then I tryied some options to start uwsgi.

uwsgi --http :8008 --module myapp.wsgi --process=1 

uwsgi --http :8008 --module myapp.wsgi --process=1 --check-static=/static

uwsgi --http :8008 --module myapp.wsgi --process=1 --static-map=/static

However I can't load the images under static folder.

such as

There is a image under /static/defapp/test.img.

How can I fix this?

put this path for static

import os
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

insted of

Back to Top