Django deployment with quasar static files
has anyone tried deploying quasar using django as backend?.
Im trying to deploy it using gitlab, so what im trying to do is the following:
- run quasar build
- Point Django static directory to the files generated by quasar
- Copy index.html to the templates Django is going to use
- Let collectstatic + whitenoise + AWS S3 do its job
The problem I’m having (I guess) is that I need the static files to be inside a folder called ‘static’, for that, I guess I need to configure webpack.
Is this the correct way for deployment?, Can I change the static folder where static files are generated? Does anyone have a pipeline or an example of how has he managed to deploy this configuration?
Thanks!, I love this framework. v1 is beautiful!, works like magic.
HI, I’ve managed to get a site up with django as the backend.
I’d suggest completely separating your back and front end. For instance I deployed my backend using heroku and fronent with next. Then it was a matter of making ajax requests for the content that was needed in the front end (and sending content back to the backend to be processed).
So if needed you can just get the static content from your back-end which in turn uses S3 to store it.
I’d recommend django-rest-framework
Thanks for answering!!. I dont have problems with the api. Im more concerned about how to properly deploy to do ci/CD, and serve static files correctly.
How are you serving static files using django? Are you using whitenoise + s3??.
Separating Quasar UI and Django rest backend should work, however please keep in mind couple of issues:
- You may have to configure CORS and deal with additional preflight requests
- If the UI is dynamically constructed based on some data in or reed critical config from Django, that can be problematic and will require less than optimal work arounds.
This post is deleted!
This add static to js and css paths in index.html.