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:Jump to 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
22 Replies
Project ID:
ac27f0b8-f4c4-478f-9516-441b9a3c376e
ac27f0b8-f4c4-478f-9516-441b9a3c376e
try setting
STATIC_URL
to static/
still the same
can you share your repo?
GitHub
GitHub - kronborg6/DjangoSeaOfKeys
Contribute to kronborg6/DjangoSeaOfKeys development by creating an account on GitHub.
you dont have a
static
folder in this repo? you have a staticfiles
folder thoughthat 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
rename the folder to
static
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.
https://github.com/kronborg6/DjangoSeaOfKeys/blob/main/mysite/settings.py#L122
you havent updated this yet
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:
okay then put that back to what it was
build logs please https://bookmarklets.up.railway.app/log-downloader/
you arent running collectstatic
change your procfile to
stil got Not Found: /static/multiselect.js
Not Found: /static/style.css
Not Found: /static/pagination.js
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
i start with my own research but i will do more thx for the help
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
awesome, glad you where able to solve!
thanks for all your help