Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:12:20+00:00 2026-05-26T01:12:20+00:00

I’m having the following error in my application (quite usual as far as I’ve

  • 0

I’m having the following error in my application (quite usual as far as I’ve seen on Google):

Caught NoReverseMatch while rendering: Reverse for 'add-post' with arguments '()' and keyword arguments '{}' not found.

The thing is that I’m using reverse urls for the first time, so I’m a bit lost about what could be causing this error, and apparently I have everything ok. Can someone tell me what’s happening?

urls.py file

urlpatterns = patterns('e_cidadania.apps.news.views',

    url(r'^add/$', 'add_post', name='add-post'),

    url(r'^(?P<post_id>\d+)/delete/$', DeletePost.as_view(), name='delete-post'),

    url(r'^(?P<post_id>\d+)/edit/$', 'edit_post', name='edit-post'),

    url(r'^(?P<post_id>\d+)', ViewPost.as_view(), name='view-post')

)

Template

[...]

{% if perms.news.add_post %}
    <div id="tools">
        <a href="{% url add-post %}">
            <img src="{{ STATIC_URL }}/assets/icons/add16.png" alt="{% trans 'Add new post' %}" title="{% trans 'Add new post' %}"/>
        </a>

[...]

News views.py (the fiel is 140 lines long, so I cut it)

from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required, permission_required

# Generic class-based views
from django.views.generic.base import TemplateView, RedirectView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.views.generic.detail import DetailView

from django.template import RequestContext
from django.views.generic.create_update import create_object
from django.views.generic.create_update import update_object

from django.contrib.auth.models import User
from e_cidadania.apps.spaces.models import Space
from e_cidadania.apps.news.models import Post
from e_cidadania.apps.news.forms import NewsForm    

@permission_required('news.add_post')
def add_post(request, space_name):

    """
    Create a new post. Only registered users belonging to a concrete group
    are allowed to create news. nly site administrators will be able to
    post news in the index page.
    """
    current_space = get_object_or_404(Space, url=space_name)
    form = NewsForm(request.POST or None)

    if request.method == 'POST':
        form_uncommited = form.save(commit=False)
        form_uncommited.author = request.user

        # Get space id
        place = Space.objects.get(url=space_name)
        form_uncommited.space = place

        # This should not be necessay since the editor filters the
        # script tags
        #if "<script>" in form_uncommited.post_message:
        #    return "SCRIPT TAGS ARE NOT ALLOWED"

        if form.is_valid():
            form_uncommited.save()
            return redirect('/spaces/' + space_name)

    return render_to_response('news/post_add.html',
                              {'form': form, 'get_place': current_space},
                              context_instance = RequestContext(request))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:12:20+00:00Added an answer on May 26, 2026 at 1:12 am

    Can’t see any blatant error in the info you show, perhaps you can post your views.py?

    Make sure that EVERY entry in your urls.py is correctly defined, since reverse imports the whole urls definition, and if there’s an error (like a view not yet implemented), it will raise an error.

    Also, does your views.py add_post signature matches your urls.py? Sorry for the dumb question but… just making sure 😉

    Edited in light of your new info:

    “def add_post(request, space_name):”

    This requires space_name to be passed to the view. Your reverse isn’t passing any arguments, from what I see. Also, make sure your urls.py is correct… aren’t you missing the pattern for the space_name argument after “add/”?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.