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

  • Home
  • SEARCH
  • 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 8629927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:55:57+00:00 2026-06-12T08:55:57+00:00

I have a Django app that’s serving up a RESTful API using tasty-pie. I’m

  • 0

I have a Django app that’s serving up a RESTful API using tasty-pie.

I’m using Django’s development runserver to test.

When I access it via a browser it works fine, and using Curl also works fine:

curl "http://localhost:8000/api/v1/host/?name__regex=&format=json"

On the console with runserver, I see:

[02/Oct/2012 17:24:20] "GET /api/v1/host/?name__regex=&format=json HTTP/1.1" 200 2845

However, when I try to use the Python requests module (http://docs.python-requests.org/en/latest/), I get a 404 as the output:

>>> r = requests.get('http://localhost:8000/api/v1/host/?name__regex=&format=json')
>>> r
<Response [404]>

or:

>>> r = requests.get('http://localhost:8000/api/v1/host/?name__regex=&amp;format=json')
>>> r
<Response [404]>

Also, on the Django runserver console, I see:

[02/Oct/2012 17:25:01] "GET http://localhost:8000/api/v1/host/?name__regex=&format=json HTTP/1.1" 404 161072

For some reason, when I use requests, it prints out the whole request URL, including localhost – but not when I use the browser, or curl.

I’m assuming this is something to do with the encoding, user-agent or request type it’s sending?

  • 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-12T08:55:58+00:00Added an answer on June 12, 2026 at 8:55 am

    I’m not very familiar with Requests, but I think your encoding idea might be sound. That is Requests might process the URL somehow? Perhaps instead of passing everything in the URL directly, try doing what Requests docs suggest:

    request_params = { 'name_regex' : '', 'format' : 'json' }
    r = requests.get( 'http://localhost:8000/api/v1/host/', params = request_params )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a Django app that processes test results, and I'm trying to
I have a simple django app that is using only the admin. This is
I have a Django app that gets it's data completely from an external source
I have a Django app that use a django-tagging. I need to port this
I have a django app that I made and have implemented a plist into
This is probably a setting error somewhere. I have a django app that works
I have a Django app where multiple teams upload content that will be parsed.
I have a client that has an app built with django. On every page
I have a Django app that uses MySQL as a backend. I'm having difficulties
I have a django app that has / at the end of every URL

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.