Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I've got an app running on Heroku with Django, the local DB I use SQLite, but on Heroku the app uses PostgreSQL.

I'm having a problem and I've no idea why is happening. Let me explain myself:

I select an object from DB by it's id, locally it works perfectly, but on Heroku, the result is that it cannot find the object.

I know that the id of the object is correct, and the way I'm trying to select the object is the same as the way I did dozens of times.

Here's the code that haves the issue:

data = simplejson.loads(request.raw_post_data)
if 'id' and 'type' in data:
  ide=data['id']
  type=data['type']
  if type == 'selection':
    if ObjSel.objects.filter(id=ide).exists():
      ej = ObjSel.objects.get(id=ide)
      [....]
    else:
      return HttpResponse(
          simplejson.dumps({'result': 'fail', 'message': 'Object not found'}), 
          mimetype='application/json'
      )

Hope you can help me.

share|improve this question
the mysql is there because in local the DB is mysql, not postgresql – Sascuash 14 hours ago
sorry, it's sqlite – Sascuash 13 hours ago
Thanks for fixing all that up; I've removed the now irrelevant comments and reversed my downvote. Now ... can you show the actual SQL query that Django runs? (You might need to enable extra logging/tracing in Django). It's hard to say what could be going on without that. You can edit your question to add the info. – Craig Ringer 13 hours ago

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.