Serve static files in production with WhiteNoise in Django

  Рет қаралды 3,620

Cloud With Django

Cloud With Django

Күн бұрын

Пікірлер: 30
@katlegolionel1174
@katlegolionel1174 8 ай бұрын
New to your channel, absolutely enjoy these short videos. Thank you.
@CloudWithDjango
@CloudWithDjango 8 ай бұрын
Welcome to the channel! Thank you for the support, and I'm glad that you are enjoying the content! Of course, it's a pleasure! Good luck to you!
@Manifest_Chakalov
@Manifest_Chakalov 8 ай бұрын
Thank you for this please continue releasing contente like this. So I am working on an open source project that involves creating a backend using django rest framework. The problem I'm having is I cannot seem to figure how the logic to handle keeping scores and selecting answers and also fetching questions from the database. I don't know if we can have further talk about this and you can suggest way I go about it.
@CloudWithDjango
@CloudWithDjango 8 ай бұрын
My pleasure! Thank you for your suggestions. I'll give you some advice here. To address scoring and answer selection in a Django Rest Framework backend, implement models for questions and user responses, create views with corresponding serializers to handle scoring logic, and use database queries to fetch questions based on your application's requirements.
@codedjango
@codedjango 8 ай бұрын
How to serve static files from a frontend framework e.g. NextJS / VueJS (created with "vite") in production with django? the issue is the cli creates so many *.js files so I want to know how to serve these directly with Django....any help on this would be appreciated....thanks anyways for these tutorials :)
@CloudWithDjango
@CloudWithDjango 8 ай бұрын
Hi, So this video is specifically for Django. If you want to serve static files with a frontend framework as well you would need to copy the generated static files from your Next.js or Vite build output to Django's static directory, and configure Django's STATICFILES_DIRS or STATIC_ROOT in settings.py to include this directory for serving the static files. Thank you for the support!
@ankitsrivastava7473
@ankitsrivastava7473 8 ай бұрын
Thank you for this, just what i needed!
@CloudWithDjango
@CloudWithDjango 8 ай бұрын
My pleasure! I'm glad that you liked the video!
@amine63404
@amine63404 6 ай бұрын
Hi, I have a question please, can whitenoise also serve updated files by user like images or other ? Thank you for these tutorials.
@CloudWithDjango
@CloudWithDjango 6 ай бұрын
Hi, You'd need to read the docs on this, but from my knowledge, you'd need to use something else. Perhaps like Amazon S3 or something of the sort. Of course, my pleasure! Thank you for the support.
@amine63404
@amine63404 6 ай бұрын
@@CloudWithDjango thank you for your réponse, much appreciated.
@CloudWithDjango
@CloudWithDjango 5 ай бұрын
Of course, anytime! :)
@ibrahimoluwaseunsamson5515
@ibrahimoluwaseunsamson5515 8 ай бұрын
Please do a tutorial on digital ocean space
@CloudWithDjango
@CloudWithDjango 8 ай бұрын
Thank you for the suggestion!
@ibrahimoluwaseunsamson5515
@ibrahimoluwaseunsamson5515 7 ай бұрын
@@CloudWithDjango I will be glad to watch the videos sir... I'm having issues with the gunicorn bind. I noticed whenever I bind my gunicorn server, my static files won't show.
@SpeedCodes-oc7ed
@SpeedCodes-oc7ed 2 ай бұрын
did you try to set media files within of the static folder to get them compressed? does it works?
@CloudWithDjango
@CloudWithDjango 2 ай бұрын
Hi! I only focused on the static files here and not the media files. Not too sure if the media files would work within the static folder.
@averrousazharrafiqi2597
@averrousazharrafiqi2597 8 ай бұрын
Very helpfull... thank you for your explanation!
@CloudWithDjango
@CloudWithDjango 8 ай бұрын
My pleasure! I'm glad that you found it helpful!
@ahmadumar9387
@ahmadumar9387 4 ай бұрын
Hi @Arno, do you think it's possible to use media files, when i took the media url and root inside of static/?
@ahmadumar9387
@ahmadumar9387 4 ай бұрын
no need to reply, i know the answer :)
@CloudWithDjango
@CloudWithDjango 4 ай бұрын
Hi Ahmad, Oh haha, no worries! :)
@ahmadumar9387
@ahmadumar9387 4 ай бұрын
@@CloudWithDjango according me, is this the best setup ``` - Whitenoise - STATIC_URL = 'static/' - STATIC_ROOT = 'static/' - STATICFILES_DIRS = 'staticfiles/' - MEDIA_URL = 'static/media/' - MEDIA_URL = 'static/media/' - STATICFILES_STORAGE='whitenoise.storage.CompressedStaticFilesStorage' ```
@CloudWithDjango
@CloudWithDjango 4 ай бұрын
Thank you, Ahmad! This is great!
@koradavenkatamahesh9957
@koradavenkatamahesh9957 6 ай бұрын
Thank you so much for providing valuable content, Please make a video how to deploy our project for free in online contains static files and database..
@CloudWithDjango
@CloudWithDjango 6 ай бұрын
My pleasure! I'm glad that you like the content! I have a video tutorial on the channel that focuses on deploying to Fl0 which covers free deployment with static files and a postgres database.
@ave6656
@ave6656 7 ай бұрын
Братуха!спасибо тебе огромное!
@CloudWithDjango
@CloudWithDjango 7 ай бұрын
Удовольствие!
@BBN-j6d
@BBN-j6d 5 ай бұрын
Wow! It works
@CloudWithDjango
@CloudWithDjango 5 ай бұрын
I'm glad that it worked for you!
How to Deploy ML Solutions with FastAPI, Docker, & AWS
28:48
Shaw Talebi
Рет қаралды 13 М.
Set Up AWS S3 Bucket with Django for Static and Media Files
10:38
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 29 МЛН
Ozoda - Lada ( Official Music Video 2024 )
06:07
Ozoda
Рет қаралды 29 МЛН
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 50 МЛН
Implement Amazon S3 Storage for Static and Media files in Django
44:04
Cloud With Django
Рет қаралды 10 М.
Compress static files in Django to improve website loading times
15:49
Cloud With Django
Рет қаралды 1,4 М.
Configuring Tailwind CLI in Django: A Step-by-Step Guide
10:52
Serving  Static Files in Production with whitenoise in Django
6:01
THE PROTON GUY
Рет қаралды 9 М.
4 ways to serve static files in Django
8:11
Django road
Рет қаралды 12 М.
Understanding Django Static Files
29:06
Jarad Python
Рет қаралды 22 М.
Easily Import structured data into Django models
17:23
Cloud With Django
Рет қаралды 1,3 М.
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 29 МЛН