Saturday, September 22, 2018

Re: Create tables for models in your database

Hi,

On 22/09/2018 14.21, talkdkg@gmail.com wrote:
>
> getting an error while run this code...
>
> "/home/dheerajkumar/djangogirls/myvenv/myproject/blog/models.py",
> line 6
>     author = models.Foreignkey('auth.User', on_delete=models.CASCADE)
>          ^
> IndentationError: expected an indented block
>

As the error message clearly states, you have an error on line 6 in your
models.py file where a line doesn't match the expected indentation.

Python uses indentation for scoping. This is very fundamental in python.

I would suggest you use an editor that understands python. Then you
would most like have the error highlighted on that exact line and the
editor would help you by suggesting different indentations, so you'd be
able to fix the error before even running the code.

Which editor to choose is mostly a matter of taste, but I do highly
recommend something that understands python. That will help you a lot
and save you a lot of time.

Kind regards,

Kasper Laudrup

--
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+unsubscribe@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/27f41b64-da4b-e1ef-7ef8-31fe6db0df3b%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment