Django let me log in in Firefox but not in chrome - python

I recently started playing with Django.
When I try to log in into the admin panel, it succeeds in Firefox but doesn't in Google Chrome.
This is the error i get :
Forbidden (CSRF cookie not set.): /admin/login/
My cookies are enabled in Chrome for every website. Is there a specific reason why it would work in Firefox but not in Chrome?
Thanks!

I had similar problem and the solution for me was to set Django setting
SESSION_COOKIE_SECURE = False
I know this is the default setting but I've been using production config with this set to True. So in my dev settings I changed it to False and was able to log in to admin panel in Chrome.
On Feb 2020 Chrome implemented a change that enforces that Secure cookies are only accessible via HTTPS protocol. So if you're developing locally and only using HTTP that is a killer. Firefox and Edge are yet to enforce Secure flag |(based on taday's versions)

Are you not developing using the c9 platform?
https://c9.io/

I reset my chrome setting and it worked fine.
In Chrome, click on the 3 dots on the far right and goto settings.
On settings page, scroll all the way down or click on the bottom left "Reset Settings" button and reset settings.

Related

Chrome python uses different than Chrome on desktop?

When I check the settings on Chrome on my desktop it is set to Allow all cookies. But when I run python, the Chrome that loads is set to Block third-party cookies in incognito.
This is a problem with one website that gives me the error message "You must have cookies enabled..."
Is the Chrome that python loads different than the one on my desktop? If so where is it located and how do I change the default setting?
If I change the setting on the python Chrome to Allow all cookies, the next time it loads it is back to the setting of Block third-party cookies in incognito.
I went into Regedit and set Chrome IncognitoModeAvailability to 0. This made the desktop Chrome to be set to Allow all cookies but that didn't change the python Chrome.
Or can I add an argument to set Chrome to Allow all cookies. I have found many examples of allowing incognito (chrome_options.add_argument("--incognito")) but none for allow all cookies.

Python Selenium: Proxy authentication in Headless mode

Following this question, I know how to authenticate the proxy. This method is like using an extension to control the authentication. And to use the extension, the browser must be shown up.
My question is: How can I authenticate the proxy without an open browser (headless mode), using selenium and chromewebdriver?
I tried with using google chrome flags. But cannot find the solution.

How do I fix this: Your connection isn't private

When I try to enter my webpage I get this in Chrome and Edge.
I have the https.
security
error
You need to configure a certificate for your web app. Under the "Security" section on your web app configuration page.

need Adblockplus filter systemwide via /etc/hosts

I'm scraping some websites to get at content they have using selenium in python. I can run headless firefox via geckodriver with marionette capability set to True with adblockplus extension enabled and it works well. However recent versions of firefox (as of March 2021) don't support performance logging - which is a must for my purpose. So I've had to switch to using chromedriver and Chromium. Logging works great but chromium when being run in headless mode has no support for browser extensions and throws errors.
So I figure I keep using chromedriver with Chromium but not having adblockplus or any other adblocking is really hurting my runtime and there are some overlays that wouldn't be there otherwise.
How can I find and extract the filter list of my adblockplus browser extension so I can apply the same filtering by using the domain names in there and my /etc/hosts file i.e. sending all those 'bad' domains to 0.0.0.0
If you open the settings and click on the advanced. you will see the filters. Each filter points to an url where there are stored.
1.The easy list i previous linked: https://easylist-downloads.adblockplus.org/easylist.txt
2. The ABP filters https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt

Snowflake Python connection using externalbrowser authenticator

I have code to connect to Snowflake through Python using external browser authentication (authenticator parameter set to 'externalbrowser')
I also have installed snowflake-connector-python version 2.3.5
On my machine running snowflake.connector.connect displays the following message, but doesn't open any browser windows to do the authentication:
"Initiating login request with your identity provider. A browser window should have opened for you to complete the login. If you can't see it, check existing browser windows, or your OS settings. Press CTRL+C to abort and try again..."
On my old machine it displays the same message, but opens a browser window to log in. What do you think can be causing this problem, and what can I do to fix this? Am I missing a package?
You want to try the troubleshooting suggested by Snowflake blog here EXTERNAL BROWSER SSO FROM CONNECTOR FAILS ON REDIRECT BACK TO LOCALHOST
I ran into the same issue, and do not set parameter "authenticator" to 'externalbrowser', if its optional you can remove this parameter and test.
after i remove "authenticator" parameter from my config file, I was able to authneticate and establish connection to snowflake.
You can try by allowing the pop up in your browser in the system settings

Categories

Resources