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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:40:07+00:00 2026-05-28T20:40:07+00:00

Hi Stackoverflow people, I do my first steps with GeoDjango and I am looking

  • 0

Hi Stackoverflow people,

I do my first steps with GeoDjango and I am looking for better options to check faulty sql statements.

So far, I simply wanted to safe a lng+lat point in my postgresql table.

The model is defined with:

    geolocation = models.PointField(_('Geo Location'), 
                geography=True, 
                null = True, 
                blank = True,
                help_text=_('Geolocation with Longitude and Latitude'))

    objects = models.GeoManager()

In my view, I try to execute the following command

savedProject.geolocation = GEOSGeometry('POINT(%s %s)' %(u_lng,u_lat))

but I receive the following error when I try to save the form:

Exception Type: InternalError
Exception Value: current transaction is
aborted, commands ignored until end of transaction block

What is the reason for this error? I believe that there could be something wrong with the sql statement, but what is the best way to check? Django just provides with general error message “Internal Error”.

Thank you for your help and suggestions!

  • 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-28T20:40:08+00:00Added an answer on May 28, 2026 at 8:40 pm

    In most cases this means that the previous SQL statement failed to execute. In this case you should:

    1. Enable SQL logging, see the following snippet to paste in settings.py

    2. Set DEBUG=1, or SQL won’t be logged

    3. Run runserver again, and you should see all SQL queries in the console

    4. Execute the last SQL queries directly in your database, you should then find which queries fail and then you should be able to debug them – or open a new question which is specific to the query that causes the problem. You can use phpMyAdmin, or directly a CLI client, or whatever database client, to execute the SQL queries one by one until you find the one that needs some love.

    SQL Logging configuration:

    LOGGING = { 
       'version': 1,
       'disable_existing_loggers': True,
       'formatters': {
           'simple': {
               'format': '%(levelname)s %(message)s',
           },  
       },  
       'handlers': {
           'console':{
               'level':'DEBUG',
               'class':'logging.StreamHandler',
               'formatter': 'simple'
           },  
       },  
       'loggers': {
           'django': {
               'handlers': ['console'],
               'level': 'DEBUG',
           },  
       }   
    }
    

    If this configuration does not provide any additional console output with runserver, then feel free to try django-autocomplete-light’s example test_project:

    1. Read and paste the installation commands in /tmp

    2. Change dir to autocomplete_light_env/src/django-autocomplete-light/test_project

    3. Open test_project/settings.py, replace the LOGGING configuration by the one above

    4. Runserver and open your browser

    Your console will look like:

    Validating models...
    
    0 errors found
    Django version 1.4.1, using settings 'test_project.settings'
    Development server is running at http://127.0.0.1:8000/
    Quit the server with CONTROL-C.
    DEBUG (0.001) SELECT "django_content_type"."id", "django_content_type"."name", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."model" = taggable  AND "django_content_type"."app_label" = charfield_autocomplete ); args=('taggable', 'charfield_autocomplete')
    DEBUG (0.000) 
            SELECT DISTINCT "tagging_tag".id, "tagging_tag".name
            FROM
                "tagging_tag"
                INNER JOIN "tagging_taggeditem"
                    ON "tagging_tag".id = "tagging_taggeditem".tag_id
                INNER JOIN "charfield_autocomplete_taggable"
                    ON "tagging_taggeditem".object_id = "charfield_autocomplete_taggable"."id"
    
            WHERE "tagging_taggeditem".content_type_id = 11
    
            GROUP BY "tagging_tag".id, "tagging_tag".name
    
            ORDER BY "tagging_tag".name ASC; args=[]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello again Stackoverflow people! Assume I have these words: smartphones, smartphone I want to
Hi people stackoverflow. I'm working with MVVM, I have ViewModel call UserViewModel with a
With the help of people on stackoverflow I was able to get the following
Hi Stackoverflow people, In the past, I always developed my Django projects locally with
Since this is my first question here on stackoverflow I hope my question is
This is actually my very first question on Stackoverflow. I hope its not the
First of all I am not asking for people to do my homework like
Hellow stackoverflow people, I am pretty new to Cocoa. I have XCode 3.1 Situation:
First of all hello people, and sorry for my bad English, I'm Brazillian! I've
This is my first time on stackoverflow asking questions so I will try my

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.