I don't have django_redirect table with migration marked applied though

I don't have django_redirect table with migration marked applied though

Problem Description:

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

ProgramsPythonPython310libsite-packagesdjangodbbackendssqlite3base.py", line 357, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: django_redirect 

Solution – 1

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

Rate this post
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept
Reject