Patrowl / PatrowlDocs

PatrOwl - Open Source, Free and Scalable Security Operations Orchestration Platform
https://www.patrowl.io
GNU Affero General Public License v3.0
147 stars 51 forks source link

Problem with Django staticfiles #20

Closed Fireless2013 closed 5 years ago

Fireless2013 commented 5 years ago

Hello,

The installation of Patrowl is done and I can run the production server. But when I want to access at http://x.x.x.x:8000/, the CSS files doesn't load. On the server, I have error message below : x.x.x.x - - [02/Jul/2019 18:18:07] "GET /static/css/cal-heatmap.css HTTP/1.1" 404 - x.x.x.x - - [02/Jul/2019 18:18:07] "GET /static/css/jquery.dataTables.min.css HTTP/1.1" 404 - x.x.x.x - - [02/Jul/2019 18:18:07] "GET /static/js/jquery.min.js HTTP/1.1" 404 - x.x.x.x - - [04/Jul/2019 11:42:30] "GET /static/js/fontawesome-all.min.js HTTP/1.1" 404 - x.x.x.x - - [04/Jul/2019 11:42:30] "GET /static/admin/js/core.js HTTP/1.1" 404 - .......

These is my configuration on settings.py about staticfiles (default configuration): STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR,'staticfiles') STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"),

I tried this but it does'nt work : `STATICFILES_FINDERS = [ 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', ] STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

STATIC_ROOT= '/root/PatrowlManager/static/'

STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), '/root/PatrowlManager/static', ] `

Can you help me ?

Thank you !

Fireless2013 commented 5 years ago

It works in development mode

MaKyOtOx commented 5 years ago

Hello, Yes it is the expected behavior of Django. For production mode, consider using Nginx (or other) to serve the static files ;)

Fireless2013 commented 5 years ago

Thank you :)