🎙️ INTRO (0:00 – 0:40) Namaste Doston! 👋 Main hoon [Your Name] aur aaj ke video mein hum baat karne wale hain C# 14.0 ke Top 10 Most Important Features ke baare mein. Ye update .NET 10 ke saath aaya hai aur C# ko aur zyada modern, clean aur developer-friendly banata hai. Main har feature ko simple example ke saath samjhaunga taaki aapko coding mein easily use kar paayein. So let’s start — C# 14 ke naye power-packed features! 🚀 🧩 1️⃣ Field-backed Properties (0:40 – 1:00) Pehla feature hai — Field-backed Properties Ab aapko manually private field likhne ki zarurat nahi. C# 14 mein ek naya contextual keyword aaya hai — field public string Name { get ; set => field = value ?? throw new ArgumentNullException( nameof ( value )); } Yahaan field compiler-generated backing field ko represent karta hai. Validation ya logic likhna ab super easy ho gaya hai! 🧩 2️⃣ Extension Members (1:00 – 1:25) Dusra feature — Extension Members Pehle hum si...
Django provides two different ways to put the image.
1 under app means local scope:-
create static/img folder under the current app and put an image
use <img> tag of html and write path
<img src="/static/img/img3.jpg" width="500" height="500" />
2 under application means global scope:-
If we want to manage image under application then we can create media director and write the image into this and provide a media path
1 under app means local scope:-
create static/img folder under the current app and put an image
use <img> tag of html and write path
<img src="/static/img/img3.jpg" width="500" height="500" />
2 under application means global scope:-
If we want to manage image under application then we can create media director and write the image into this and provide a media path
1) open the setting.py file and write this code:-
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
2) open urls.py file and write this code:-
from django.conf import settings
from django.conf.urls.static import static
and write code under the below section
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
The complete code of urls.py will be this:-
from django.contrib import admin
from django.urls import path,include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('frontdesk/', include('frontdesk.urls')),
path('admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
3) Code for images under html file
<img src="../media/job.png" width="500" height="500" />
We can also put an audio file, video file, pdf file, text file, etc?
Comments
Post a Comment
POST Answer of Questions and ASK to Doubt