On the server, change the following in settings
DEBUG = True # django will tell what cause the error
instead of error500
ALLOWED_HOST = ["*"] # this allow all hosts but you should do this only
for testing
most of the time, error 500 often cause from database connection
problems in server side, you should create new user in database and give
permissions to that user (do no use root user)
ในวันที่ วันพฤหัสบดีที่ 6 กรกฎาคม ค.ศ. 2023 เวลา 0 นาฬิกา 49 นาที 56 วินาที
UTC+7 Bouka Largent เขียนว่า:
> hello
>
> Le mar. 4 juil. 2023, 4:44, Theresa Taye <[email protected]> a écrit :
>
>> Hello,
>>
>> You see a Server error because Debug is set to False. To know what the
>> actual error is, turn it back to True. Then when you are done debugging you
>> can change that especially if you are pushing to production.
>>
>> On Tue, 4 Jul 2023 at 16:21, Abdoulaye SENE <[email protected]>
>> wrote:
>>
>>> thanks for the help. but after writing ["*"] i see Server Error (500)
>>>
>>> Le mardi 4 juillet 2023 à 14:46:01 UTC, ALBERT ASHABA AHEEBWA a écrit :
>>>
>>>> Sorry I meant turn
>>>> DEBUG = True
>>>>
>>>>
>>>>
>>>>
>>>> Best Regards,
>>>>
>>>> Albert Ashaba Aheebwa
>>>> +256 781 435857 <+256%20781%20435857>
>>>>
>>>> On Tue, 4 Jul 2023, 17:44 ALBERT ASHABA AHEEBWA, <
>>>> [email protected]> wrote:
>>>>
>>>>> Go to your settings.py and look for allowed_hosts and make it
>>>>> ALLOWED_HOSTS = ["*"]
>>>>>
>>>>> or better yet, if you are in development, turn
>>>>> DEBUG = False
>>>>>
>>>>>
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Albert Ashaba Aheebwa
>>>>> +256 781 435857 <+256%20781%20435857>
>>>>>
>>>>> On Tue, 4 Jul 2023, 17:38 Abdoulaye SENE, <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> hello,
>>>>>> while programming, i see this problem : " CommandError: You must set
>>>>>> settings.ALLOWED_HOSTS if DEBUG is False."
>>>>>> i wonder if someone can help me to fix it.
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Django users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/django-users/171c894c-5f04-445d-939f-c6c949caae35n%40googlegroups.com
>>>>>>
>>>>>> <https://groups.google.com/d/msgid/django-users/171c894c-5f04-445d-939f-c6c949caae35n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/82b9160b-6056-4cc6-9fa5-6d52de5512a1n%40googlegroups.com
>>>
>>> <https://groups.google.com/d/msgid/django-users/82b9160b-6056-4cc6-9fa5-6d52de5512a1n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>>
> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAENBRfMNWVA-_jm0eUiDGSL-1kQJvDsLnXGjZ870aivXFEDfCA%40mail.gmail.com
>>
>> <https://groups.google.com/d/msgid/django-users/CAENBRfMNWVA-_jm0eUiDGSL-1kQJvDsLnXGjZ870aivXFEDfCA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/8663160e-338a-44f6-97df-9c6fab6b1cecn%40googlegroups.com.