R
Railway•13mo ago
TripleK

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:
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.
Jump to solution
33 Replies
Percy
Percy•13mo ago
Project ID: 4b66a249-0189-49b9-8839-82fa0f275919
TripleK
TripleK•13mo ago
project id: 4b66a249-0189-49b9-8839-82fa0f275919
TripleK
TripleK•13mo ago
Error log
Brody
Brody•13mo ago
TripleK
TripleK•13mo ago
build log
TripleK
TripleK•13mo ago
Okey I put the requirements.txt and now I have this error:
TripleK
TripleK•13mo ago
During the build
TripleK
TripleK•13mo ago
@Brody please help
Brody
Brody•13mo ago
please no pings #🛂|readme #5 can you share your repo? looks like you have a slightly complex setup going on
TripleK
TripleK•13mo ago
Sorry men
TripleK
TripleK•13mo ago
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.
Brody
Brody•13mo ago
there seems to be a node app merged into this repo?
TripleK
TripleK•13mo ago
Yes, It have the frontend and the server.js for websockets Django rest framework too
Brody
Brody•13mo ago
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
Brody
Brody•13mo ago
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
No description
Solution
TripleK
TripleK•13mo ago
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.
Brody
Brody•13mo ago
is that how many services this repo currently houses?
TripleK
TripleK•13mo ago
In fact, the frontend has been deployed well because it is already in a subfolder 3 services The API, the frontend and the websockets
Brody
Brody•13mo ago
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?
TripleK
TripleK•13mo ago
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.
Brody
Brody•13mo ago
awsome, glad the nixpacks.toml and caddyfile i wrote are helping people haha yeah not quite the same for django or express
TripleK
TripleK•13mo ago
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
Brody
Brody•13mo ago
true that lol have you disabled the trigger?
TripleK
TripleK•13mo ago
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
Brody
Brody•13mo ago
no worries
TripleK
TripleK•13mo ago
In a few hours I will let you know how everything went.
TripleK
TripleK•13mo ago
I have modified the paths of the project by creating the 3 subfolders as you told me. Now I get this error.
TripleK
TripleK•13mo ago
The architecture of the project is: --/API_Backend --/venv --/Frontend --/WebSockets_Backend
TripleK
TripleK•13mo ago
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:
TripleK
TripleK•13mo ago
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!
Brody
Brody•13mo ago
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?
TripleK
TripleK•13mo ago
Dont worry! Yes, now i have 3 services in my project
Brody
Brody•13mo ago
okay then you're all set!
Want results from more Discord servers?
Add your server