cannot accessing a simple database in django
<p>I went through the django doc polls example. Now I have a database <code>name.info.db</code> available. I put it in same directory as manage.py, also where db.sqlite3 is. 
I changed <code>settings.py</code> to</p>

<pre><code>DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': os.path.join(BASE_DIR, 'name.info.db'),
}}
</code></pre>

<p>My models.py is</p>

<pre><code>class PItable(models.Model):
    pid_text = models.CharField(max_length=200)
    lname_text = models.CharField(max_length=200, null=True)
    fname_text = models.CharField(max_length=200, null=True)
    affs_text = models.CharField(max_length=2000, null=True)
    pmidlist_text = models.CharField(max_length=2000, null=True)
    clustering_text = models.CharField(max_length=2000, null=True)
    def __str__(self):
        return self.fname_text
</code></pre>

<p>I deleted Question and Choice(from polls example) from views and models.
I did</p>

<pre><code>python manage.py makemigrations pidb
python manage.py migrate
</code></pre>

<p>I got the following message which didn't show my database, still showed the deleted models(Question, Choice). What did I do wrong here? When I access from python shell <code>PItable.objects.filter(id=1)</code>, it shows empty[]. Thanks for any help!!</p>

<pre><code>$ python manage.py sqlmigrate pidb 0001

BEGIN;
--
-- Create model Choice
--
CREATE TABLE "pidb_choice" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "choice_text" varchar(200) NOT NULL, "votes" integer NOT NULL);
--
-- Create model Question
--
CREATE TABLE "pidb_question" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "question_text" varchar(200) NOT NULL, "pub_date" datetime NOT NULL);
--
-- Add field question to choice
--
ALTER TABLE "pidb_choice" RENAME TO "pidb_choice__old";
CREATE TABLE "pidb_choice" ("id" integer NOT NULL PRIMARY KEY  AUTOINCREMENT, "choice_text" varchar(200) NOT NULL, "votes" integer NOT NULL, "question_id" integer NOT NULL REFERENCES "pidb_question" ("id"));
INSERT INTO "pidb_choice" ("id", "choice_text", "question_id", "votes") SELECT "id", "choice_text", NULL, "votes" FROM "pidb_choice__old";
DROP TABLE "pidb_choice__old";
CREATE INDEX "pidb_choice_7aa0f6ee" ON "pidb_choice" ("question_id");

COMMIT;
</code></pre>

<p>Read about <a href="https://docs.djangoproject.com/en/1.10/ref/models/options/#managed" rel="nofollow">managed option</a>. If You set it to <code>False</code>, no database table creation or deletion operations will be performed for this model. This is useful if the model represents an existing table or a database view that has been created by some other means.</p>

<pre><code>class PItable(models.Model):
    pid_text = models.CharField(max_length=200)
    lname_text = models.CharField(max_length=200, null=True)
    fname_text = models.CharField(max_length=200, null=True)
    affs_text = models.CharField(max_length=2000, null=True)
    pmidlist_text = models.CharField(max_length=2000, null=True)
    clustering_text = models.CharField(max_length=2000, null=True)

    class Meta(object):
        managed = False

    def __str__(self):
        return self.fname_text
</code></pre>

python django database