Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8394247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:00:27+00:00 2026-06-09T20:00:27+00:00

I am running a Django site on Apache which is front’ed by Nginx instance

  • 0

I am running a Django site on Apache which is front’ed by Nginx instance to serve my static media.

I expose an API via django-tastypie to a model that I need to PATCH a field on. When I do local testing (via the django runserver) everything works as expected. On the live server however I get “400 (Bad Request)” returned.

I’ve read a few places saying that Nginx does not support PATCH? Is that right? Is there a good workaround for this? Am I doing something wrong?

I only send through the fields I want to update via the postData.

JQuery Code:

$.ajax({url: '...',
    type: 'PATCH',
    accepts: 'application/json',
    contentType: 'application/json',
    dataType: 'json',
    data: postData,
    processData: false,
    success: function() {
        // Success Code!
    },
    error: function() {
        // Error Code!
    }
});

Tastypie Resource:

class ReceivedMessageResource(ModelResource):
    """
    """
    campaign = fields.ForeignKey(CampaignResource, 'campaign')
    campaign_name = fields.CharField(readonly=True)
    campaign_id = fields.IntegerField(readonly=True)
    message_type = fields.CharField(readonly=True)
    display_date = fields.CharField(readonly=True)
    attachments = fields.ToManyField('apps.campaign.api.AttachmentResource',
                                     'attachment_set',
                                     related_name='message',
                                     full=True)

    class Meta:
        queryset = ReceivedMessage.objects.all()
        resource_name = 'message'
        filtering = {'id': ALL,
                     'campaign': ALL_WITH_RELATIONS}
        excludes = ['reason', 'provider', 'loyalty_profile', 'original_message', 'date_received']
        allowed_methods = ['get', 'post', 'put', 'delete', 'patch']
        paginator_class = ReceivedMessagesPaginator
        authentication = ApiKeyAuthentication()
        authorization = DjangoAuthorization()

Any direction on how to sort this will be appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:00:29+00:00Added an answer on June 9, 2026 at 8:00 pm

    If you are using the latest version of TastyPie (the one from GitHub repository, since August 5th), you can follow the instructions from the documentation:

    Using PUT/DELETE/PATCH In Unsupported Places

    Some places, like in certain browsers or hosts, don’t allow the PUT/DELETE/PATCH methods. In these environments, you can simulate those kinds of requests by providing an X-HTTP-Method-Override header. For example, to send a PATCH request over POST, you’d send a request like:

    curl --dump-header - -H "Content-Type: application/json" -H "X-HTTP-Method-Override: PATCH" -X POST --data '{"title": "I Visited Grandma Today"}' http://localhost:8000/api/v1/entry/1/
    

    So if your host does not support this method, add X-HTTP-Method-Override header with the name of the method you are trying to perform.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We've got a server over which we're running a Django powered site. Since we
I am running Django site in Apache with mod_wsgi. The site works before .
I have a Django app running on Windows (via Apache + mod_wsgi) that's CPU-bound.
I've got django running in uwsgi behind nginx. When I try to access https://site/admin/
I had a Django site running on Dreamhost. Although I used SQLite when developing
I have a site running in django and want to make it available on
I am running django simple server via manage.py runserver. With a client code I
I'm running Django through mod_wsgi and Apache (2.2.8) on Ubuntu 8.04. I've been running
I have a django site running on 1.2.1, and once in a while my
I'm running Django on Ubuntu Server 9.04. Django works well, but nginx doesn't return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.