Dakine
Dakine

Reputation: 198

HTTP: 403 with Phileo app

I'm writing my first app in Django 1.8 and I'd like to use Phileo. I followed the instructions to the letter but the console returns this when liking a model though the widget:

"POST /likes/like/12:1/ HTTP/1.1" 403 2274 (forbidden)

Is this an authentication or a url issue? I tried adding csrf_exempt to my blog view but get the same result.

I also tried running it without Eldarion but then i get a blank page and:

"GET /likes/like/12:2/ HTTP/1.1" 405 0  (method not allowed)

Any hints are really appreciated!

settings.py:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'app',
    'phileo',
    'crispy_forms',
    'location_field',
    'imagekit',
)

PHILEO_LIKABLE_MODELS = {
    'app.Post': {},
}
AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'phileo.auth_backends.CanLikeBackend',
)

urls.py

urlpatterns = patterns('',
    url(r'^likes/', include('phileo.urls')),
    url(r'^post/(?P<post_id>\d+)/post.html$', 'app.views.post', name='post'),
...
)

in my template:

{% load staticfiles %}
<script src="{% static 'app/eldarion/js/eldarion-ajax.min.js %}"></script>

{% load phileo_tags %}
{% phileo_widget user post %}

Upvotes: 0

Views: 102

Answers (1)

awbemauler
awbemauler

Reputation: 151

What you are getting are HTTP codes. Both 403 and 405 are under the category of bad request.

Error code 403: Forbidden - The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.

Error code 405: Method not allowed - The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource.

source

Unfortunately, I can't really help you with your code because you haven't posted it. Typically, a 403 means a permission issue. A 405 typically means what you requested was bad. You can try to contact your ISP.

Upvotes: 1

Related Questions