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

  • SEARCH
  • Home
  • 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 8419883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:44:20+00:00 2026-06-10T02:44:20+00:00

I am a bit confused on how does the Authentication works in Django using

  • 0

I am a bit confused on how does the Authentication works in Django using pusher i want to implement a one-to-one chatting system so i guess i will be using private channels that requires authentication before you can subscribe to the channel … i read there that the endpoint is the url you want pusher to POST to, i added a url to test if it is working but every time the status returns 403 and it seems it doesn’t enter the view i created to test it so any ideas ? here is a sample of my code :

message.html

var channel = pusher.subscribe('private-test');
channel.bind('message', function(data) {
  var $message = $('<div class="message"/>').appendTo('#messages');
  $('<span class="user"/>').text(data.user).appendTo($message);
  $('<span/>').text(data.message).appendTo($message);
});;

Pusher.channel_auth_endpoint = 'test/'; 
Pusher.channel_auth_transport = 'ajax';

channel.bind('pusher:subscription_succeeded', function(status) {
    alert(status);
});

channel.bind('pusher:subscription_error', function(status) {
    alert(status);
});

Views.py:

def testUser(request,user_name):
print 'Test Passed'
return render_to_response('message.html', {
    'PUSHER_KEY': settings.PUSHER_KEY,'channel_variable':request.user.id,'other_var':'3', 
}, RequestContext(request)) 

when i checked the url it POSTs to, in my cmd i found it correct and it matched the one i put in urls.py but i still don’t know why it does not enter my view

  • 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-06-10T02:44:21+00:00Added an answer on June 10, 2026 at 2:44 am

    I don’t know Django, but it seems highly likely that the framework is intercepting the call to prevent CSRF (Cross site resource forgery).

    The Django docs talk about CSRF here:
    https://docs.djangoproject.com/en/dev/ref/contrib/csrf/

    As with a number of frameworks you’ll need to provide a CSRF token as part of the XHR/AJAX call to the authentication endpoint, or override the framework interception (somehow).

    Have a look at the auth section of the Pusher constructor options parameter. In there you’ll find an example of how to pass a CSRF token.

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

Sidebar

Related Questions

I am a bit confused about how XEP-0114 works. Does servicing a domain using
I'm a little bit confused why it does not work. What i want is
I am little bit confused with symfony2 bundles. I want to know that does
I'm a bit confused about all that Does <compilation debug=true> in web.config mean that
I'm a bit confused about mvc terminology. Using the question title as an example,
I am a bit confused between these 2 selectors. Does the descendent selector: div
I am a bit confused with odeint . I found one example below to
I am a bit confused about the namings in the SVM. I am using
I am not familiar with ZigBee technology. And I am bit confused. Does Zigbee
I am a bit confused about encapsulation. In general (or in Obj-C), does it

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.