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

Missing static files #902

Open
onny opened this issue Nov 17, 2024 · 5 comments
Open

Missing static files #902

onny opened this issue Nov 17, 2024 · 5 comments

Comments

@onny
Copy link

onny commented Nov 17, 2024

I was able to build and run Froide as a NixOS package and module NixOS/nixpkgs#355835

After running it and visiting localhost:8000 I see this page:

20241117_20h32m14s_grim

Somehow it doesn't even try to load css or js files only images which are missing too

DJANGO_CONFIGURATION=Production manage.py migrate
DJANGO_CONFIGURATION=Production manage.py runserver localhost:8000
@pajowu
Copy link
Member

pajowu commented Nov 18, 2024

Did you build the frontend? (pnpm run build) or alternatively are you running the frontend dev-server? (pnpm run dev)

@onny
Copy link
Author

onny commented Nov 18, 2024

in my package output I have:

ls result
bin               docs               frontend     MANIFEST.in           package.json    requirements-test.txt  vite.config.js
build             eslint.config.mjs  LICENSE.txt  monkeytype_config.py  pnpm-lock.yaml  requirements.txt
compose-dev.yaml  froide             Makefile     nix-support           pyproject.toml  SECURITY.md
dist              froide.egg-info    manage.py    node_modules          README.md       tsconfig.json

and

ls result/build/
css               fileuploader.js.map   js                  messageredaction.js      proofupload.js           redact.js
document.js       filingcabinet.js      main.js             messageredaction.js.map  proofupload.js.map       redact.js.map
document.js.map   filingcabinet.js.map  main.js.map         moderation.js            publicbody.js            request.js
docupload.js      fonts                 makerequest.js      moderation.js.map        publicbody.js.map        request.js.map
docupload.js.map  geomatch.js           makerequest.js.map  postupload.js            publicbodyupload.js      tagautocomplete.js
fileuploader.js   geomatch.js.map       manifest.json       postupload.js.map        publicbodyupload.js.map  tagautocomplete.js.map

hope these are the correct places to put the files in

@krmax44
Copy link
Member

krmax44 commented Nov 18, 2024

Does it work when you omit the DJANGO_CONFIGURATION=Production variable?

@onny
Copy link
Author

onny commented Nov 18, 2024

Then it tries to unsuccessfully load manifest.dev.json where as pnpm run build only produces a manifest.json file

@krmax44
Copy link
Member

krmax44 commented Nov 20, 2024

Ah, right. Try running manage.py collectstatic after building the frontend (see Django docs for details). If it still doesn't work, it may be a limitation of Django's dev server (which doesn't mix well with DJANGO_CONFIGURATION=Production).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants