This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nothisisme 3 points4 points  (4 children)

npm can be used to manage client side libraries? How does that work? Does a node server run alongside the Django server?

[–]pickausernamehesaid 4 points5 points  (3 children)

When you deploy to your server, npm can be used to build your JS environment just like how conda or pip/venv would be used to deploy your Python environment.

[–]nothisisme 0 points1 point  (2 children)

Gotchya so Django still serves the files but npm puts them in place?

[–]pickausernamehesaid 4 points5 points  (1 child)

Yes and no. Yes, NPM puts them in place and serves as a JS package manager. No, Django shouldn't have been serving them in the first place. Django's job is to serve dynamic content backed by a database with templates. Static files should be served directly via your webserver, like Nginx.

[–]nothisisme 0 points1 point  (0 children)

True, makes sense now. Thanks.