Saturday, September 22, 2018

Create tables for models in your database

Hi

getting an error while run this code...

python manage.py makemigrations blog
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/dheerajkumar/.local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/dheerajkumar/.local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "/home/dheerajkumar/.local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/dheerajkumar/.local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models()
  File "/home/dheerajkumar/.local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/dheerajkumar/djangogirls/myvenv/myproject/blog/models.py", line 6
    author = models.Foreignkey('auth.User', on_delete=models.CASCADE)
         ^
IndentationError: expected an indented block


please help, I'm new in Django

--
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/1c817fdf-8ee2-43e8-9a2f-cb150f1643ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment