Forums

APPSeed template tips needed

Hi, I want to reach out to other sites admins who are using Appseed templates - as I am. I am curious about the settings.py that they found to work well here at pythonanywhere (PA).

For example, appseed sets Django settings.py: STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') # contains STATICFILES_DIRS = [os.path.join(BASE_DIR,'static'),]

(this seems reversed to me - am I wrong? FYI)

I set static directories here to: /static/ /home/user/app_name/static/ /staticfiles/ /home/user/app_name/staticfiles/

I am getting errors at my website uploading static scripts -

In Appseed: the scripts.py file states: % static "directory/of/css/file"

But PA's Django implementation stops them from loading with a strict mime type error.

Are there any other things to watch out for?

You're probably getting a 404 and that is the wrong mime type. You need to check the network tab in the developer tools in you browser to see what is happening with the files. We have a help page on configuring static files for Django here: https://help.pythonanywhere.com/pages/DjangoStaticFiles/

It turned out that the template that I was using had a .gitignore to except /dist This was creating an empty folder that git was ignoring during its add and commit pushes to github. Once I solved that problem (remarked the /dist), I did a git push pull and all is well. The only other strange change was when I had to configure pythonanywhere's /static/ to appseed's /home/user/project/staticfiles/ directory. All seems well now ...

Glad to hear you were able to solve the issue!