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 7591701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:42:57+00:00 2026-05-30T20:42:57+00:00

I Have just started with django-rest-framework. Pretty enthousiastic about it, except for the fact

  • 0

I Have just started with django-rest-framework.
Pretty enthousiastic about it, except for the fact there are very little examples available.
getting the api working is going great, but all the extra’s is a puzzle.
(adding extra custom fields etc.)

Now I wonder how you can restrict the allowed_methods in for example a ListView or a DetailView.
Adding this to the class in the views.py like I read somewhere as an answer… does not seem to have any effect:

allowed_methods = ('GET',)
  • 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-05-30T20:42:58+00:00Added an answer on May 30, 2026 at 8:42 pm

    Probably not relevant anymore based on recent years downvotes.. It was relevant in ’12 tho 🙂

    Django-rest-framework actually have very many examples..

    Take a look at http://django-rest-framework.org, http://django-rest-framework.org/contents.html and http://rest.ep.io/ for some good examples and documentation.

    If you are designing a REST function by yourself, not using any of the django-rest-framework magic (like rest.ep.io) to generate it for you, you should look into mixin (http://django-rest-framework.org/howto/mixin.html).

    If you want to restrict to only get methods. Just use def get(…) and the mixin class.

    Example from link provided:

    curl -X GET http://rest.ep.io/mixin/
    

    urls.py

    from djangorestframework.compat import View
    from djangorestframework.mixins import ResponseMixin
    from djangorestframework.renderers import DEFAULT_RENDERERS
    from djangorestframework.response import Response
    
    from django.conf.urls.defaults import patterns, url
    from django.core.urlresolvers import reverse
    
    
    class ExampleView(ResponseMixin, View):
        renderers = DEFAULT_RENDERERS
    
        def get(self, request):
            response = Response(200, {'description': 'Some example content',
                                      'url': reverse('mixin-view')})
            return self.render(response)
    
    
    urlpatterns = patterns('',
        url(r'^$', ExampleView.as_view(), name='mixin-view'),
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started using django for development. At the moment, I have the following
I have just started using Boost 1.36. These libraries would be very useful in
I have just started migrating my homegrown persistence framework to JPA. Given that the
I have just started implementing signal listeners in a django project. While I understand
I have made an online gallery using Python and Django. I've just started to
I have a model which is essentially just a string (django.db.models.CharField). There will only
I have just started a feasibility study on Django for my company and I
I started using django framework just a few days ago and i desperately need
I have just started learning about Android and I was planning on making a
I have just started learning django. I created a form from django models. On

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.