Facebook AllAuth Django Login - django

"Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains."
First of all I'm fairly new...I've been programming in Django for about a year. I have followed about 6 or 7 Django AllAuth tutorials and think I have a good grasp on setting it up. Although, when I get to the Facebook login, it fails to work. I've set up my Facebook application via Admin, including api key's and app id.
Can I not sign in via Facebook through my localhost? Do I have to be on an external server? I've researched this for about two month and still haven't found any correct solutions to the problem. Very frustrating...Any help would be much appreciated. Thanks!

Related

Facebook API - Post to page

I'm trying to figure out how to post to my Facebook page automatically from my website. I have a custom CMS written in PHP that I use with my website, and I have already created the Facebook App and set up the necessary App ID and App Secret. I have PHP code written that when I create a page in my CMS, it will take the Page Title and a blurb of the content and create a post in my Facebook page, however because my Facebook App is not live, only I can see the post.
I've tried to apply for my app to go Live, but have been denied because I do not involve a login process. However, I don't want to log in again. That defeats the whole point of having the extended life access token.
Is it possible to do what I am trying to do? Or is there something I need to include in my app review request to have this approved? Any insight would be greatly appreciated, as the response I get from Facebook is rather generic and unhelpful.
Thank you!

Django - Change login redirect based on current App

So, I'm adding on another app to a webapp that I'm building for my company, this one involving bill creation for invoices. Unless one has a specific account with my website, they should not be allowed to access this specific app.
I am using Django's built-in authentication system. My LOGIN_REDIRECT_URI is set to redirect to one of my apps. However, I would like for the login redirect to send the user to the app that they were previously in after login. How might I accomplish this?
Thank you in advance!

Djangocms_blog - how to include social media (ie. facebook)

I'm using djangocms_blog. Everything is working good, but I have no idea how to include facebook for articles. Plugin give me possible for that, but I never do that and I don't know where I find relevant information about it.
How it look on my djangocms admin:
I created app on facebook dev:
And I used facebook app ID in my blog input on settings.
Like can you see, there is more information about FB. Where can I find them? And What else I should do?
All the informations are actualy optional, and you can provide any combination of them.
In case you created the application, App id is the right one, probably you will also want Facebook author URL (the user profile) or Facebook page URL to link the post to the facebook profiles.
Don't forget to enable generic django meta support (at least META_USE_OG_PROPERTIES: https://django-meta.readthedocs.io/en/latest/settings.html#meta-use-og-properties)

Django admin/frontend authentication issue

I am developing an application using Django 1.4. When I log into admin site in another tab in the browser, the application interface in which I am already logged in automatically logs out. Please help me in solving this issue. The browser I am using is Firefox. Thanks in advance.
Admin is also a user in django. So, you can't have more than one user logged in at the same time in the same browser, can you? Try the same scenario on facebook. This is what it is. You re fine, there's no problem.
On the side note, if you are just getting started with your project use Django 1.5.
Well you cannot log into the same website with different login ids simultaneously until and unless you dont use some plugins for this feature or you are opening different ids in the incognito window.
Since admin is a superuser(still a user), hence you cannot open a multiple django accounts in the same browser. One account will be logged out in order to open the other one. This is no issue. Happy coding.
The Django admin site is just another page of your Django main website. Say if you have foo.com, then foo.com/admin/ shows you the admin portal.
And we already know that two users cannot be simultaneously logged in to the same website from the same browser.
So, you can test on your foo.com site, being an admin user itself. Experience on the Django website for any user will be same, it doesn't change with user being a staff member or superuser. Only admin site has different permissions based on these factors.
In this case, you'll be able to use both the main site, as well as admin portal.
But if you really want to use different user accounts for admin site and main site, then you should either use different browsers or Private window in Firefox.

AllAuth Installation

I'm attempting to install and configure Django AllAuth and I've run into a plethora of obstacles. I'm afraid I'm simply missing a few basic concepts which might clear some things up.
In order to get basic social authentication working what setup needs to be done inside the social provider (Facebook, Twitter, etc.)
If this is the case then how would one develop locally because at first glance of Twitter's API setup it asks for redirect URLs which would get hairy considering everything right now is hosted locally.
When I try and go to /accounts/login/ it redirects to /accounts/profile/ every time. Can't seem to figure out what's causing this redirect.
I was previously using Userena for my user authentication and was going to add Django-social-auth but when I got into it that was giving me difficulty. I then found AllAuth which seemed to fit my needs perfectly but again, having some issues. Can anyone weigh in on this decision, would you recommend one over the other and if so why?
Facebook Error:
"Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains."
When I click okay it redirects back to my site. My browser gives me a security error and when I proceed through that I end up back at my site displaying:
"Social Network Login Failure
An error occurred while attempting to login via your social network account."
1) Have a look here: https://speakerdeck.com/tedtieken/signing-up-and-signing-in-users-in-django-with-django-allauth
(specifically, slide 61 and above)
2) Simply use 127.0.0.1:8000 in your redirect URLs
3) By default allauth redirects to LOGIN_REDIRECT_URL, which is set out of the box to /accounts/profile/: https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url
4) As I am the author of allauth I will skip answering this question myself. Browse through the complete presentation referred to by 1) -- the initial slides provide a good comparison of the various options.