When I move to the url and move to my product as shown in the image above, I get an error.
from django.db import models #Create your models here. class Product (models.Model): title = models.CharField (max_length = 120) description = models.TextField (null = True) price = models.DecimalField (decimal_places = 2, max_digits = 10000) #This is the cause of the error summary = models.TextField (null = True)
I know where the error is, but I don't know why.
What should I do?
In the terminal, type python manage.py makemigraitions
You are trying to change the nullable field'title' on product to non-nullable without a default;we can't do that (the database needs something to populate existing rows). Please select a fix: 1) Provide a one-off default now (will be set on all existing rows with a null value for this column) 2) Ignore for now, and let me handle existing rows with NULL myself (e.g. because you added a RunPython or RunSQL operation to handle NULL values in a previous data migration) 3) Quit, and let me add a default in models.py Select an option: Select an option:
It will become.
Answer # 1
I deleted the migrations folder and sqlite3 once and did it again.
- python - error: takes 1 positional argument but 2 were given
- name error in underscore in python django
- python - django 1452 integrity error
- python - i want to change the ip address that the django app gets by default from remote_addr to http_x_forwarded_for in middlew
- python 3x - i want to get the nth array with an argument using python3 argparse
- about python argument and data definition
- python - categorical_crossentoropy error does not resolve
- python - vscode: i can't debug django apps
- about error handling during implementation of user registration function in django
- when i try to use a c ++ template type argument in a function, i get an error if the type is different
- python - if you want to put a number directly in the argument of most_similar of gensim
- python - django i want to filter the data associated with a foreign key and display it in a template
- readcsv error in python
- python - error in image binarization using cv2adaptivethreshold function
- python - i want to display an image with pysimplegui, but an error occurs
- python - error when scraping with selenium and firefox
- [python] graphviz output format error
- python - i want to use asyncio with django custom commands
- python - i get an error when connecting to a voice channel with discordpy
- python 3x - best estimator: i get an error with no syntax, so please tell me what to do
- python : How to implement a table of Players that can have different numbers in different matches?
- python : Data not being pushed into database from Django form
- python : What is the best way to substitute values from variables /lists /dictionaries in a SQL query?
- python : Django settings in multiple files
- python : Django. Using ldap authorization and user groups in different AD domains
- Passing parameter list to SQL query python [duplicate]
- python : What programming language to choose for working with data? [ Closed ]
- python : mapping to a specific user group in Django 4
- python : cannot import name 'url' from 'django.conf.urls' when working with Django 4.0.1
- python : Unable to get responses from users in telegram bot