c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
Python

Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default

| | django , python

I got this following error while running the command " python manage.py migrate"  

"Migration admin.0001_initial is applied before its dependency admin.0001_initial on database default"

SOLUTION:

STEP 1:

Go to admin project's URL.py and comment the line "admin.site.urls" in  urlpatterns. 

from django.contrib import admin

from django.urls import include, path, re_path as url
urlpatterns = [
#path('admin/', admin.site.urls),
path('', include(('myaccount.urls', 'myaccount'), namespace='myaccount')),
url(r'cricket/', include(('cricket.urls', 'cricket'), namespace='cricket')), ]

STEP 2:

And then go to settings.py and comment the "django.contrib.admin" in INSTALLED_APPS.

INSTALLED_APPS = [

#'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'myaccount', ]

Now run the command python manage.py migrate. It will run the migration successful.

Finally un comment it.

VIDEO GUIDE: