The one thing that I really prefer from DRF's statuses is their name, containing the status_code. I used python's `http.HTTPStatus` in a flask project and I had to have the python docs open all the time to map between the status code and the name of the status. For example: - http.HTTPStatus.BAD_GATEWAY - rest_framework.status.HTTP_502_BAD_GATEWAY
I don't know if it's enough of an argument to justify maintaining extra code in Django, but as Carlton said, it's just a file with constants. If you look at the file in DRF, there haven been very little changes to it https://github.com/encode/django-rest-framework/commits/master/rest_framework/status.py and in my opinion, it does make the developer experience nicer. Best, Arthur On March 23, 2021 at 9:24:32 AM, 'Adam Johnson' via Django developers (Contributions to Django itself) (django-developers@googlegroups.com) wrote: Python 3.5 added http.HTTPStatus: https://docs.python.org/3.9/library/http.html#http.HTTPStatus , so I don't see a need for such constants in Django, unless they add something extra. Perhaps you could deprecate from DRF. On Tue, 23 Mar 2021 at 15:18, Carlton Gibson <carlton.gib...@gmail.com> wrote: > Hiya. > > Maybe my search-foo is down but, surprisingly, I couldn't find a > discussion on this. > > Should we maybe bring the HTTP status code constants that we find in > rest_framework.status into core, as django.http.status? > > I find myself wanting them (not for the first time) in a project that > doesn't really depend on DRF, and thinking (surely) these fit comfortably > in Django's "I'm a web framework" remit. 🤔 > > Can I solicit opinions on that please? It's just a list of constants so... > It seems to fit the "bring some of the more reusable bits of DRF into > core" theme. > > Thanks. > > Kind regards, > Carlton > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/541cf57b-f369-4dc9-a06e-e3ff8bf4485cn%40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/541cf57b-f369-4dc9-a06e-e3ff8bf4485cn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Adam -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM0F9Ly_SMLnSvZRsO4%2BY_Zum9r%2BpvM1H4ZAAgF3mb%2BV3Q%40mail.gmail.com <https://groups.google.com/d/msgid/django-developers/CAMyDDM0F9Ly_SMLnSvZRsO4%2BY_Zum9r%2BpvM1H4ZAAgF3mb%2BV3Q%40mail.gmail.com?utm_medium=email&utm_source=footer> . -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CADOBPEEfe_5bhizzaE74fmvcwpmYC5NOb5NA2yVqt_n%2BrDE5mA%40mail.gmail.com.