I've been reading the docs and blogs all day trying to make sure I understand how to correctly log in django and I believe you were the one to bring it all together for me. Great examples, thank you so much!
@technologyfornoobs2 жыл бұрын
Great to hear!
@yashpatel95504 жыл бұрын
Best explaination i found on youtube till now, you know how to teach things, you got teaching skills, never stop this...Thanks for amazing video
@technologyfornoobs4 жыл бұрын
You're very welcome!
@AyazAmlani2 жыл бұрын
11:57 had me cracking up! "I'm in the logger, if you care...." bahahaha
@manishshetake15553 жыл бұрын
Thank you for your unique explaination, I came for this video by accident.😍
@technologyfornoobs3 жыл бұрын
You're welcome 😊
@manishshetake15553 жыл бұрын
@@technologyfornoobs Keep doing such stuff and motivate us to learn & grow with you🤞
@geoafrikana Жыл бұрын
Great teacher. Thanks bro.
@technologyfornoobs Жыл бұрын
Welcome
@kamleshmahadule82383 жыл бұрын
What a explationation, never seen ever. 👌👌
@technologyfornoobs3 жыл бұрын
Thanks!
@vijayrajput32973 жыл бұрын
Thank you for such a wonderful explanation about Django logging module.👏
@technologyfornoobs3 жыл бұрын
You are welcome!
@pavanjain2178 Жыл бұрын
Really helpful brother❤
@technologyfornoobs Жыл бұрын
Glad to hear that
@rood4863 жыл бұрын
This is a great video. Thanks for your example and your explanation.
@technologyfornoobs3 жыл бұрын
You're very welcome!
@asztro2 жыл бұрын
Nice
@technologyfornoobs Жыл бұрын
Thanks
@LuadoO2 жыл бұрын
Best out there sir, good job
@technologyfornoobs2 жыл бұрын
Thanks!
@diPpYzPIANO2 жыл бұрын
Bravo !!! It was an awesome explanation... thanks
@technologyfornoobs2 жыл бұрын
Glad it was helpful!
@EdgarSkipper Жыл бұрын
why is this not working when I run the server with >> mod_wsgi-express start ??
@gupta-xh4sk4 жыл бұрын
How to rotate log in django. Same as java log4j2 is working. TimedRotation is not working. It truncate file while rotating
@sujithsuji61703 жыл бұрын
Superb bro great work help me a lot..🥰🥰🥰💝💝
@technologyfornoobs3 жыл бұрын
Welcome 😊
@azeyn20504 жыл бұрын
Great explanation! Thanks a heap!
@technologyfornoobs4 жыл бұрын
You're welcome!
@paulcurious23243 жыл бұрын
Not a stack?
@joy_sam_raj2 жыл бұрын
Thanks sir
@technologyfornoobs2 жыл бұрын
All the best
@ShailajaKaustav Жыл бұрын
Thanks... very informative. One question - there is a specific requirement in one of my project to implement dynamic log level change without restarting Django app. Can you please share information around that as well?
@technologyfornoobs Жыл бұрын
You would just use if else statements
@ShailajaKaustav Жыл бұрын
@@technologyfornoobs can we do that in a production deployed app? or should we use some file like file.conf where we will update at runtime? explored a lot but did not find any concrete answers... could you please guide? the ask is supoose an app is running at INFO level, due to some issues there needs to be a change to type DEBUG but app should not be restarted.
@technologyfornoobs Жыл бұрын
@@ShailajaKaustav Now I understand, I believe you are thinking of this to be done while launching the django server, I am saying you do not worry about it how to launch the server app, but have your logs accordingly and do it in the logging level rather than server start settings.
@ShailajaKaustav Жыл бұрын
@@technologyfornoobs Thanks a lot
@gops38434 жыл бұрын
tysm sir for this video and make video on emaillogger
@technologyfornoobs4 жыл бұрын
Will check about it.
@tarannumx5 ай бұрын
Good explanation sir 🎉🎉❤
@technologyfornoobs11 күн бұрын
Thanks and welcome
@techienomadiso89702 жыл бұрын
Superb !!! 🔥🔥🔥👌
@technologyfornoobs2 жыл бұрын
Thank you so much 😀
@sunny-lz6uy3 жыл бұрын
hello sir, i am doing a project in Django on E-Banking Log System in my college. I am facing some problem while generating the logs. Could you please help me with it sir.
@technologyfornoobs3 жыл бұрын
What I can do here?
@sunny-lz6uy3 жыл бұрын
@@technologyfornoobs Thank you for your reply sir, Could you please provide me with any means of personal contact with you (like your email info etc.)
@technologyfornoobs3 жыл бұрын
techfornoobs01@gmail.com
@sunny-lz6uy3 жыл бұрын
@@technologyfornoobs Sir, I have mailed you
@saonidas41403 жыл бұрын
is there any video to call a python script from html page with input parameters using django?
@technologyfornoobs3 жыл бұрын
Not exactly, but it's possible u need to use "exec" and eval
@mannshah68084 жыл бұрын
Good explanation
@technologyfornoobs4 жыл бұрын
Thanks and welcome
@shivamrohilla2083 жыл бұрын
can we store loggers and print them in some file
@technologyfornoobs3 жыл бұрын
yes, that's what is in the video, or I am missing something.
@revanthkumar34064 жыл бұрын
can you do authentication with otp in django
@technologyfornoobs4 жыл бұрын
OK, there are so many things which can do that like oauth and oauth2 , will update in a while
@revanthkumar34064 жыл бұрын
thank u so much...i tried but many errors are occurred.
@balajibalaji97063 жыл бұрын
How to add only the django logs in to text file, I tried the same but the logs are not storing in the text file
@technologyfornoobs3 жыл бұрын
That's the video is about follow from 11:20
@balajibalaji97063 жыл бұрын
I followed the same sir, but the logs are not printing in text file, do I need to install any additional module for this?
@technologyfornoobs3 жыл бұрын
Pull from github and check of the code works in yours and then check the diff what you are missing
@asaadqudsieh81083 жыл бұрын
how can i get user name in log?
@technologyfornoobs3 жыл бұрын
logger.info('add user')
@hacninetushar3 жыл бұрын
Great!
@technologyfornoobs3 жыл бұрын
Yo!
@MohsinKhan-ve1hn4 жыл бұрын
Hi, I tried your way for logging but i am getting this error raise ValueError('Unable to configure handler ' ValueError: Unable to configure handler 'file'
@technologyfornoobs4 жыл бұрын
If you have not created the log folder in your root path, this could create the issue, can you clone the repo and check where you are making mistake.
@MohsinKhan-ve1hn4 жыл бұрын
@@technologyfornoobs it is giving formatter error also raise ValueError('Unable to set formatter ' ValueError: Unable to set formatter 'simpleRe'
@technologyfornoobs4 жыл бұрын
Hi, I would still suggest cloning the project from github (github.com/sharmasw/DjangoLoggingApp) and run in your system, and you would be able to check the missing pieces in your code. If you look at the end of the dictionary below which is in the settings of the project, you will find the 'simpleRe' defined. this is missing in your settings for logging. LOGGING ={ 'version':1, 'loggers':{ 'django':{ 'handlers':['file','file2'], 'level':'DEBUG' } }, 'handlers':{ 'file':{ 'level':'INFO', 'class': 'logging.FileHandler', 'filename':'./logs/debug5.log', 'formatter':'simpleRe', }, 'file2':{ 'level':'DEBUG', 'class': 'logging.FileHandler', 'filename':'./logs/debug6.log', 'formatter':'simpleRe', } }, 'formatters':{ 'simpleRe': { 'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}', 'style': '{', } } }
@harshalizode3140 Жыл бұрын
You didn't explain the filter concept
@technologyfornoobs Жыл бұрын
I think I forgot, I will see when can I include it.
@mohamedferhi33324 жыл бұрын
how you can pass variables from django views.py to jupyter notebook ???
@technologyfornoobs4 жыл бұрын
Not possible!
@mohamedferhi33324 жыл бұрын
@@technologyfornoobs can i make code of jupyter notebook in my django project ? and where ? please i need help
@technologyfornoobs4 жыл бұрын
Code of jupyter notebook in django, you need to write the code of jupyter notebook into views or else but inside the project
@kunalsharma-zc2ho4 жыл бұрын
the logger is unable to write on file .although file is created but after re-deploying still it create the file but not writing and 'level':'DEBUG',
@kunalsharma-zc2ho4 жыл бұрын
can you tell me what can be reasons?
@technologyfornoobs4 жыл бұрын
might be you are looking for Level INFO and level DEBUG is filtering it, change it to INFO and you would see all the logs
@kunalsharma-zc2ho4 жыл бұрын
@@technologyfornoobs Actually I am looking for default generate logs at the development server and writing back to that file.
@technologyfornoobs4 жыл бұрын
Possible reason, you have missed the handler in logging setup: 'loggers':{ 'django':{ 'handlers':['file','file2'], 'level':'DEBUG' } },
Hi, thanks for this video, though I tried and played around with logging configuration, still not able to log server errors in a file or in admin mails. What could be the reason for this?? I am not getting any errors for this code but whenever server sends 500, it is not logged. LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'console': { 'format': '%(name)-12s %(levelname)-8s %(message)s', 'style': '{' }, 'file': { 'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s', 'style': '{' } }, 'filters': { 'require_debug_true': { '()': 'django.utils.log.RequireDebugTrue', }, 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse', } }, 'handlers': { 'console': { 'class': 'logging.StreamHandler', 'formatter': 'console' }, 'file': { 'level': 'INFO', 'class': 'logging.handlers.RotatingFileHandler', 'formatter': 'file', 'filename': os.path.join(BASE_DIR, 'server_error.log'), }, 'mail_admins': { 'level': 'INFO', 'class': 'django.utils.log.AdminEmailHandler', 'filters': [], 'include_html': True, } }, 'loggers': { '' :{ 'handlers': ['file','mail_admins'], 'level': 'INFO', 'propagate': True, }, 'django': { 'handlers': ['file','mail_admins'], 'level': 'INFO', 'propagate': True, }, }, }
@technologyfornoobs3 жыл бұрын
you need to handle 500 error responses, check for default 500 error in django
@hacninetushar3 жыл бұрын
If you make more videos like this!
@technologyfornoobs3 жыл бұрын
Sure!
@hacninetushar3 жыл бұрын
@@technologyfornoobs thanks.
@hacninetushar3 жыл бұрын
waiting for that..
@marbochengye33744 жыл бұрын
Hi! I am trying to create a history table that records all updates to the Product model. For example, if I have a model Product (name, price, description, status) and a history model (user,field,old_value, new_value, timestamp). I would like to be able to keep a history of this product's field changes overtime from creation up to now My history model would save the following values into history On create it saves as follow user = currentuser, field=name, old_value=None, new_value='Product', timestamp= 09/20/2020 10:12:02am user = currentuser, field=price, old_value=None, new_value=1, timestamp= 09/20/2020 10:12:02am user = currentuser, field=description, old_value=None, new_value="Product description", timestamp= 09/20/2020 10:12:02am user = currentuser, field=status, old_value=None, new_value='New;, timestamp= 09/20/2020 10:12:02am I then decide to update some fields fields price changes to 1 to 2 and status changes from new to old user = currentuser, field=price, old_value=1, new_value=2, timestamp= 09/21/2020 10:12:02am user = currentuser, field=status,old_value=new, new_value=old, timestamp=09/21/2020 10:12:02am I did some research and people recommend doing this by modifying the save method and some recommend using signals (pre_save, post_save). Do you have any recommendations? Or better yet, can you create a tutorial? I feel like this would be very useful :) Thanks!
@technologyfornoobs4 жыл бұрын
What I understood from your question is that you want to save all the info as soon as any new info comes you still want to save the old value. The biggest problem I see is how you are going to tell which record is most latest, as they are not clubbed together for creating single row info (name, product, price, etc) with the latest info of all the field, You need to get the latest for all the fields and then club them together which is an overkill for the task I guess. My suggestion > just simply have previous and current as a separate column in your model ('previous_name, current_name, previous_price, current_price, previous_descp, current_descp) and just simply update the current with new and previous with old. How you will do it? user will send the form, you take the filled value and just add the previous in "previous" and latest in the current field column.
@sambots224 жыл бұрын
@@technologyfornoobs I think the request is looking for is some kind of audit trail or audit log in Django project. The following links from PHP framework could be useful to adopt to the Python/Django project: www.radicore.org/viewarticle.php?article_id=4 and www.tonymarston.net/php-mysql/auditlog.html His recommendation of a separate database to host an audit logging facility at an application level is good but the challenge (disclaimer: I hear other ppl and had not confirmed) due to current Django version not supporting multiple databases. Lastly, with a few months with Django, the use of Django Signals (esp. post_save) may come handy here by implementing separately from the Product app. In any case, @Technology for Noobs for a great tutorial very clear. In production, I have been wondering how to go around the Server Error (500) in a website especially when DEBUG=False. Thanx..
@konchadasrinivas53104 жыл бұрын
How can we contact you sir.
@technologyfornoobs4 жыл бұрын
Email me @ techfornoobs01@gmail.com
@usamashabirVlog2 жыл бұрын
logger.info('some message') i am not seeing this in debug3.log file