cookie

Ми використовуємо файли cookie для покращення вашого досвіду перегляду. Натиснувши «Прийняти все», ви погоджуєтеся на використання файлів cookie.

avatar

Python Daily

Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels

Більше
Рекламні дописи
2 446
Підписники
Немає даних24 години
+217 днів
+7330 днів

Триває завантаження даних...

Приріст підписників

Триває завантаження даних...

Tuesday Daily Thread: Advanced questions # Weekly Wednesday Thread: Advanced Questions 🐍 Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices. ## How it Works: 1. **Ask Away**: Post your advanced Python questions here. 2. **Expert Insights**: Get answers from experienced developers. 3. **Resource Pool**: Share or discover tutorials, articles, and tips. ## Guidelines: * This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday. * Questions that are not advanced may be removed and redirected to the appropriate thread. ## Recommended Resources: * If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance. ## Example Questions: 1. **How can you implement a custom memory allocator in Python?** 2. **What are the best practices for optimizing Cython code for heavy numerical computations?** 3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?** 4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?** 5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?** 6. **What are some advanced use-cases for Python's decorators?** 7. **How can you achieve real-time data streaming in Python with WebSockets?** 8. **What are the /r/Python https://redd.it/1e4abe5
Показати все...
Join the Python Discord Server!

We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 388997 members

Implemented Full-Stack Web App with Next.js and Django Rest Framework: Facing CSRF Verification Issues Hey everyone, I've recently developed a full-stack web application using Next.js for the frontend and Django Rest Framework (DRF) for the backend. For authentication, I used Simple JWT. Everything was going smoothly until I encountered a problem with CSRF verification failures. It seems like my requests from Next.js to the Django backend are being blocked due to CSRF token mismatches. Here’s a brief rundown of my setup: Frontend: - Next.js - Axios for making HTTP requests - Integrated authentication using JWTs from the backend Backend: - Django - Django Rest Framework - Simple JWT for token-based authentication The Issue: When I make authenticated requests from my Next.js app to the Django API, I keep getting CSRF verification failed errors. I've tried several solutions, including adding CSRF tokens to the requests and configuring CORS settings, but nothing seems to work. Has anyone faced similar issues or have any suggestions on how to resolve this? Any help or guidance would be greatly appreciated! Thanks in advance! Feel free to adjust the details to better fit your specific situation. /r/django https://redd.it/1e4hiys
Показати все...

Is SQLAlchemy really that good? I've read a lot about SQLAlchemy and it seems to get a lot of hate for bad documentation or poor performance. I heard Peewee is a good alternative that's much more optimized and easier to use. The question is though, why is SQLAlchemy still so popular and widely used in industry? I heard it's the go-to for startups who choose Flask for their projects. Personally I work with raw SQL queries The only advantage of SQLAlchemy I can sense is when defining tables and data, it's much easier to make the change, while with raw queries, you must modify each query string statement individually. For projects that use many tables with tons of columns that might be exhausting. But if the performance concerns are true, how does SQLAlchemy get away with it? /r/flask https://redd.it/1e4bbjj
Показати все...
From the flask community on Reddit

Explore this post and more from the flask community

Unable to type texts to chatbot user input Hey guys, first time posting here. I am trying to add a chatbot for the backtesting platform built with Flask and there is a button on the right side that toggles the sidebar. If the user clicks the button, it shows the sidebar with a chatbot. But I'm going through an unexpected bug and would be utterly grateful if you guys could help me out. I'll add this link(https://stackoverflow.com/questions/78752558/unable-to-type-texts-to-chatbot-user-input) that I posted on StackOverflow with the HTML, CSS, JS codes, and app.py code. # Expected Behavior The user should be able to type texts into the chatbot user input field. # Current Behavior Currently unable to type texts into the chatbot user input field. https://preview.redd.it/l8l04x804tcd1.png?width=1914&format=png&auto=webp&s=81080e4a4efb536d9a9a4c9c9a29ff4f56082a63 /r/flask https://redd.it/1e4fj86
Показати все...
Unable to type texts to chatbot user input

Description I am trying to add a chatbot for the backtesting platform built with Flask and there is a button on the right side that toggles the sidebar. If the user clicks the button, it shows the

Docker for Flask I have been trying to look for online solutions and practices followed but generally they do it for the flask template app which does not cover the cases for real-world large scale applications. I personally have worked on numerous flask applications but while deploying am never successful in actually implementing the Dockerfile. Kindly guide me on how to tackle this. /r/flask https://redd.it/1e42cx3
Показати все...
From the flask community on Reddit

Explore this post and more from the flask community

Django devops without Kubernetes I'm not trying to use Kubernetes and AWS EKS. They're too overkill for my current project. How can I deploy without downtime while not using Kubernetes? I want to avoid deployment downtime at all cost. /r/django https://redd.it/1e408bc
Показати все...
From the django community on Reddit

Explore this post and more from the django community

Показати все...
CORS: the ultimate guide | Devsecurely

A simple and concrete guide on the world of CORS. It explain what it is, how it works, and how to set it up to protect your website.

OpenSkill MMR Rating System Now Features Per Player Weights What My Project Does OpenSkill is a peer-reviewed multiplayer ranking and rating system you can use to implement matchmaking systems on top of. This rating system behaves "like" TrueSkill, but is full open source, and unencumbered by patents, or trademarks. TrueSkill (Microsoft's proprietary, and patented rating system), has had something similar to this feature called "partial-play" for a while now. Our implementation is fully typed, supports pypy, and cpython and has 100% test coverage. So what's this new change? Well there are not many open source rating systems (at least that I'm aware of) that let you consider in-game player scores to be factored into the rating updates. Only got 1 kill while the rest of your teammates got 4 or 5 kills? The rating system will update it's beliefs about a player based on these metrics. This means faster convergence to your actual skill. Target Audience I hope this new feature is useful to the game development community, especially those making multiplayer games. There is a lack of support for the game development ecosystem in Python. So here's hoping, your next multiplayer game finds use of this project! Comparison Some alternatives include EloMMR, Glicko-2 and TrueSkill. All of these are lacking in some areas. GitHub Source /r/Python https://redd.it/1e42ds7
Показати все...
From the Python community on Reddit: OpenSkill MMR Rating System Now Features Per Player Weights

Explore this post and more from the Python community

D Simple Questions Thread Please post your questions here instead of creating a new thread. Encourage others who create new posts for questions to post here instead! Thread will stay alive until next one so keep posting after the date in the title. Thanks to everyone for answering questions in the previous thread! /r/MachineLearning https://redd.it/1e34cwr
Показати все...
From the MachineLearning community on Reddit

Explore this post and more from the MachineLearning community

I made GestureFlow to improve my productivity! # What My Project Does GestureFlow is an innovative application that enhances the traditional right-click functionality on computers by introducing a customizable radial menu. Here's what it does: 1. Radial Menu Activation: When you hold the right mouse button for a short duration (200ms), a circular menu appears around your cursor. 2. Quick Action Selection: Move your mouse in the direction of the desired action and release the button to execute it. No need for precise clicking on small menu items. 3. Customizable Actions: The menu includes common actions like Copy, Paste, Undo, Redo, and more. These can be easily customized or expanded in the code. 4. Visual Feedback: The menu provides clear visual feedback with hover effects and color changes, making it intuitive to use. 5. Cross-Platform Compatibility: GestureFlow works on both Windows and macOS, automatically adjusting its keyboard shortcuts for each platform. 6. Efficient Workflow: By combining multiple actions (e.g., "Select All + Copy"), it reduces the number of steps needed for common tasks. # Target Audience GestureFlow is designed for: 1. Power Users: Individuals who value efficiency and customization in their daily computer use. 2. Professionals: Developers, designers, writers, or anyone who frequently uses context-based actions in various applications. 3. Accessibility Enthusiasts: People interested in alternative input methods that /r/Python https://redd.it/1e3jye6
Показати все...
From the Python community on Reddit: I made GestureFlow to improve my productivity!

Explore this post and more from the Python community

Оберіть інший тариф

На вашому тарифі доступна аналітика тільки для 5 каналів. Щоб отримати більше — оберіть інший тариф.