On 06/07/18 13:43, Umar Kambala wrote:
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", line 347, in execute

YOU need to add an on_delete argument to every ForeignKey definition - such as the one in line 13.

Learning to read tracebacks really does help - the error you posted contains the information you need :

  File "C:\Users\Admin\Desktop\Django Web\myproject\boards\models.py", line 13, in Topic
    board = models.ForeignKey(Board, related_name='topics')
TypeError: __init__() missing 1 required positional argument: 'on_delete'

Quite often the very last few lines of the error message will tell you exactly what the error is and which line - in this case :

The error is on line 13 of boards/models.py
The error is in the Topic class
the error is on the line that is : "board = models.ForeignKey(Board, related_name='topics')" the actual error is that the line is missing the on_delete argument - it really is that simple.
--
--
Anthony Flury
email : *anthony.fl...@btinternet.com*
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>*

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bd827f41-6db2-a73a-c959-c322d5471901%40btinternet.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to