0

I just launched the Django app. As an image, everything is in place, but the form and admin panel do not work. Anyone who knows please help

I get this error when I run the form. enter image description here

Let me know if I need to share any code.

model.py

from django.db import models

# Create your models here.

class Form(models.Model):
fname_lname = models.CharField(max_length=50, verbose_name="Ad Soyad")
number = models.CharField(max_length=20, verbose_name="Nömrə")
send_date = models.DateTimeField(auto_now_add=True, verbose_name="Tarix")

class Meta:
    verbose_name = 'Formlar'
    verbose_name_plural = 'Formlar'

def __str__(self):
    return self.fname_lname
sohretaga
  • 69
  • 1
  • 9

2 Answers2

1

As Marco suggested, once you deploy you should run your migrations since you're probably using a different database. You run migrations same as when in development depending on your platform the following should work:

python manage.py makemigrations
python manage.py migrate

just make sure you are on the same directory as the manage.py file. Also remember that you will have to tweak the settings.py file database settings if you haven't already.

fkay
  • 184
  • 1
  • 10
0

try the commands below: python manage.py makemigrations --fake python manage.py migrate --fake

if it donot work, i think you have to delete database and recreate it,

if you need the data you can use python manage.py dumbdata ->data.json and after you create the new database use python manage.py loaddata data.json