3

I'm struggling to understand how I can implement my static files live. This is my first project I'm trying to deploy so it's possible I've missed something, and I'm finding it hard to understand which documentation is best to follow here - Wagtail, Divio or Django?

I can view my website with the localhost fine, the static files are read. But when deploying to Divio’s test servers, no longer, just Bootstrap stylings. Am i meant to set debug to False somewhere, and if so where do I set it so?

The dockerfile in the Divio project contains this command, which I sense is related to deploying live:

# <STATIC>
RUN DJANGO_MODE=build python manage.py collectstatic --noinput
# </STATIC> 

What are the steps needed to transition from operating on the localhost and viewing my static correctly, to having it display in test/live deployments? I thought I could link them with the settings.py file but when I try to do this I experience a problem related to the following step:

Step 7/7 : RUN DJANGO MODE=build python manage.py collectstatic —noinput 

It seems to hang almost indefinitely, failing after a long time - the following are the last few lines of my logs.

Copying '/virtualenv/lib/python3.5/site-packages/wagtail/admin/static/wagtailadmin/fonts/opensans-regular.woff'
Copying '/virtualenv/lib/python3.5/site-packages/wagtail/admin/static/wagtailadmin/fonts/wagtail.svg'
Copying '/virtualenv/lib/python3.5/site-packages/wagtail/admin/static/wagtailadmin/fonts/robotoslab-regular.woff'
Copying '/virtualenv/lib/python3.5/site-packages/wagtail/admin/static/wagtailadmin/fonts/opensans-semibold.woff'

Thanks all in advance for your time and help!

nattog
  • 81
  • 3
  • You should follow the Divio docs https://docs.divio.com/en/latest/how-to/configure-settings.html because Divio does uses Aldryn settings. According to this video it is easy to get up and running. https://www.youtube.com/watch?v=MVnK1xn4H9M Maybe try that and copy the settings? – allcaps Nov 04 '18 at 18:21

1 Answers1

0

In a Divio Cloud project, the settings for things like static files handling and DEBUG are managed automatically according to the server environment (Live, Test or Local).

See the table in How to run a local project in live configuration. You can override these manually if you need to, but there is no need whatsoever in normal use.

If you have added settings related to static file handling to your settings.py, try commenting them out - almost certainly, it will just work.

Daniele Procida
  • 1,477
  • 10
  • 27