django/wagtail template errors

668 views Asked by At

Django version: 1.7.8; wagtail version: 0.8.8. Getting started (steps):

  1. wagtail start mysite
  2. cd mysite
  3. python manage.py migrate
  4. python manage.py createsuperuser
  5. python manage.py runserver

Then I open http://127.0.0.1:8000 and click "Here" to login; get a error page, and the error information is about the template base.html, line 17:

<div class="nav-wrapper">

    <div class="inner">
        <a href="{% url 'wagtailadmin_home' %}" class="logo" title="Wagtail v.{% wagtail_version %}"><img src="{{ STATIC_URL }}wagtailadmin/images/wagtail-logo.svg" alt="Wagtail" width="80" /><span>{% trans "Dashboard" %}</span></a>

        <form class="nav-search" action="{% url 'wagtailadmin_pages_search' %}" method="get">
            <div>
                <label for="menu-search-q">{% trans "Search" %}</label>
                <input type="text" id="menu-search-q" name="q" placeholder="{% trans 'Search' %}" />
                <button type="submit">{% trans "Search" %}</button>
            </div>
        </form>

        {% main_nav %}    --- ERROR
    </div>

    <nav id="explorer" class="explorer"></nav>

</div>

I found main_nav is another html template located at a related path /shared/main_nav.html so I replaced {% main_nav %} with {% shared.main_nav %}, then I get the right page.

But when I open other URLs, I will get some same template-related errors.

Is something wrong with my configuration?

1

There are 1 answers

0
xcession On BEST ANSWER

Your attempted fix of {% main_nav %} suggests you aren't that familiar with Django. The fact you were able to edit Wagtail's internal files also indicates you're perhaps installing it from Git, rather than with pip or from Pypi, which would normally hide Wagtail's code relatively out of reach.

If you're interested in getting Wagtail up and running quickly, and my assumptions above are correct, you might have a better time by installing the latest stable release, 0.8.8, with pip, in a virtualenv, following the instructions here:

http://wagtail.readthedocs.org/en/latest/getting_started/index.html