Opened 7 years ago

Last modified 7 years ago

#409 new defect

Django autoinstaller results in broken MIDDLEWARE

Reported by: achernya Owned by:
Priority: blocker Milestone:
Component: autoinstallers Keywords:


At some point, django.contrib.admin and django.contrib.admindocs got added to MIDDLEWARE in But they're not middleware; this blows up Django during the install process and later on when trying to do anything.

I investigated the autoinstaller, and we don't seem to be adding to middleware at all. We can work around this by removing it, but I'd like to figure out what the underlying problem is ASAP. adehnert, do you have any idea what could be causing this?

Change History (1)

comment:1 Changed 7 years ago by achernya

  • Component changed from default to autoinstallers

Oh, great. It is in fact our autoinstaller, a normal django-admin startproject produces


The autoinstaller says

  } elsif (/^INSTALLED_APPS/) {
    print NEWSETTINGS "$_\n";
    while (<SETTINGS>) {
      if (/^\)/) {
        print NEWSETTINGS "    'django.contrib.admin',\n";
        print NEWSETTINGS "    'django.contrib.admindocs',\n";
      print NEWSETTINGS $_;

---that loop doesn't terminate early enough. It continues processing the rest of the file, resulting in the ^)$ being replaced. We probably need to add aprint NEWSETTINGS ")\n"; continue; to make it get out of that if. Can someone that knows more perl than I do verify?

Note: See TracTickets for help on using tickets.