要设置setting.py中的下面两项 DEBUG = False
#ALLOWED_HOSTS = [] ALLOWED_HOSTS = [’*’]
然后再在templates下面设置404.html和500.html