About 6,340,000 results
Open links in new tab
  1. How to do an OR filter in a Django query? - Stack Overflow

    Sep 26, 2024 · 506 I want to be able to list the items that either a user has added (they are listed as the creator) or the item has been approved. So I basically need to select: item.creator = …

  2. python - What is the difference between Django and Django Rest ...

    Now, Django vs Django Rest Framework. You can use Django alone to make REST APIs, but you have to write more code and do more design like one of the comment above showing in the …

  3. django - CSRF Failed: CSRF token missing or incorrect - Stack …

    Django REST Framework enforces this, only for SessionAuthentication, so you must pass the CSRF token in the X-CSRFToken header. The Django documentation provides more …

  4. python - Django TemplateDoesNotExist? - Stack Overflow

    Dec 18, 2009 · My local machine is running Python 2.5 and Nginx on Ubuntu 8.10, with Django builded from latest development trunk. For every URL I request, it throws: …

  5. Running Django server on localhost - Stack Overflow

    Dec 11, 2017 · I would like to run a Django server locally using a local IP. I have localhost mapped here: $ head -n 1 /etc/hosts 127.0.0.1 localhost I have this chunk of code in my …

  6. How to perform OR condition in django queryset? - Stack Overflow

    I want to write a Django query equivalent to this SQL query: SELECT * from user where income >= 5000 or income is NULL. How to construct the Django queryset filter? …

  7. Creating a JSON response using Django and Python

    Its very convenient with Django version 1.7 or higher as you have the JsonResponse class, which is a subclass of HttpResponse. from django.http import JsonResponse

  8. How to perform raw SQL queries in Django views? - Stack Overflow

    The Django Documentation is really really good. You have basically two options to execute raw SQL. You can use Manager.raw() to perform raw queries which return model instances, or you …

  9. How to override and extend basic Django admin templates?

    Jul 5, 2011 · 90 As for Django 1.8 being the current release, there is no need to symlink, copy the admin/templates to your project folder, or install middlewares as suggested by the answers …

  10. django - Select distinct values from a table field - Stack Overflow

    Mar 18, 2010 · I'm struggling getting my head around the Django's ORM. What I want to do is get a list of distinct values within a field on my table .... the equivalent of one of the following: …