R
Railway14mo ago
Kronborg

Django Hosting

Hey im trying to host a django app/website but it can't find my static folder i get this error ?: (staticfiles.W004) The directory '/app/static' in the STATICFILES_DIRS setting does not exist. Not Found: /static/styles.css Not Found: /static/media/icon.png Not Found: /static/style.css i have add this to my settings file STATIC_URL = '/static/' STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] STATIC_ROOT =os.path.join(BASE_DIR, 'staticfiles') i run python manage.py collectstatic
Solution:
i Fixed it by takeing a fork of django template add my webadmin to the django folder and in mysite folder settings.py file add webadmin in installed apps
Jump to solution
22 Replies
Percy
Percy14mo ago
Project ID: ac27f0b8-f4c4-478f-9516-441b9a3c376e
Kronborg
KronborgOP14mo ago
ac27f0b8-f4c4-478f-9516-441b9a3c376e
Brody
Brody14mo ago
try setting STATIC_URL to static/
Kronborg
KronborgOP14mo ago
still the same
Brody
Brody14mo ago
can you share your repo?
Kronborg
KronborgOP14mo ago
GitHub
GitHub - kronborg6/DjangoSeaOfKeys
Contribute to kronborg6/DjangoSeaOfKeys development by creating an account on GitHub.
Brody
Brody14mo ago
you dont have a static folder in this repo? you have a staticfiles folder though
Kronborg
KronborgOP14mo ago
that is what i get python manage.py collectstatic and they is a static folder in webadmin i have tryiet to rename the staticfiles to static
Brody
Brody14mo ago
rename the folder to static
Kronborg
KronborgOP14mo ago
i still get this Not Found: /static/style.css Not Found: /static/pagination.js Not Found: /static/multiselect.js but now this is not showing ?: (staticfiles.W004) The directory '/app/static' in the STATICFILES_DIRS setting does not exist.
Kronborg
KronborgOP14mo ago
i have update it to static not i get this ?: (staticfiles.E002) The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting. SystemCheckError: System check identified some issues: ERRORS:
Brody
Brody14mo ago
okay then put that back to what it was build logs please https://bookmarklets.up.railway.app/log-downloader/
Brody
Brody14mo ago
you arent running collectstatic change your procfile to
web: python manage.py migrate && python manage.py collectstatic --noinput && gunicorn mysite.wsgi --log-file -
web: python manage.py migrate && python manage.py collectstatic --noinput && gunicorn mysite.wsgi --log-file -
Kronborg
KronborgOP14mo ago
stil got Not Found: /static/multiselect.js Not Found: /static/style.css Not Found: /static/pagination.js
Brody
Brody14mo ago
i will tag in my fellow conductor who knows more about this than me when i see them online, in the mean time please try to do your own research on this issue as it wouldnt be isolated to railway, but an issue with your codebase
Kronborg
KronborgOP14mo ago
i start with my own research but i will do more thx for the help
Solution
Kronborg
Kronborg14mo ago
i Fixed it by takeing a fork of django template add my webadmin to the django folder and in mysite folder settings.py file add webadmin in installed apps
Brody
Brody14mo ago
awesome, glad you where able to solve!
Kronborg
KronborgOP14mo ago
thanks for all your help
Want results from more Discord servers?
Add your server