Trouble with Static Files and Components in Django Deployment #166
-
Hello! After a bit of research and work, I hooked up my ReactPy components to Django, and I'm running deployment tests. However, I've run into the inconvenience that the static files (such as the CSS style) have a peculiar way of being handled, which I am not doing yet, and thus they don't load. But the ReactPy components won't load either. Should I treat them as static files? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 33 replies
-
Are you using ReactPy-Django? If so, you can use the Django CSS component. |
Beta Was this translation helpful? Give feedback.
-
Hi. Yes, I am using ReactPy-Django. In my computer, everything loads fine, but now I uploaded my project to "pythonanywhere.com". Here, the login (which is not a component) loads but the main page (which is a component) does not. It throws me this error that I think is causing the problem: |
Beta Was this translation helpful? Give feedback.
-
Yep, I run the "collectstatic" command and started using the "whitenoise" library. I placed the components in the static file alongside the stylesheets. Now the CSS works, including the CSS for the components (I can see the background color), but the components themselves don't load. I'm getting these kinds of errors: My code for loading the component is:
|
Beta Was this translation helpful? Give feedback.
Seems to work for me with
DEBUG
off. If you're having issues with remote hosting, you might need to look into WebSocket configuration with your hosting provider.