facebook_django : Given URL is not permitted by the application config - django

I'm getting this error for facebook login in local development. I'm using facebook_django package. And my dev server runs on 0.0.0.0:8000. In my site url I've tried setting my site url to 127.0.0.1:8888 and 0.0.0.0:8000 both and both ways it gives the same error
Given URL is not permitted 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.
Also what should be the input for App Domain field in local development ?

Related

Can a localhost address be allowed to load a site in an iframe from the csp header?

I would like to know if it is possible to allow localhost to make changes to a specific site by setting it in the csp header in the settings.py file of the Django project. For my part, I am trying to load my Django site in an iframe present on a page at the following address http://localhost:3000/searchEngine. So I inserted this in my settings.py file:
CSP_FRAME_ANCESTORS = ("'self'", 'localhost:*')
This is taken into account, but still does not allow localhost to load the site in the iframe and I get the following error, when I try to load this site in the iframe:
Refused to frame 'https://gkwhelps.herokuapp.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' localhost:*".
I don't know not why yet I did not make syntax errors. So I wonder if django-csp takes localhost into account. I would like to allow my site to load in an iframe from any port in my localhost.

How to Configure django_plotly_dash to serve assets from custom url

I have an hybrid app with most pages being on vuejs but some legacy code pages are still being served through dash-django app.
previously it was wholly a dash app.
on the production environment this is being served through an nginx with dedicated static directory and a reverse proxy.
The app is being served on a subdomain.
So the url looks like :
abd.com/subdom/route_to_app_endpoints
where abd.com is set to serve nginx files from base directory
and abd.com/subdom is reverse proxy to serve files from port 8000 on which the django application is running.
The problem I'm facing is when the app loads the base url i tries to load the components and the layout from is hitting the root directory :
eg for
abd.com/.django_plotly_dash/app/FileUpload/_dash-layout and it
gives 404 not found. This is what it tries by default .
whereas if i request
abd.com/subdom/django_plotly_dash/app/FileUpload/_dash-layout my
browser gives a nice output ..
I tried setting :
PLOTLY_DASH = {
"requests_pathname_prefix" :"/subdom/"
}
in the settings.py but still it is unable to route properly.

Django setting root url path for redirects

I have a project with the following components:
a single page backbone application for the web client
a django app for the api
nginx in front to direct requests to backbone and django
In my nginx conf, I direct the requests to django if the path starts with /api ,
otherwise, I serve the files directly (index.html and static files)
This setup works fine, the problem arises when django needs to redirect the url. Say, for instance, I request /api/users , as I have forgotten the trailing slash, django automatically redirects this, but instead of redirecting to /api/users/ , it redirects to /users/ as django does not know that I am hosting it on /api. How can I configure django to handle this redirect correctly?

Given URL not allowed by the Application configuration

I am developing a web application in tizen to integrate with facebook and I am getting "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" error. I have searched a lot and I am not clear about what I have to mention in "App Domains" (I am developing app for mobile) section after getting appId. Please help me to resolve this error
It sounds like a Cross Domain AJAX Request problem. You have to allow the access in your config.xml file - either each url you call, or for all (*):

can't access facebook using fandjango

I have fandjango setup on my django app and I have the "Site URL" pointing to the exact spot where the dynamic page is shown.
http://www.example.com/apps/myapp
This gives me the following error message box.
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.
I'm not sure how to debug this. Looking at similar people's posts, they said they had this problem only if there was a mismatch between the site url, but even if I copy and paste the site url into my browser, I still get the same error. I don't have https setup, if that matters.