Home > Software engineering >  I don't have django_redirect table with migration marked applied though
I don't have django_redirect table with migration marked applied though

Time:12-06

As I go through django-redirects docs

 INSTALLED_APPS = [
    'django.contrib.sites',
    'django.contrib.redirects',
]

MIDDLEWARE = [
    'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
]

python manage.py showmigrations

 redirects
 [X] 0001_initial
 [X] 0002_alter_redirect_new_path_help_text 

Request URL: http://127.0.0.1:8000/admin/redirects/redirect/add/

ERROR saying.....

no such table: django_redirect

\Programs\Python\Python310\lib\site-packages\django\db\backends\sqlite3\base.py", line 357, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: django_redirect 

CodePudding user response:

delete 0002_alter_redirect_new_path_help_text file from your project and run the migration command again.

  • Related