pythonofftopic | Unsorted

Telegram-канал pythonofftopic - Offtopic

12466

Offtopic group for casual talking about anything. @rules_for_python still apply (except for the ontopic rule)

Subscribe to a channel

Offtopic

i think not to use js

Читать полностью…

Offtopic

Not sure what do you mean by js structer btw

Читать полностью…

Offtopic

i wanted to get sugession in my .js files as i am doing in flask but the real js code need to be done in js structer, so i wish i only want like pylance's error for my js but i found when i try to do setup the eslint, it say https://eslint.org/docs/latest/use/getting-started#quick-start

and form here i foudn in my repo there just making the package.json, ... node_modules are also creating in my python repo, is this really ok there in my flask code?

Читать полностью…

Offtopic

Is anyone here JavaScript Developer ???

Since I realized I need to use JavaScript anyway, I am currently using VS Code. However, I am not receiving proper warnings when writing JS code, likely because the HTML elements are not recognized, even though the code itself does not show any errors. This is different from Python, where Pylance in strict mode provides clear warnings.

What extensions do you recommend for .js files to get similar functionality? As I am completely new to JavaScript, I would like to start with the best tools from the beginning. Any suggestions?

What i found by my research is this: EsLint -> but i am not getting why it say after install the extension i need to do some global, local setup even i am using python, so why i will do local setup of using npm here i am confused or is this standard to use?

Читать полностью…

Offtopic

I just scrapped $80 worth of content :)

Читать полностью…

Offtopic

https://flask-wtf.readthedocs.io/en/0.15.x/csrf/#javascript-requests

Читать полностью…

Offtopic

how did u get graphics card in this economy

Читать полностью…

Offtopic

Still, it's better to add an exception :)

Читать полностью…

Offtopic

oooh...can you just add an exception?

Читать полностью…

Offtopic

right now I'm trying to disable or remove this anti malware thing in windows 11 somehow, but it keeps turning itself back on.

Читать полностью…

Offtopic

Yup. Da sleep is very important for the efficient functioning of your brain

Читать полностью…

Offtopic

depends on the amount of my income

Читать полностью…

Offtopic

https://youtu.be/28GCv_C-SVI

Читать полностью…

Offtopic

leave this thanks bye

Читать полностью…

Offtopic

so host private repo in vps is also risky? what should be more best way to be secure of these?

Читать полностью…

Offtopic

yes so i am confused as in my github repo the js thigns will also got uploded even those not need for my python app.

Читать полностью…

Offtopic

If you want js tooling somewhere will need to be referenced right?

Читать полностью…

Offtopic

What it has to do EsLint with python? Just setup EsLint in your computer so the extension can use it

Читать полностью…

Offtopic

what did u even scraped

Читать полностью…

Offtopic

Thanks for this btw, i though i need to do something like this, but i missed this part 😅 💚

For me in this case, in the js funciton i just add this:

var csrfToken = document.querySelector(
'meta[name="csrf-token"]'
).content;

and then in header i add csrfToken and all got solved 😀

Читать полностью…

Offtopic

Hello, I was using the Flask-WTF library and have the following code in my head:

<meta name="csrf-token" content="{{ csrf_token() }}">


However, I found that when client-side JavaScript makes a request, the CSRF token gives me an error. As far as I have researched, when JavaScript performs a POST request to my endpoint, the CSRF token value is not being sent to my Flask application. How can I fix this?
My js looks like this:-

async function fetchRights(contentId, options) {
var response = await root.fetch((options && options.rightsUrl) || RIGHTS_URL, {
method: "POST",
headers: { Accept: "application/json", "Content-Type": "application/json" },
body: JSON.stringify({
content_params: { content_id: contentId, content_type: CONTENT_TYPE }
}),
signal: options && options.signal
});

I maybe thinking my js has the probme not the flask_wtf library, what do you anyone know this

Even i found my routes function not executes anyway it just directly returns the 400 error, any sugession where to look upon

Читать полностью…

Offtopic

what are you cooking !

Читать полностью…

Offtopic

I disabled it again and this time it worked somehow

Читать полностью…

Offtopic

it keeps deleting my files

Читать полностью…

Offtopic

agreed, everytime I sleep late my day is ruined

Читать полностью…

Offtopic

if I can afford to get it done for me, I'd prefer to sleep 30 minutes more

Читать полностью…

Offtopic

Would you like to spend 30 minutes preparing breakfast every workday?

Читать полностью…

Offtopic

yes that's still the best option anyway 😅

Читать полностью…

Offtopic

no it's not as they said

you need direct links to get to serious stuff there

you won't find stuff just like the moment you install it

Читать полностью…

Offtopic

Though nobody has important and critical data in a VPS.

You should always assume that someone is going to see them when using a VPS.

Читать полностью…
Subscribe to a channel