Django Project is Built as Node.js Project
Hello!
I am in the process of adding a build step in my django project by building javascript code via vite.js.
However, no matter what I do the build process thinks my project is a nodejs project:
See attached photo
In the settings tab, I have set "Railway Config File Path" to my
nixpacks.toml
file.
In my nixpacks.toml
I have the following file:
I'd appreciate getting help to get my deployment to actually listen to my nixpacks.toml file!
Service ID: abfcdf55-e734-425a-8e4f-094f7c8e5d8c
Github Link: https://github.com/zachbellay/fun3GitHub
GitHub - zachbellay/fun3
Contribute to zachbellay/fun3 development by creating an account on GitHub.
17 Replies
Project ID:
abfcdf55-e734-425a-8e4f-094f7c8e5d8c
it's weird that it's ignoring the
providers
option in nixpacks toml 🤔so you have a frontend built with vite, and then a backend built with django?
Right, the frontend should get built and then served as a static asset by django
from my experience, thats not a good idea, django should not serve the frontend, thats not what its designed for
would you like my help to set it up properly?
What approach would you suggest?
an isolated monorepo.
a repo that contains two folders:
/frontend
and
/backend
you would separate your frontend and backend code out into their respective folders.
then from the railway side of things you would have a service that runs your frontend and another to run the backend.I see, yeah in my case I'm not using django rest framework so I don't have a JSON API or anything. All I'm trying to do is serve these static assets, I am partial to my current approach.
With that said, how can I get the build to recognize my project as a python project instead of a node project?
ah you said "right" to this question, but i wasnt right
in that case i will go look at your repo so i can hopefully work out a build plan
Thank you @Brody, I appreciate it!
new railway.json
new nixpacks.toml
and lastly, move the package.json from the root into the money folder, with this the build did go through, but i got postgres connection errors but thats normal since i dont have any of that setup
@Brody I went ahead and updated my nixpacks.toml and railway.json, and also moved my package.json into the money directory
But it's still not recognizing the build as a python build.
let me check your repo, one sec
repo looks fine, theres a chance the railway service itself has gotten stuck on node as the provider, can you try deploying your repo in a new service?
For whatever reason it seems like that fixed it, thank you @Brody !
app deploys and displays just fine?
Yup! There are some things I have to debug now but the build works ok. Thanks again!!
no problem!