Thank you so much for watching this video dear Dinesh❤️. Yes you can read json data from a separate file. Just choose your Django root project or any specific app then create a json file in that. Then in the view, import the Jason package then write the script to read the json data using open function. For example, import json def load_json_data(request): # Define the path to the JSON file json_file_path = 'myapp/data.json' # Open and read the JSON file with open(json_file_path, 'r') as file: data = json.load(file) #now you can use the data as needed. You can pass this data to HTML template file as you shown this video. Hope it's clear to you dear. If you haven't subscribed to my channel yet. Please do subscribe and encourage me.
how to do this when im having the json in a seperate file
Thank you so much for watching this video dear Dinesh❤️. Yes you can read json data from a separate file. Just choose your Django root project or any specific app then create a json file in that. Then in the view, import the Jason package then write the script to read the json data using open function. For example, import json
def load_json_data(request):
# Define the path to the JSON file
json_file_path = 'myapp/data.json'
# Open and read the JSON file
with open(json_file_path, 'r') as file:
data = json.load(file)
#now you can use the data as needed. You can pass this data to HTML template file as you shown this video.
Hope it's clear to you dear. If you haven't subscribed to my channel yet. Please do subscribe and encourage me.
@@kundankumar011 thanks for the reply sir
@@Dineshtech-xr8id Welcome dear ❤️ and Thank you so much for subscribing my channel