Django beginner. When I rewritten the model class, the following error appeared.
The reason for this is that I don't think that the attribute has been given to a new post, but I want to know how to solve it.
#/project/blog/models.py class Post (models.Model): author = models.ForeignKey (settings.AUTH_USER_MODEL, on_delete = models.CASCADE) title = models.CharField (max_length = 200) text = models.TextField () created_date = models.DateTimeField (default = timezone.now ()) published_date = models.DateTimeField (blank = True, null = True) def publish (self): self.published_date = timezone.now () self.save () def __str __ (self): return self.title
no such column: blog_post.published_date
I got an error with
Answer # 1
I just forgot about makemigrations migrate ...
- error when changing github username
- python - i want to know the solution of internal server error
- ssh - transfer error from local to server with scp command
- github - [capistrano] git stdout: error: cannot open fetch_head: no permission
- github - i can't push the repository with the git gui i don't know what to do with the error code that is the workaround
- mql4 error solution
- connection error from c# to sql server "a network-related or instance-specific error occurred"
- github - i want to fix a permission denied (public key) error
- github - error in writing workflows in circleci/configyml
- i'm not getting a 404 error on github pages
- i want to display the sql statement error of sql server on the net screen
- i want to know how to display a file open error in the perl error log on windows server
- url - 404 error after changing domain
- python - please tell me the solution of yolov3 error [filenotfounderror: [errno 2] no such file or directory:'traintxt']
- android studio - i get an error when changing columns in realm
- mysql server does not start up (error! the server quit without updating pid file)
- c# - the remote server returned an error: (404) not found
- php - solution for syntax error, unexpected'class' (t_class), expecting']'
- i get an error when i try to commit on github
- error accessing external server with cakephp3
- i've implemented a follow feature using manytomanyfield in django, but i can't see the details in the template
- django - i want to print the numbers stored in the session
- python - common behavior for everything in django
- multiple arguments to django
- python - [django] how to put existing model data into another model
- tensorflow 230 cannot be imported when using apache
- html - is it okay to use django's generic view (class-based view) and function-based view at the same time?
- dealing with errors (bind: address already in use) when building a django development environment
- python - about the error that occurred when creating the table