![]() You must install those packages if you use a media folder to keep your media files that change because Heroku deletes that folder, or you can use AWS buckets Install that package if you are using the image upload field in your Django model Install that package only for postgress database Pip install dj-database-url gunicorn whitenoise This includes everything you need to deploy a complete Django app, including static files and media files You can deploy your app within 5 minutes with this method Thanks for reading and feel free to like/share this post.The internet is filled with tutorials for deploying your Django app to Heroku, but they will all confuse you Here is a link to read up on using S3 with Heroku Note: Ideally if you are dealing with Image Uploads and other Assets it is recommended to use AWS S3 bucket to store your assets as Slug size should not exceed 500mb. In the end, I have all my generated staticfiles baked into the slug (virtual machine image) and I no longer need to worry about Heroku's ephemeral system. With all that done, the post-compile process hands control over to the compile process as shown in the diagram below. Run django collectstatic, this way all the generated JS and CSS file including that of external modules are all collected and placed in the generated Staticfile directory according to my project's settings.py file.Get all the JS and CSS static files compiled into a specified folder by running webpack (at this point we already have nodeJS installed). ![]()
0 Comments
Leave a Reply. |