Django: syncdb not able to add any model in data base
Question: I'm new with Django and I'm not able to add any model to my DB?? Ok,this is
the Portfolio model :

    
    
    from django.db import models
    from core.models import Unit
    
    
    # Create your models here.
    class Portfolio(models.Model):
        """
        Generic class to portfolios
        """
        name = models.CharField(_('Name'), max_length=255)
        youtube_id = models.CharField(_('Youtube_id'), max_length=255)
        url_doc = models.CharField(_('Url_doc'), max_length=255)
        data = models.TextField()
        unit = models.ForeignKey(Unit, verbose_name=_('Unit'), null=True, blank=True,     related_name='portfolios')
        comment = models.TextField(_('Comment'), blank=True)
    
        class Meta:
            verbose_name = _('Portfolio')
            verbose_name_plural = _('Portfolios')
            ordering = [('id')]
            abstract = True
    
        def __unicode__(self):
            return u'%s' % (self.name)
    

and this is the result of **python manage.py syncdb** :

    
    
    Syncing...
    Creating tables ...
    Installing custom SQL ...
    Installing indexes ...
    Installed 0 object(s) from 0 fixture(s)
    

all is alright but the table isn't created !!!!

and this is the setting.py file :

    
    
    DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',  # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'timtec.sqlite',                # Or path to database file if using sqlite3.
        # The following settings are not used with sqlite3:
        'USER': '',
        'PASSWORD': '',
        'HOST': '',                      
    # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
        'PORT': '',  
                 # Set to empty string for default.
      }
     }                                                     
     INSTALLED_APPS = (
    'django_extensions',
    'south',
    'pipeline',
    'suit',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.flatpages',
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    'django.contrib.admindocs',
    'rest_framework',
    'rosetta',
    'autoslug',
    
    'core',
    'accounts',
    'activities',
    'administration',
    'forum',
    'course_material',
    'notes',
    'reports',
    'portfolio',
    
    'metron',
    
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'allauth.socialaccount.providers.facebook',
    
    'django_markdown',
    
    # raven has to be the last one
    'raven.contrib.django.raven_compat',
    )
    

thanks :)


Answer: Django won't generate database tables for models which are Abstract. You
should inherit from abstract class or simply remove `abstract = True` line in
Meta class.

