I'm using the Django Edge (v2.0) template, and have created a site, this is my main project and it's titled: Website. Within the project, I set out to implement a blog, and installed Zinnia. I have the following:
Python 3.4.2 and Django 1.7.7
I installed Zinnia per the installation documents, including all listed dependencies, and it works. If I navigate to 127.0.0.0, it takes me to the "home page" of the Website project. If I navigate 127.0.0.0/weblog/, it'll take me to the Zinnia's "home page" of the blog. This all works. However, on the Website's homepage (home.html), I'm trying to create a link to the /weblog, but can't seem to make it work. I'm sure it's just syntax, and my lack of knowledge.
Here's how my project is structured:
├── LICENSE.txt
├── README.md
├── docs
│ └── index.md
├── requirements.txt
└── src
├── Website
│ ├── __init__.py
│ ├── __pycache__
│ ├── settings
│ ├── urls.py
│ ├── views.py
│ └── wsgi.py
├── accounts
│ ├── __init__.py
│ ├── __pycache__
│ ├── templates
│ ├── urls.py
│ └── views.py
├── manage.py
├── profiles
│ ├── __init__.py
│ ├── __pycache__
│ ├── templates
│ ├── urls.py
│ └── views.py
├── static
│ ├── bootstrap
│ └── site
├── templates
│ ├── about.html
│ ├── base.html
│ ├── home.html
└── zinnia
├── __init__.py
├── __pycache__
├── managers.py
├── markups.py
├── static
├── templates
├── urls
├── views
Here is my main's urls.py:
urlpatterns = patterns(
'',
url(r'^$', views.HomePage.as_view(), name='home'),
url(r'^', include(accounts.urls, namespace='accounts')),
url(r'^users/', include(profiles.urls, namespace='profiles')),
url(r'^admin/', include(admin.site.urls)),
url(r'^weblog/', include('zinnia.urls', namespace='zinnia')),
url(r'^comments/', include('django_comments.urls')),
)
On the Website's home, using home.html, I can create buttons that will direct me to other pages like so:
<a class="btn btn-default" href="{% url 'accounts:login' %}" role="button">Log in</a>
I basically want a "blog" button, on my home page, that will redirect me to 127.0.0.0/weblog/, so I do this in the same fashion:
<a class="btn btn-default" href="{% url 'zinnia:weblog' %}" role="button">Blog</a>
I get this error:
Reverse for 'weblog' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
With more info:
In template /Website/src/templates/home.html, error at line 59
59 <a class="btn btn-default" href="{% url 'zinnia:weblog' %}" role="button">Log in</a>
Any help would be appreciated, thank you in advance.
I am probably late, but just in case anybody needs this, here is how you get the url for the root of your weblog
<a href="{% url 'zinnia:entry_archive_index' %}">Weblog</a>