# code running in development but not in production

**URL:** <https://forum.djangoproject.com/t/code-running-in-development-but-not-in-production/33801>\
**Category:** Mystery Errors\
**Created:** [August 12, 2024, 8:00pm UTC](https://forum.djangoproject.com/t/code-running-in-development-but-not-in-production/33801 "2024-08-12T20:00:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gutopro](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gutopro/32/22518_2.png) [@Gutopro](https://forum.djangoproject.com/u/Gutopro)\
**Post date:** [August 12, 2024, 8:00pm UTC](https://forum.djangoproject.com/t/code-running-in-development-but-not-in-production/33801/1 "2024-08-12T20:00:23Z")

</div>

Hi guys, i deployed my django api on `pythonanywhere ` when i pass the following data

```auto
{ "first_name" : "Eli", "last_name" : "Gut", "email" : "eligut@gmail.com", "phone_number" : "09022506312", "password" : "qwertyuiop"} 

```

i get this response

```auto
HTTP 400 Bad Request
Allow: GET, OPTIONS, POST
Content-Type: application/json
Vary: Accept

{
    "message": "Something went wrong",
    "error": {
        "first_name": [
            "This field is required."
        ],
        "last_name": [
            "This field is required."
        ],
        "email": [
            "This field is required."
        ],
        "phone_number": [
            "This field is required."
        ],
        "password": [
            "This field is required."
        ]
    }
} 

```

but it works perfectly in development

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [August 12, 2024, 8:03pm UTC](https://forum.djangoproject.com/t/code-running-in-development-but-not-in-production/33801/2 "2024-08-12T20:03:54Z")

</div>

Side note: When surrounding preformatted text with ```, the lines of ``` must be lines by themselves and not part of any other line. (I took the liberty of fixing your post for you.)

---

<div class="post-metadata">

**Author:** ![Gutopro](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/gutopro/32/22518_2.png) [@Gutopro](https://forum.djangoproject.com/u/Gutopro)\
**Post date:** [August 12, 2024, 8:05pm UTC](https://forum.djangoproject.com/t/code-running-in-development-but-not-in-production/33801/3 "2024-08-12T20:05:17Z")

</div>

thank you @KenWhitesell
