Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH ...
Hello to all of you! I'm trying to deploy a backend app using Django Rest Framework. I'm new to programming and I've based it on the Django Rest Framework Railway template, but I'm getting the following error when I deploy the app:
Solution:Jump to solution
Okay. Then I have to create three folders, right? One for the Django rest framework, one for the node server and one for the frontend.
33 Replies
Project ID:
4b66a249-0189-49b9-8839-82fa0f275919
project id: 4b66a249-0189-49b9-8839-82fa0f275919
please watch this video https://youtu.be/oLlT6c6jA-M?si=AkEDZ3VRji4ZdNlT
build log
Okey I put the requirements.txt and now I have this error:
During the build
@Brody please help
please no pings #🛂|readme #5
can you share your repo? looks like you have a slightly complex setup going on
Sorry men
GitHub
GitHub - Pacohm00/fibbel: Software de gestión en Fisioterapia
Software de gestión en Fisioterapia. Contribute to Pacohm00/fibbel development by creating an account on GitHub.
there seems to be a node app merged into this repo?
Yes, It have the frontend and the server.js for websockets
Django rest framework too
what you want is an isolated monorepo, you need to separate the different services into subfolders in this repo before you worry about deploying this to railway
first go into your service and click this button, you will be making a lot of changes to your repo and dont need railway to re-build on every change until we are ready
Solution
Okay. Then I have to create three folders, right? One for the Django rest framework, one for the node server and one for the frontend.
is that how many services this repo currently houses?
In fact, the frontend has been deployed well because it is already in a subfolder
3 services
The API, the frontend and the websockets
then yes, exactly, you already have the right idea about the frontend in a subfolder
can i ask how you came across the nixpacks.toml and caddyfile that you use in the frontend?
I found it by creating a react vite template and browser through the GitHub repository.
I tried to replicate the same method for the backend but it did not work.
awsome, glad the nixpacks.toml and caddyfile i wrote are helping people
haha yeah not quite the same for django or express
It was very helpful, thanks a lot man!
Django is more complex than express, I don't think I'll ever set up anything in Django again hahahahaha
true that lol
have you disabled the trigger?
Well, thank you very much for the information, tomorrow I will try what you have told me and if it works I will write it here
Not yet, I'm going to sleep since I've been glued to the screen for 12 hours.
Hahaahaha
no worries
In a few hours I will let you know how everything went.
I have modified the paths of the project by creating the 3 subfolders as you told me. Now I get this error.
The architecture of the project is:
--/API_Backend
--/venv
--/Frontend
--/WebSockets_Backend
I tried removing the twisted-dependency in the requirements.txt file and now the build is created. However, on deployment I get the following error:
I have changed the row where it says "django_crud_api.settings" to "miapp_crud_api.settings" and it works! Now I have a new problem, the static files don't load as they should.
I can resolve that putting the whitenoise middlewere in settings.py
So this threat it resolves!
sorry it was nearly 6 am when you send another text, but just to be sure you do have everything setup, you now have 3 railway services in your project right?
Dont worry! Yes, now i have 3 services in my project
okay then you're all set!