Thursday, May 30, 2013

SyncDb doesn't create tables

Hello all,

I am trying to create a table in my DB using models.py and the ./manage.py  syncdb command.

But what i notice is that anything is being inserted even though i can run this commad : ./manage.py sqlall testapp (where testapp is my app) and get the sql that permit to create the table.

here is my models.py file : 

#geographical database for storing entities coordinates
class pointsOfInterest(gis.Model):
    nodeid = gis.IntegerField() #add an index over ths column to speed up search for coordinates
    longitude = gis.FloatField()
    latitude = gis.FloatField()

    # GeoDjango-specific: a geometry field (MultiPolygonField), and
    # overriding the default manager with a GeoManager instance.
    objects = gis.GeoManager()

i added the application and database declaration in the settings.py file : 
DATABASES = {
    'default': {
         'ENGINE': 'django.contrib.gis.db.backends.postgis',
         'NAME': 'geodjango',
         'USER': 'postgres',
     }
}

and in the installed apps.:
    'testNeo4Django.testapp',
    'django.contrib.gis', 


and when i run the command : python manage.py sqlall testapp , i get the sql responsible for creating the pointsOfInterest table : 
BEGIN;  CREATE TABLE "testapp_pointsofinterest" (      "id" serial NOT NULL PRIMARY KEY,      "nodeid" integer NOT NULL,      "longitude" double precision NOT NULL,      "latitude" double precision NOT NULL  )    
COMMIT;

but when i eventually need to create the table using python manage.py syncdb, nothing is being created !!! and i am getting back this message : 
 
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Any ideas about this ??

Thanks for your help 

Anas 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment