Question

problem in serving static files in django webapp

urls.py

from django.contrib import admin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
    path('admin/', admin.site.urls),
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

settings.py

STATIC_URL = '/web/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
STATIC_ROOT = '/home/domain.com/public_html/web/public/static'

```**

i am using cyberpanel with openlightspeed server with contex**

context / { type appserver location /home/domain.com/public_html/web binPath /usr/local/lsws/fcgi-bin/lswsgi appType wsgi startupFile web/wsgi.py envType 1 env LS_PYTHONBIN=/home/domain.com/public_html/bin/pyhton env PYTHONHOME=/home/domain.com/public_html/ }




my web app is not serving static files i am getting 
404
Not Found

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer