Django external libraries

229 views
Skip to first unread message

Saeed Pooladzadeh

unread,
Apr 7, 2019, 9:58:18 AM4/7/19
to Django users
Hello

I've added an external library in django. I have installed in installed apps but when I try to migrate the model I keep getting this error:

ERRORS:
?: (admin.E408) 'django.contrib.auth.middleware.AuthenticationMiddleware' must be in MIDDLEWARE in order to use the admin application.
?: (admin.E409) 'django.contrib.messages.middleware.MessageMiddleware' must be in MIDDLEWARE in order to use the admin application.
The interactive Python process has exited.
The interactive Python process has exited.

and my middleware is this:

MIDDLEWARE_CLASSES = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware'
]

Also my IDE is visual studio.

Please inform me.

Saeed


Manas Nikam

unread,
Apr 7, 2019, 10:05:33 AM4/7/19
to django...@googlegroups.com
Remove the bottom two duplicate middleware  already present and try again

--
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...@googlegroups.com.
To post to this group, send email to django...@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/40cb99e0-bb41-4f46-ab69-a8701e3d8de9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saeed Pooladzadeh

unread,
Apr 7, 2019, 10:20:05 AM4/7/19
to Django users
I removed them but still see the error.

در یکشنبه 7 آوریل 2019، ساعت 14:28:18 (UTC+4:30)، Saeed Pooladzadeh نوشته:

Asif Saif Uddin

unread,
Apr 7, 2019, 2:40:49 PM4/7/19
to Django users
try to make MIDDLEWARE_CLASSES to MIDDLEWARE first, you didn't mentioned the version of django and the extension you installed.

Saeed Pooladzadeh

unread,
Apr 7, 2019, 3:39:56 PM4/7/19
to Django users
I did what you say, but when I run the  migration I see this:

Running migrations:
  No migrations to apply.
Executing manage.py migrate
Operations to perform:
  Apply all migrations: (none)
Running migrations:
  No migrations to apply.

Is it mean the migration has happened before?

How can I understand?

در یکشنبه 7 آوریل 2019، ساعت 14:28:18 (UTC+4:30)، Saeed Pooladzadeh نوشته:
Hello

Gabo LaTo

unread,
Apr 7, 2019, 11:25:25 PM4/7/19
to django...@googlegroups.com
Hi Saed. Maybe what you are trying to install does not need a migration. What is it?
But the lack of error message it's an improvement.
Are you able to use the library you installed now?

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Saeed Pooladzadeh

unread,
Apr 8, 2019, 3:05:02 PM4/8/19
to Django users
Hello

 I am trying to install instabot. It a famous Instagram bot. Yes, I can install it.
Should I add anything in wsgi.py section because when I try to run the project IDE shows error in this section.

در یکشنبه 7 آوریل 2019، ساعت 14:28:18 (UTC+4:30)، Saeed Pooladzadeh نوشته:
Hello
Reply all
Reply to author
Forward
0 new messages