Couldn't syncdb in Django while trying to create table

114 Views Asked by At

This is showing while I am trying to create table using model . I have tried several things but not working .

Command line

(test_env) C:\Users\User\Desktop\test_env\src>python manage.py syncdb 
Operations to perform:   
Apply all migrations: admin, contenttypes, joins, auth, sessions 

Running migrations:   
No migrations to apply.

My model

from django.db import models

class Join(models.Model):
    emai = models.EmailField()
    timestamp = models.DateTimeField(auto_now_add = True, auto_now=False)
    updated = models.DateTimeField(auto_now_add = False, auto_now=True)

    def __unicode__(self):
        return "Join"

Settings.py

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'joins',
)

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}
1

There are 1 best solutions below

1
doniyor On

run first

python manage.py makemigrations joins

and then

python manage.py migrate