Why is the error appearing in django/admin? Migrations ok, I need to have 3 items in the table where I will have results.
class Robot(models.Model):
"""Robot model, speed and position simulation"""
product = models.IntegerField(choices=CHOOSE)
velocity = models.FloatField()
positionX = models.FloatField()
positionY = models.FloatField()
angleTHETA = models.FloatField()
class Meta:`enter code here`
verbose_name = "Robot"
verbose_name_plural = "Robots"
def __str__(self):
resum = self.get_product_display()
return resum
ProgrammingError at /admin/robot/robot/ column robot_robot.velocity does not exist LINE 1: ...LECT "robot_robot"."id", "robot_robot"."product", "robot_rob...
==== Hello, can someone help me with the above problem, I keep getting this error: django.db.utils.ProgrammingError: relation "robot_cleanrobot" does not exist LINE 1: SELECT COUNT(*) AS "__count" FROM "robot_cleanrobot"
- first migrations done
- then pip install -r requirements.txt
- python manage.py startapp
- settings
- makemigrations & migrate
- add model
- register a view
nothing helps me, I have done many times from scratch, even deleted the whole directory and also nothing,
I changed the model in the new project and nothing
At the beginning it worked ok for the first time, but when I added the float it all went down - I do not know what to do about it. Please help. Thx.
class CleanRobot(models.Model):
"""..."""
name = models.CharField(max_length=100, null=True, blank=True)
class Meta:
verbose_name = "CleanRobot"
verbose_name_plural = "CleanRobots"
def __str__(self):
return self.name
================================= Ok, not working: ok step by step what i am doing:
- i create a django project
- enable (venv)
- makemigrations
- migrate
- pip install -r requirements.txt
- copy to settinigs_local project
- python manage.py start app
- change settings - add code -> reference to local register application
- add code to models
- register models
- makemigrations
- migrate
- runserver
- dajngo/admin ... Add is ok, by name entering I get error... I have other projects on my computer and they work normally... I have other projects on my computer and they work normally... not today I have deleted the whole folder for the 20th time...
CodePudding user response:
You are getting the error because the database fields that you requested probably do not exist. Remember to run both
and also you should have a new non-empty file in your app's migrations
folder. Then run migrate
command. You should see something like:
If something went wrong, post the message you did get.
CodePudding user response:
Works: I don't know which of these things worked but:
- i had alpha name and alpha project name so i changed to alphaapp,
- after migration 2 I created a new superuser
Maybe this will be useful for someone ;)