#Anyone manage to get Django + Django tailwind to deploy correctly ?

67 messages · Page 1 of 1 (latest)

deep badge
#

I am trying to deploy Django + tailwind but of course i get the error node.js not found, am i missing something obvious ?

viral gobletBOT
#

Project ID: 1e0945e7-1952-485f-b720-005c0cf3e500

deep badge
#

1e0945e7-1952-485f-b720-005c0cf3e500

brisk tinsel
#

do you have a repo you can share that I can tinker with?

deep badge
#

I wish i could share it

brisk tinsel
#

okay then I'd be kinda flying blind, but I'll try

deep badge
#

What can i give you that will help ?

brisk tinsel
#

do you need to run some command that builds assets during build?

deep badge
#

yes, i do that as part of my Procfile

brisk tinsel
#

(assuming you have node available)

#

can you send your Procfile?

deep badge
#
web: python manage.py qcluster --settings=main.settings & python manage.py collectstatic --noinput && uvicorn main.asgi:application --host 0.0.0.0 --port $PORT --log-level debug
#

that one works

#
web: python manage.py qcluster --settings=main.settings & python manage.py collectstatic --noinput & python manage.py tailwind build && uvicorn main.asgi:application --host 0.0.0.0 --port $PORT --log-level debug

Gives me a error, about not finding node

brisk tinsel
#

okay it's being ran as a start command, got it

deep badge
#

I also added Nodejs as part of the settings

brisk tinsel
#

what was the outcome of that?

deep badge
brisk tinsel
#

hey those are deployment logs

deep badge
brisk tinsel
#

adding node as a provider wasn't the move, can you remove it and then send me the new build logs, it's not going to fix your issue but I need to first see if your build plan is still messed up

deep badge
#

rebuilding now

#

This does not include the tailwind stuff, as i needed the service up and running and removed that for the time being

brisk tinsel
#

looks like those logs don't include what I wanted to see, can you send me the build table from those build logs please

deep badge
#

Not sure what you want, more info please

brisk tinsel
#

scroll all the way up to the top of the build logs and send me a screenshot of the build table, you will know it when you see it!

deep badge
brisk tinsel
#

okay looks not broke anymore.

try adding this nixpacks.toml file to your project -

[phases.setup]
    nixPkgs = ['...', 'nodejs']
deep badge
#

syncing 🙂

brisk tinsel
#

syncing?

deep badge
#

Pushing to git 🙂

#

ok, still get the error about node/npm not found

brisk tinsel
#

are you looking for node / npm is a specific place?

deep badge
#

no, i am not, looks in the default place as far as i know

#

I can however set it to be anywhere

brisk tinsel
#

can you temporarily change the start command to print the node and npm version

deep badge
#

sure thing

#

rebuilding

#
v20.12.2

10.5.0
#
web: node --version & npm --version 
#

Could it just be a path issue ?

brisk tinsel
#

yep so node and npm are there for sure, your code is just looking in the wrong place, your code should be looking in PATH

deep badge
#

not sure, since it should look in the path

brisk tinsel
#

please look into that

deep badge
#
NPM_BIN_PATH = '/usr/local/bin/npm'
#

unless that path is wrong

brisk tinsel
#

that would be incorrect

deep badge
#

any idea's as the the correct path ?

brisk tinsel
#

you should not define a location at all, your code should be looking in PATH on its own

deep badge
#

removed that setting

#

and pushed again, lets see if that helps

brisk tinsel
#

have you removed the start command?

deep badge
#

yes

#

reverted back to the normal one

#

Looks like that fixed that issue now got some mode errors, but sure i can fix those

brisk tinsel
#

awsome!

deep badge
#

Thank you for the help mate

#

really approiciate it

brisk tinsel
#

no problem!

deep badge
#

now for node hell, but hey one has to do things like that

brisk tinsel
#

we all have to at some point

deep badge
#

again, thank you very much for the quick response

brisk tinsel
#

happy to help!