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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:23:41+00:00 2026-05-22T12:23:41+00:00

I am trying to use Django with jquery UI autocomplete but having trouble sending

  • 0

I am trying to use Django with jquery UI autocomplete but having trouble sending response.

Here is my code:

def ajax_tags_autocomplete(request):
    """ Autocomplete for tag list """
    beginning_of_title = request.GET.get('term', '')
    tags_found = Tag.objects.values_list('title', flat=True).filter(title__startswith=beginning_of_title)
    return HttpResponse(json.dumps(tags_found), mimetype='application/json')

I get an error:

[u"php"] is not JSON serializable

Why? It is not possible to serialize a list? What should I pass to the serializer, then?

I would be greatful for any advice.

  • 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-22T12:23:41+00:00Added an answer on May 22, 2026 at 12:23 pm

    Are you sure it’s actually a list containing unicode objects and not a list containing some database objects? The u"php" might just be the repr() of the object.

    Try json.dumps([unicode(t) for t in tags_found]) or json.dumps(map(unicode, tags_found))

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

Sidebar

Related Questions

I'm building a Django site and trying to use the request.is_ajax() function... But it's
Im trying to use django send_email function but it fails on authentication. In fact,
I am trying to use Django in Eclipse, but I have no idea how
I'm developing a Django app, and I'm trying to use Python's logging module for
I'm trying to decide whether to use a Rails or a Django guru to
Trying to use a guid as a resource id in a rest url but
Let's say trying to use django.views.generic.create_update.create_object to allow the user to a blog entry
I'm trying to use Django transactions on MySQL with the commit_on_success decorator . According
I'm trying to use Django's annotate feature to add the count of a related
I have multiple forms in a Django project. I was trying to use the

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.