尝试在python 2.7下的django-cms 3.0中发布某些页面时出现KeyError

时间:2018-12-03 11:12:16

标签: python django django-cms

在某些页面(不是全部)上显示一会儿之后,就会出现这样的错误:(请参见下面的追溯代码段。)

我试图从另一个用户发布页面,以为问题出在某种程度上与用户首选项有关,但是还是一样。

要回滚页面的历史记录并发布旧版本-也不起作用,似乎会回滚“草稿中”的版本,但是发布时是相同的错误。

<div>
  <div>
    <div class="adm">
    </div>
    <div class="im">

      <h1>KeyError at /ru/admin/cms/page/6154/ru/<wbr>publish/</h1>
      <pre style="font-size:12pt">221273</pre>
      <br>


      <h2>Traceback</h2>

    </div>
  </div>
  <div style="font-size:10pt">
    <ul>
      <div>
        <div class="adm">
          <div id="q_3469" class="ajR h4" data-tooltip="Скрыть развернутую часть" aria-label="Скрыть развернутую часть">
            <div class="ajT"></div>
          </div>
        </div>
        <div class="im">

          <li>
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/<wbr>django/core/handlers/base.py</code> in <b><i><code>get_response</code></i></b><br>


            <div>

              <ol start="112">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">                    response = wrapped_callback(request, *callback_args, **callback_kwargs)</pre>
                </li>
              </ol>

            </div>



          </li>

          <li>
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/<wbr>django/utils/decorators.py</code> in <b><i><code>_wrapped_view</code></i></b><br>


            <div>

              <ol start="99">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">                    response = view_func(request, *args, **kwargs)</pre>
                </li>
              </ol>

            </div>



          </li>

          <li>
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/<wbr>django/views/decorators/cache.<wbr>py</code> in <b><i><code>_wrapped_view_func</code></i></b><br>


            <div>

              <ol start="52">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">        response = view_func(request, *args, **kwargs)</pre>
                </li>
              </ol>

            </div>



          </li>

          <li>
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/<wbr>django/contrib/admin/sites.py</code> in <b><i><code>inner</code></i></b><br>


            <div>

              <ol start="198">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">            return view(request, *args, **kwargs)</pre>
                </li>
              </ol>

            </div>



          </li>

          <li>
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/<wbr>django/db/transaction.py</code> in <b><i><code>inner</code></i></b><br>


            <div>

              <ol start="431">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">                return func(*args, **kwargs)</pre>
                </li>
              </ol>

            </div>



          </li>

          <li>
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/<wbr>reversion/revisions.py</code> in <b><i><code>do_revision_context</code></i></b><br>


            <div>

              <ol start="300">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">                    return func(*args, **kwargs)</pre>
                </li>
              </ol>

            </div>



          </li>

          <li>
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/cms/<wbr>admin/pageadmin.py</code> in <b><i><code>publish_page</code></i></b><br>


            <div>

              <ol start="1038">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">            published = page.publish(language)</pre>
                </li>
              </ol>

            </div>



          </li>

          <li>
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/cms/<wbr>models/pagemodel.py</code> in <b><i><code>publish</code></i></b><br>


            <div>

              <ol start="567">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">            self._copy_contents(public_<wbr>page, language)</pre>
                </li>
              </ol>

            </div>



          </li>

          <li>
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/cms/<wbr>models/pagemodel.py</code> in <b><i><code>_copy_contents</code></i></b><br>


            <div>

              <ol start="266">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">                copy_plugins_to(plugins, ph, no_signals=True)</pre>
                </li>
              </ol>

            </div>



          </li>

          <li>
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/cms/<wbr>utils/copy_plugins.py</code> in <b><i><code>copy_plugins_to</code></i></b><br>


            <div>

              <ol start="22">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">        new_plugin = old_plugin.copy_plugin(to_<wbr>placeholder, plugin_language, old_parent_cache, no_signals=no_signals)</pre>
                </li>
              </ol>

            </div>



          </li>

        </div>
      </div>
      <li>
        <div>
          <div class="adm">
            <div id="q_3467" class="ajR h4" data-tooltip="Скрыть развернутую часть" aria-label="Скрыть развернутую часть">
              <div class="ajT"></div>
            </div>
          </div>
          <div class="im">
            <code>/home/web/{server}/env/local/lib/<wbr>python2.7/site-packages/cms/<wbr>models/pluginmodel.py</code> in <b><i><code>copy_plugin</code></i></b><br>


            <div>

              <ol start="262">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        new_plugin.tree_id = None</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        new_plugin.lft = None</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        new_plugin.rght = None</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        new_plugin.level = None</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        # we assign a parent to our new plugin</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        parent_cache[<a href="http://self.pk" target="_blank" data-saferedirecturl="https://www.google.com/url?q=http://self.pk&amp;source=gmail&amp;ust=1543917559762000&amp;usg=AFQjCNHA1fITgIG5iMx3-WhJslJnI7C93w">self.pk</a>] = new_plugin</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        if self.parent:</pre>
                </li>
              </ol>

              <ol start="269">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px;background-color:silver">            parent = parent_cache[self.parent_id]</pre>
                </li>
              </ol>

              <ol start="270">
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">            parent = CMSPlugin.objects.get(pk=<a href="http://parent.pk" target="_blank" data-saferedirecturl="https://www.google.com/url?q=http://parent.pk&amp;source=gmail&amp;ust=1543917559762000&amp;usg=AFQjCNFGT3pVfRO_1lQtYqOpISsxfI7UMg">paren<wbr>t.pk</a>)</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">            new_plugin.parent = parent</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        new_plugin.level = None</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        new_plugin.language = target_language</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        new_plugin.plugin_type = self.plugin_type</pre>
                </li>
                <li>
                  <pre style="margin-top:2px;margin-bottom:4px">        new_plugin.position = self.position</pre>
                </li>
              </ol>

            </div>



          </div>
        </div>
        <h3>Local Vars (last frame)
          <table cellspacing="0" cellpadding="2" border="1">
            <thead>
              <tr>
                <th>Variable</th>
                <th>Value</th>
              </tr>
            </thead>
            <tbody style="font-size:9pt">

              <tr>
                <td>self</td>
                <td>
                  <pre>&lt;CMSPlugin: 472264&gt;</pre>
                </td>
              </tr>

              <tr>
                <td>no_signals</td>
                <td>
                  <pre>True</pre>
                </td>
              </tr>

              <tr>
                <td>target_placeholder</td>
                <td>
                  <pre>&lt;Placeholder: content&gt;</pre>
                </td>
              </tr>

              <tr>
                <td>new_plugin</td>
                <td>
                  <pre>&lt;CMSPlugin: None&gt;</pre>
                </td>
              </tr>

              <tr>
                <td>parent_cache</td>
                <td>
                  <pre>{184070: &lt;CMSPlugin: 665251&gt;,
 184071: &lt;CMSPlugin: 665252&gt;,
 184072: &lt;CMSPlugin: 665355&gt;,
 184074: &lt;CMSPlugin: 665448&gt;,
 220306: &lt;CMSPlugin: 665543&gt;,
 220307: &lt;CMSPlugin: 665544&gt;,
 220308: &lt;CMSPlugin: 665253&gt;,
 220309: &lt;CMSPlugin: 665254&gt;,
 220310: &lt;CMSPlugin: 665255&gt;,
 220311: &lt;CMSPlugin: 665256&gt;,
 220312: &lt;CMSPlugin: 665258&gt;,
 220313: &lt;CMSPlugin: 665259&gt;,
 220314: &lt;CMSPlugin: 665264&gt;,
 220315: &lt;CMSPlugin: 665265&gt;,
 220316: &lt;CMSPlugin: 665266&gt;,
 220317: &lt;CMSPlugin: 665267&gt;,
 220318: &lt;CMSPlugin: 665283&gt;,
 220319: &lt;CMSPlugin: 665284&gt;,
 220320: &lt;CMSPlugin: 665298&gt;,
 220321: &lt;CMSPlugin: 665299&gt;,
 220322: &lt;CMSPlugin: 665324&gt;,
 220323: &lt;CMSPlugin: 665325&gt;,
 220324: &lt;CMSPlugin: 665356&gt;,
 220325: &lt;CMSPlugin: 665362&gt;,
 220326: &lt;CMSPlugin: 665367&gt;,
 220327: &lt;CMSPlugin: 665373&gt;,
 220328: &lt;CMSPlugin: 665377&gt;,
 220329: &lt;CMSPlugin: 665385&gt;,
 220330: &lt;CMSPlugin: 665402&gt;,
 220331: &lt;CMSPlugin: 665424&gt;,
 220332: &lt;CMSPlugin: 665449&gt;,
 220333: &lt;CMSPlugin: 665453&gt;,
 220334: &lt;CMSPlugin: 665458&gt;,
 220335: &lt;CMSPlugin: 665465&gt;,
 220336: &lt;CMSPlugin: 665469&gt;,
 220337: &lt;CMSPlugin: 665478&gt;,
 220338: &lt;CMSPlugin: 665492&gt;,
 220339: &lt;CMSPlugin: 665521&gt;,
 220340: &lt;CMSPlugin: 665358&gt;,
 220341: &lt;CMSPlugin: 665363&gt;,
 220342: &lt;CMSPlugin: 665368&gt;,
 220343: &lt;CMSPlugin: 665374&gt;,
 220344: &lt;CMSPlugin: 665378&gt;,
 220345: &lt;CMSPlugin: 665386&gt;,
 220346: &lt;CMSPlugin: 665403&gt;,
 220347: &lt;CMSPlugin: 665425&gt;,
 220348: &lt;CMSPlugin: 665450&gt;,
 220349: &lt;CMSPlugin: 665454&gt;,
 220350: &lt;CMSPlugin: 665459&gt;,
 220351: &lt;CMSPlugin: 665466&gt;,
 220352: &lt;CMSPlugin: 665470&gt;,
 220353: &lt;CMSPlugin: 665479&gt;,
 220354: &lt;CMSPlugin: 665493&gt;,
 220355: &lt;CMSPlugin: 665522&gt;,
 220591: &lt;CMSPlugin: 665352&gt;,
 220594: &lt;CMSPlugin: 665443&gt;,
 220596: &lt;CMSPlugin: 665531&gt;,
 220597: &lt;CMSPlugin: 665532&gt;,
 220598: &lt;CMSPlugin: 665538&gt;,
 220599: &lt;CMSPlugin: 665353&gt;,
 220600: &lt;CMSPlugin: 665444&gt;,
 220601: &lt;CMSPlugin: 665445&gt;,
 220602: &lt;CMSPlugin: 665354&gt;,
 220603: &lt;CMSPlugin: 665541&gt;,
 221219: &lt;CMSPlugin: 665545&gt;,
 221220: &lt;CMSPlugin: 665547&gt;,
 221221: &lt;CMSPlugin: 665554&gt;,
 221261: &lt;CMSPlugin: 665285&gt;,
 221262: &lt;CMSPlugin: 665286&gt;,
 221263: &lt;CMSPlugin: 665287&gt;,
 221272: &lt;CMSPlugin: 665548&gt;,
 221281: &lt;CMSPlugin: 665546&gt;,
 229616: &lt;CMSPlugin: 665268&gt;,
 229725: &lt;CMSPlugin: 665497&gt;,
 229726: &lt;CMSPlugin: 665480&gt;,
 229727: &lt;CMSPlugin: 665387&gt;,
 229728: &lt;CMSPlugin: 665288&gt;,
 229729: &lt;CMSPlugin: 665524&gt;,
 229730: &lt;CMSPlugin: 665525&gt;,
 229731: &lt;CMSPlugin: 665526&gt;,
 229732: &lt;CMSPlugin: 665498&gt;,
 229733: &lt;CMSPlugin: 665499&gt;,
 229734: &lt;CMSPlugin: 665500&gt;,
 229735: &lt;CMSPlugin: 665501&gt;,
 229736: &lt;CMSPlugin: 665502&gt;,
 229737: &lt;CMSPlugin: 665503&gt;,
 229738: &lt;CMSPlugin: 665471&gt;,
 229739: &lt;CMSPlugin: 665472&gt;,
 229740: &lt;CMSPlugin: 665473&gt;,
 229741: &lt;CMSPlugin: 665481&gt;,
 229742: &lt;CMSPlugin: 665482&gt;,
 229743: &lt;CMSPlugin: 665483&gt;,
 229886: &lt;CMSPlugin: 665306&gt;,
 229887: &lt;CMSPlugin: 665307&gt;,
 229888: &lt;CMSPlugin: 665308&gt;,
 229889: &lt;CMSPlugin: 665269&gt;,
 229890: &lt;CMSPlugin: 665270&gt;,
 229891: &lt;CMSPlugin: 665271&gt;,
 229892: &lt;CMSPlugin: 665272&gt;,
 229893: &lt;CMSPlugin: 665273&gt;,
 229894: &lt;CMSPlugin: 665289&gt;,
 229895: &lt;CMSPlugin: 665290&gt;,
 229896: &lt;CMSPlugin: 665291&gt;,
 229897: &lt;CMSPlugin: 665292&gt;,
 229898: &lt;CMSPlugin: 665293&gt;,
 229899: &lt;CMSPlugin: 665294&gt;,
 229900: &lt;CMSPlugin: 665309&gt;,
 229901: &lt;CMSPlugin: 665310&gt;,
 229902: &lt;CMSPlugin: 665311&gt;,
 229903: &lt;CMSPlugin: 665312&gt;,
 229904: &lt;CMSPlugin: 665313&gt;,
 229905: &lt;CMSPlugin: 665314&gt;,
 229906: &lt;CMSPlugin: 665336&gt;,
 229907: &lt;CMSPlugin: 665340&gt;,
 484528: &lt;CMSPlugin: 665535&gt;,
 484529: &lt;CMSPlugin: 665536&gt;,
 484530: &lt;CMSPlugin: 665537&gt;,
 547634: &lt;CMSPlugin: 665553&gt;,
 547638: &lt;CMSPlugin: 665494&gt;,
 547639: &lt;CMSPlugin: 665301&gt;,
 548304: &lt;CMSPlugin: 665262&gt;,
 548306: &lt;CMSPlugin: 665463&gt;,
 564010: &lt;CMSPlugin: 665399&gt;,
 592455: &lt;CMSPlugin: 665302&gt;,
 592456: &lt;CMSPlugin: 665400&gt;,
 592457: &lt;CMSPlugin: 665495&gt;,
 603927: &lt;CMSPlugin: 665303&gt;,
 603928: &lt;CMSPlugin: 665338&gt;,
 609999: &lt;CMSPlugin: 665523&gt;,
 620251: &lt;CMSPlugin: 665263&gt;,
 620252: &lt;CMSPlugin: 665372&gt;,
 620253: &lt;CMSPlugin: 665464&gt;,
 629124: &lt;CMSPlugin: 665539&gt;,
 629125: &lt;CMSPlugin: 665540&gt;,
 645123: &lt;CMSPlugin: 665282&gt;,
 645124: &lt;CMSPlugin: 665339&gt;,
 652550: &lt;CMSPlugin: 665304&gt;,
 652551: &lt;CMSPlugin: 665401&gt;,
 652552: &lt;CMSPlugin: 665305&gt;,
 653308: &lt;CMSPlugin: 665496&gt;,
 657288: &lt;CMSPlugin: 665549&gt;,
 657289: &lt;CMSPlugin: 665550&gt;}</pre>
                </td>
              </tr>

              <tr>
                <td>plugin_instance</td>
                <td>
                  <pre>&lt;FilerFile: Рабочая программа дисциплины&gt;</pre>
                </td>
              </tr>

              <tr>
                <td>target_language</td>
                <td>
                  <pre>u'ru'</pre>
                </td>
              </tr>

              <tr>
                <td>cls</td>
                <td>
                  <pre>Error in formatting: __repr__ returned non-string (type __proxy__)</pre>
                </td>
              </tr>

            </tbody>
          </table>

        </h3>
      </li>

    </ul>
  </div>
  <div>
    <div class="adm">
      <div id="q_3465" class="ajR h4">
        <div class="ajT"></div>
      </div>
    </div>
    <div class="h5">





      <h2>Request information</h2>
      <h3>POST</h3>

      <p>No POST data</p>


      <h3>META</h3>
    </div>
  </div>
  <table cellspacing="0" cellpadding="2" border="1">
    <thead>
      <tr>
        <th>Variable</th>
        <th>Value</th>
      </tr>
    </thead>
    <tbody style="font-size:9pt">

      <tr>
        <td>wsgi.multiprocess</td>
        <td>
          <pre>True</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_REFERER</td>
        <td>
          <pre>************************</pre>
        </td>
      </tr>

      <tr>
        <td>uwsgi.version</td>
        <td>
          <pre>'1.9.16'</pre>
        </td>
      </tr>

      <tr>
        <td>SCRIPT_NAME</td>
        <td>
          <pre>u''</pre>
        </td>
      </tr>

      <tr>
        <td>REQUEST_METHOD</td>
        <td>
          <pre>'GET'</pre>
        </td>
      </tr>

      <tr>
        <td>PATH_INFO</td>
        <td>
          <pre>u'/ru/admin/cms/page/6154/ru/<wbr>publish/'</pre>
        </td>
      </tr>

      <tr>
        <td>SERVER_PROTOCOL</td>
        <td>
          <pre>'HTTP/1.0'</pre>
        </td>
      </tr>

      <tr>
        <td>QUERY_STRING</td>
        <td>
          <pre>''</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_X_REAL_IP</td>
        <td>
          <pre>***************</pre>
        </td>
      </tr>

      <tr>
        <td>CONTENT_LENGTH</td>
        <td>
          <pre>''</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_USER_AGENT</td>
        <td>
          <pre>'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36'</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_CONNECTION</td>
        <td>
          <pre>'close'</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_COOKIE</td>
        <td>
          <pre>******************</pre>
        </td>
      </tr>

      <tr>
        <td>SERVER_NAME</td>
        <td>
          <pre>***************************</pre>
        </td>
      </tr>

      <tr>
        <td>REMOTE_ADDR</td>
        <td>
          <pre>'*************************'</pre>
        </td>
      </tr>

      <tr>
        <td>wsgi.url_scheme</td>
        <td>
          <pre>'http'</pre>
        </td>
      </tr>

      <tr>
        <td>SERVER_PORT</td>
        <td>
          <pre>'80'</pre>
        </td>
      </tr>

      <tr>
        <td>uwsgi.node</td>
        <td>
          <pre>'{server}'</pre>
        </td>
      </tr>

      <tr>
        <td>DOCUMENT_ROOT</td>
        <td>
          <pre>'/etc/nginx/html'</pre>
        </td>
      </tr>

      <tr>
        <td>wsgi.input</td>
        <td>
          <pre>&lt;uwsgi._Input object at 0x15000d60&gt;</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_HOST</td>
        <td>
          <pre>************************</pre>
        </td>
      </tr>

      <tr>
        <td>wsgi.multithread</td>
        <td>
          <pre>False</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_UPGRADE_INSECURE_REQUESTS</td>
        <td>
          <pre>'1'</pre>
        </td>
      </tr>

      <tr>
        <td>REQUEST_URI</td>
        <td>
          <pre>'/ru/admin/cms/page/6154/ru/<wbr>publish/'</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_ACCEPT</td>
        <td>
          <pre>'text/html,application/xhtml+<wbr>xml,application/xml;q=0.9,<wbr>image/webp,image/apng,*/*;q=0.<wbr>8'</pre>
        </td>
      </tr>

      <tr>
        <td>wsgi.version</td>
        <td>
          <pre>(1, 0)</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_X_FORWARDED_FOR</td>
        <td>
          <pre>'*************************'</pre>
        </td>
      </tr>

      <tr>
        <td>wsgi.errors</td>
        <td>
          <pre>&lt;open file 'wsgi_errors', mode 'w' at 0xf6fd1a18&gt;</pre>
        </td>
      </tr>

      <tr>
        <td>REMOTE_PORT</td>
        <td>
          <pre>''</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_ACCEPT_LANGUAGE</td>
        <td>
          <pre>'ru-RU,ru;q=0.9,en-US;q=0.8,<wbr>en;q=0.7'</pre>
        </td>
      </tr>

      <tr>
        <td>wsgi.run_once</td>
        <td>
          <pre>False</pre>
        </td>
      </tr>

      <tr>
        <td>CONTENT_TYPE</td>
        <td>
          <pre>''</pre>
        </td>
      </tr>

      <tr>
        <td>wsgi.file_wrapper</td>
        <td>
          <pre>''</pre>
        </td>
      </tr>

      <tr>
        <td>CSRF_COOKIE</td>
        <td>
          <pre>u'<wbr>zazTNJ0BQAWA0CqbRevf2EpbzXEYch<wbr>FE'</pre>
        </td>
      </tr>

      <tr>
        <td>HTTP_ACCEPT_ENCODING</td>
        <td>
          <pre>'gzip, deflate'</pre>
        </td>
      </tr>

    </tbody>
  </table>
  <div class="yj6qo"></div>
  <div class="adL">


  </div>
</div>

0 个答案:

没有答案