R
Railway8mo ago
tomfool

Help with django setup

hi project ID: 510ee6ef-4e3d-4fe3-ae13-2f21650a1e6f first time setting up a django project on railway (which looks awesome btw). I've got a project that contains a django backend and a react frontend in this format: root_dir: /frontend/<frontend_project_name>/ ... has build, source, public, etc /<backend_project_name>/ ... is my django app, has bin, include, lib, python files manage.py README.md ... when deploying I get this error: ?: (staticfiles.W004) The directory '/app/frontend/<frontend_project_name>/build/static' in the STATICFILES_DIRS setting does not exist. I've tried a number of things to resolve, but it looks like the frontend directory isn't being pulled from git, even though it's in the repo. Any ideas?
14 Replies
Percy
Percy8mo ago
Project ID: 510ee6ef-4e3d-4fe3-ae13-2f21650a1e6f
tomfool
tomfoolOP8mo ago
to be clear, my python code is there, builds fine, the django app runs, but can't find the static files
Brody
Brody8mo ago
are you trying to have your django app serve the frontend?
tomfool
tomfoolOP8mo ago
yes
Brody
Brody8mo ago
that's really not ideal, instead let's have them as separate services, a service for the frontend and a service for the backend please separate this repo out into two folders -
.
├── backend/
│ ├── manage.py
│ └── ...
└── frontend/
├── package.json
└── ...
.
├── backend/
│ ├── manage.py
│ └── ...
└── frontend/
├── package.json
└── ...
tomfool
tomfoolOP8mo ago
just to check, what is not ideal - django serving the frontend?
Brody
Brody8mo ago
correct
tomfool
tomfoolOP8mo ago
so is the right way to do it just have two seperate services/directories?
Brody
Brody8mo ago
correct and we will work through that step by step
tomfool
tomfoolOP8mo ago
cool man thank you - get to this later today thanks for your help
Brody
Brody8mo ago
no problem!
tomfool
tomfoolOP8mo ago
which template is best for a standard react app?
tomfool
tomfoolOP8mo ago
?
No description
Brody
Brody8mo ago
mine, but you'd only need the nixpacks.toml and Caddyfile from it you don't need to start a new project, you just need to restructure your project like this
Want results from more Discord servers?
Add your server