Django Debug False 500 error Solved
Being involved in Full Stack Django/Python Web Application Development for 3 years now, I recently deployed my Django application on a test server and encountered Server Error (500) on Django when template debug is set to False. That is in Django settings.py, when I changed DEBUG = FALSE from DEBUG = TRUE, it caused 500 error.
I had upgraded my application from Django 1.4 to Django 1.7. I came to know that 500 error on DEBUG = False error is encountered by everyone using django 1.5 or greater as soon as they change their settings.py to DEBUG = False. Well my problem got solved after reading several blogs and digging deeper in the Django Docs for DEBUG = False ALLOWED_HOSTS settings.
What I did was, in settings.py, changed ALLOWED_HOSTS value in the following way:
If you have a domain name of your server, you may write:
Being involved in Full Stack Django/Python Web Application Development for 3 years now, I recently deployed my Django application on a test server and encountered Server Error (500) on Django when template debug is set to False. That is in Django settings.py, when I changed DEBUG = FALSE from DEBUG = TRUE, it caused 500 error.
I had upgraded my application from Django 1.4 to Django 1.7. I came to know that 500 error on DEBUG = False error is encountered by everyone using django 1.5 or greater as soon as they change their settings.py to DEBUG = False. Well my problem got solved after reading several blogs and digging deeper in the Django Docs for DEBUG = False ALLOWED_HOSTS settings.
What I did was, in settings.py, changed ALLOWED_HOSTS value in the following way:
ALLOWED_HOSTS = ['123.123.198.123'] # Above mentioned IP is not my actual IP. Enter your actual server IP or domain name here.
If you have a domain name of your server, you may write:
ALLOWED_HOSTS = ['www.example.com']You can also use a '*' wildcard to allow all hosts. But this is not recommended in the production environment.
ALLOWED_HOSTS = ['*']You can find a full detail regarding the ALLOWED_HOSTS settings here hidden deep inside django document
Your my hero. On my blog technelogos.com/blog, I've been trying to solve this error at least for the past few months. Nothing worked until I came across this blog post. I can't thank you enough!
ReplyDeleteGood job man!
ReplyDeletethanks!!!
ReplyDeleteSaved
Thank you...
ReplyDeleteGreat work man.Thank you
ReplyDelete(https://counfreedise.in/)
Very Helpful and informative blog! Keep sharing such blogsSoftware Development Company in India
ReplyDeleteNice! thank you so much! Thank you for sharing. Your blog posts are more interesting and informative. I think there are many people like and visit it regularly, including me. Custom Software Development Services
ReplyDeleteGreat ideas and relevant information about the software developer which are work for their convenience, thank you for the blog here alofatechlabs
ReplyDeletenice information thanks for sharing........................!
ReplyDeleteActive Directory online training
Active Directory training
Appian BPM online training
Appian BPM training
arcsight online training
arcsight training
Build and Release online training
Build and Release training
Dell Bhoomi online training
Dell Bhoomi training
Dot Net online training
Dot Net training
ETL Testing online training
ETL Testing training
Hadoop online training
Hadoop training
Tibco online training
Tibco training
Tibco spotfire online training
Tibco spotfire training
This is my first time i visit here. I found so many entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the leisure here! Keep up the good work. I have been meaning to write something like this on my website and you have given me an idea.
ReplyDeletedata science course in India
I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
ReplyDeleteArtificial Intelligence Course
Aivivu chuyên vé máy bay, tham khảo
ReplyDeletegiá vé máy bay tết
vé máy bay đi Mỹ tháng nào rẻ nhất
vé máy bay đi Pháp giá rẻ
vé máy bay đà nẵng đi hàn quốc
vé máy bay qua nhật
bay từ việt nam sang Anh mất bao lâu
săn vé máy bay 0 đồng
Đặt vé máy bay tại Aivivu, tham khảo
ReplyDeletevé máy bay đi Mỹ giá bao nhiêu
các chuyến bay từ mỹ về việt nam hiện nay
giá vé máy bay từ đức về việt nam
vé máy bay từ nga về tphcm
aşk kitapları
ReplyDeleteyoutube abone satın al
cami avizesi
cami avizeleri
avize cami
no deposit bonus forex 2021
takipçi satın al
takipçi satın al
takipçi satın al
takipcialdim.com/tiktok-takipci-satin-al/
instagram beğeni satın al
instagram beğeni satın al
btcturk
tiktok izlenme satın al
sms onay
youtube izlenme satın al
no deposit bonus forex 2021
tiktok jeton hilesi
tiktok beğeni satın al
binance
takipçi satın al
uc satın al
sms onay
sms onay
tiktok takipçi satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
instagram beğeni satın al
tiktok beğeni satın al
twitter takipçi satın al
trend topic satın al
youtube abone satın al
takipcialdim.com/instagram-begeni-satin-al/
perde modelleri
instagram takipçi satın al
instagram takipçi satın al
takipçi satın al
instagram takipçi satın al
betboo
marsbahis
sultanbet
I really enjoyed reading your blog. Great blog.
ReplyDeleteservicenow training and placement in hyderabad
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.
ReplyDeleteMulesoft training in hyderabad
Well explained, this post has the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
ReplyDeleteServiceNow Training in Chennai
This post is very simple to read and appreciate without leaving any details out. Great work !
ReplyDeleteServiceNow Training in Chennai
Retaining a fresh home is usually difficult, especially on the subject of the kitchen's. Refrigerators are likely to need far more care than most of them receive in addition to that’s the reason DIALAMAID is desirous to provide family fridge cleaning for addition to our housecleaning products and services. From leaking beverages to help remnants connected with food, products stored with your fridge can seem unattainable to retail store without anything getting found lacking. When people add that service on your cleaning approach, you can feel comfortable we’ll leave the medial side and away from your freezer looking including new. cleaning companies in dubai
ReplyDeleteđại lý vé Eva Air
ReplyDeletecách đổi trả vé máy bay China Airlines
muốn mua thêm hành lý ký gửi Japan Airlines
<a href="https://biggbossmalayalamvote.in/'> Bigg Boss Malayalam</a>
ReplyDeleteKeeping the refrigerator fresh and sanitized amid everyday spills and messes can be a challenge. That's why our home cleaning services now include thorough fridge cleaning. From wiped out shelves to sticky drawer pulls, we tackle the tough grime that builds up inside your fridge.
Our experts use eco-friendly solutions and powerful disinfectants to dissolve residues and eliminate odors. We scrub away sticky spills, clean out crisper drawers, and sanitize every surface to restore order. With deep cleaning services for both the interior and exterior, we'll have your fridge looking and smelling brand new again.
Trust us to handle the toughest dirt and grime so your fridge is always ready for safe food prep and storage. Our meticulous cleaning transforms your fridge, leaving every shelf, bin, and drawer refreshed. Contact us today to add expert fridge cleaning to your home services.
Wonderful blog you have here, but I was wondering if you knew of any forums that cover the same topics discussed in this article? I’d really like to be part of a community where I can get suggestions from other knowledgeable individuals who share the same interests. If you have any recommendations, please let gautham digital learning
ReplyDelete