Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static files directory does not exist on Heroku after deployment #2

Open
addianto opened this issue Sep 4, 2022 · 1 comment
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@addianto
Copy link
Member

addianto commented Sep 4, 2022

Good day.

Thanks for preparing the project template. It is usable and I can deploy it to display a "Hello, World" page.

I encountered an issue when I checked the logs from the CI job and Heroku. I found out that there might
be a problem related to the static assets when the app was in deployment process at Heroku.

The relevant part of the CI job log from https://github.com/pbp-fasilkom-ui/django-pbp-template/runs/8170403745?check_suite_focus=true#step:6:50:

-----> $ python manage.py collectstatic --noinput
       System check identified some issues:
       WARNINGS:
       ?: (staticfiles.W004) The directory '/tmp/build_9f0fd430/static' in the STATICFILES_DIRS setting does not exist.
       130 static files copied to '/tmp/build_9f0fd430/staticfiles', 384 post-processed.

Sample log from Heroku after deployment:

System check identified some issues:

WARNINGS:

?: (staticfiles.W004) The directory '/app/static' in the STATICFILES_DIRS setting does not exist.

I believe Heroku always invoke collectstatic command whenever they build a Django Web project.
I think there might be an issue with the Django project configuration in settings.py. Could someone triage the issue?

Thanks in advance!

@addianto
Copy link
Member Author

addianto commented Sep 5, 2022

I think I found the cause. There is no static directory yet in the code template and base.html wants to import a CSS file in the header, which still does not exist.

edutjie added a commit to edutjie/django-pbp-template that referenced this issue Sep 7, 2022
@addianto addianto assigned addianto and unassigned addianto Nov 30, 2022
@addianto addianto added bug Something isn't working good first issue Good for newcomers labels Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant