Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels
AutoResearch: A Pure-Python open-source LLM-driven research automation tool
Hello, everyone
I recently developed a new open-source LLM-driven research automation tool, called AutoResearch. It can automatically conduct various tasks related to machine learning research, the key function is:
Topic-to-Survey Automation \- In one sentence, it converts a topic or research question into a comprehensive survey of relevant papers. It generates keywords, retrieves articles for each keyword, merges duplicate articles, ranks articles based on their impacts, summarizes the articles from the topic, method, to results, and optionally checks code availability. It also organizes and zips results for easy access.
When searching for research papers, the results from a search engine can vary significantly depending on the specific keywords used, even if those keywords are conceptually similar. For instance, searching for "LLMs" versus "Large Language Models" may yield different sets of papers. Additionally, when experimenting with new keywords, it can be challenging to remember whether a particular paper has already been checked. Furthermore, the process of downloading papers and organizing them with appropriate filenames can be tedious and time-consuming.
This tool streamlines the entire process by automating several key tasks. It suggests multiple related keywords to ensure comprehensive coverage of the topic, merges duplicate results to avoid redundancy, and automatically names downloaded files using the paper
/r/Python
https://redd.it/1i2lw4i
How do I run a standlone function in Django?
I have this function in a module. (not in views). Which processes some data periodically and saves the results. But Celery is giving me issues running it and I don't know if the function actually works as intended or not. So I want to run that function only for testing. How do I do this?
/r/djangolearning
https://redd.it/1i2ka0x
Explore OSS built in the Flask ecosystem!
Hi r/flask ! I'm part of a small team building a new discovery tool for open source called **market.dev**. It's a way to easily search and browse what's happening in OSS - for projects, people, and resources. Here's the Flask ecosystem at a glance.
We built this because we wanted an ecosystem centric view of open source, auto-categorized and easily to keep up with. We also wanted to explore a **redesigned project view** with focus on what the repo is about, community info, package downloads where available, related projects and the ability to compare repos easily.
Here's what else you can use this for:
[Find other people in the Flask comunity](https://market.dev/ecosystems/flask/experts), and filter by location
Find Flask projects looking for contributors
There's a lot still to do - search and comparisons are two things we're focused on right now. But I would love some feedback from this sub to see how useful this is to you, and any features you'd like to see!
Thanks so much in advance for any feedback!
/r/flask
https://redd.it/1i27xs4
Apache or Nginx
What's better to use on Django project with mysql bd as a web-server, apache or nginx?
/r/django
https://redd.it/1i213fe
WASM-powered codespaces for Python notebooks on GitHub
What my project does
During a hackweek, we built this project that allows you to run marimo and Jupyter notebooks directly from GitHub in a Wasm-powered, codespace-like environment. What makes this powerful is that we mount the GitHub repository's contents as a filesystem in the notebook, making it really easy to share notebooks with data.
All you need to do is prepend 'https://marimo.app' to any Python notebook on GitHub. Some examples:
Jupyter Notebook: [https://marimo.app/github.com/jakevdp/PythonDataScienceHandb...](https://marimo.app/github.com/jakevdp/PythonDataScienceHandbook/blob/master/notebooks/02.08-Sorting.ipynb)
marimo notebook: https://marimo.app/github.com/marimo-team/marimo/blob/07e8d1...
Jupyter notebooks are automatically converted into marimo notebooks using basic static analysis and source code transformations. Our conversion logic assumes the notebook was meant to be run top-down, which is usually but not always true [2\]. It can convert many notebooks, but there are still some edge cases.
We implemented the filesystem mount using our own FUSE-like adapter that links the GitHub repository’s contents to the Python filesystem, leveraging Emscripten’s filesystem API. The file tree is loaded on startup to avoid waterfall requests when reading many directories deep, but loading the file contents is lazy. For example, when you write Python that looks like
with open("./data/cars.csv") as f:
print(f.read())
# or
/r/Python
https://redd.it/1i270co
Dash app down , 502 error randomly
I’ve deployed a dash app on one of my corporate servers (linux) and i have users complaining from application being down for no reason. (502 error)
Anyone has an idea about this issue ? maybe a tiemout from dash ?
THANKS
/r/flask
https://redd.it/1i21gni
Running Django’s test suite for the first time problem
https://preview.redd.it/yikxryyv76de1.png?width=690&format=png&auto=webp&s=abb125ae95949ec2c4bcbef6c905f04bd1a003db
Hi. I found an instruction to run test suite for the first time here:
https://docs.djangoproject.com/en/dev/intro/contributing/
i have done everything written there but have some issues:
One of the tests (last on the screen) runs for a very long time and does not change its state
Can anyone suggest - what could be the problem?
/r/django
https://redd.it/1i1z193
MFA in flask web app
I would like to set up email and /or phone number verification for users on a web app. I'm finding it so hard . Any help and assistance will be much appreciated
/r/flask
https://redd.it/1hxujfg
Doubts about deleting elements
I'm creating a website where you can register and thus get a warehouse where you can store your wav and mp3 files, listen to them from there and maybe download them later.
I finished implementing the functionality to allow the user to delete his songs. There is a problem, or rather, perhaps it is more of a fear of mine, so tell me if what I say doesn't make sense.
I first delete the song in the directory and then in the database (where the file name is stored). I would like to make sure that these two instructions are connected, that is, if for some strange reason the db.session.commit() fails and therefore does not save the changes to the database, I would then like the directory not to be modified either.
This is my code piece:
db.session.query(Sound).filter(Sound.body == sound_to_delete, Sound.user_id == current_user.id).delete()
sound_path = os.path.join('app', 'static', 'uploads', f'{current_user.username[0].upper()}', f'{current_user.username}', f'{sound_to_delete[0].upper()}', sound_to_delete)
if os.path.isfile(sound_path):
os.remove(sound_path)
db.session.commit()
/r/flask
https://redd.it/1hzmwac
Monday Daily Thread: Project ideas!
# Weekly Thread: Project Ideas 💡
Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.
## How it Works:
1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.
## Guidelines:
* Clearly state the difficulty level.
* Provide a brief description and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.
# Example Submissions:
## Project Idea: Chatbot
**Difficulty**: Intermediate
**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar
**Description**: Create a chatbot that can answer FAQs for a website.
**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)
# Project Idea: Weather Dashboard
**Difficulty**: Beginner
**Tech Stack**: HTML, CSS, JavaScript, API
**Description**: Build a dashboard that displays real-time weather information using a weather API.
**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)
## Project Idea: File Organizer
**Difficulty**: Beginner
**Tech Stack**: Python, File I/O
**Description**: Create a script that organizes files in a directory into sub-folders based on file type.
**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)
Let's help each other grow. Happy
/r/Python
https://redd.it/1i00vbq
FuzzyAI - Jailbreak your favorite LLM
My buddies and I have developed an open-source fuzzer that is fully extendable. It’s fully operational and supports over 10 different attack methods, including several that we created, across various providers, including all major models and local ones like Ollama. You can also use the framework to classify your output and determine if it is adversarial. This is often done to create benchmarks, train your model, or train a detector.
So far, we’ve been able to jailbreak every tested LLM successfully. We plan to maintain the project actively and would love to hear your feedback. We welcome contributions from the community!
/r/Python
https://redd.it/1hzpqxu
Python with type hints and Mypy: regret for not using statically typed lang?
If a company adopted Python and then, after several years, integrates MyPy, wouldn't they be better off if they'd start with a statically typed language instead of Python?
This sounds like an uphill battle to get to some half-baked type-safety, but I'm not versed in Python development, so asking the pros here (I realize this might not be the best place to ask this question, to say the least, but I'll give it a try)
/r/Python
https://redd.it/1hzk4vb
How to Protect My Django Website Hosted on Lambda from Bots Without Wasting Requests?
Hi, everyone!
I’m hosting a Django website on AWS Lambda, and since Lambda charges based on the number of requests, I’m worried about bots abusing the site and driving up my costs.
I know tools like CAPTCHA can help filter bots, but since the request would already reach the Lambda function before the CAPTCHA is served, it doesn’t prevent the cost from those initial requests.
Are there strategies or tools that can block bots before they hit the Lambda endpoint? I’ve heard about WAFs (Web Application Firewalls), but I’m unsure about the best approach or whether there are other effective solutions for this type of setup.
Any advice would be greatly appreciate!
/r/django
https://redd.it/1hzmqka
D Have transformers won in Computer Vision?
Hi,
Transformers have reigned supreme in Natural Language Processing applications, both written and spoken, since BERT and GPT-1 came out in 2018.
For Computer Vision, last I checked it was starting to gain momentum in 2020 with An Image is Worth 16x16 Words but the sentiment then was "Yeah transformers might be good for CV, for now I'll keep using my resnets"
Has this changed in 2025? Are Vision Transformers the preferred backbone for Computer Visions?
Put another way, if you were to start a new project from scratch to do image classification (medical diagnosis, etc), how would you approach it in terms of architecture and training objective?
I'm mainly an NLP guy so pardon my lack of exposure to CV problems in industry.
/r/MachineLearning
https://redd.it/1hzn0gg
MongoDB with Django, WHY?
Has anybody here ever needed to use MongoDB with Django? I'm curious to know why there is such a demand for MongoDB in the Django community, considering that Django's ORM is deeply tied to a relational structure. Why the push for Mongo?
And by "demand," I mean enough people want this for me to notice.
The top recommendations I keep seeing are terrible.
1. Use **Pymongo** - This is bad because you loose a lot of Django features such as the built-in ORM, Auth, etc
2. **Djongo** - This is NOT a valid solution. Only works with Django 3.0.5 and does not really work. Also, it has not been maintained for several years.
/r/django
https://redd.it/1hz5iby
In production level where will you store user sessions.
/r/flask
https://redd.it/1i2ito9
Any well known open-source python packages use Astral's uv tool?
I'm looking a Astral's uv, and it seems very interesting to manage applications and their dependencies. Even for internal packages I can see its use, but I'm having a hard time seen the workflow for an open-source public package where you need to support multiple Python versions and test with them.
Do you know of any open-source package project that uses uv in its workflow?
/r/Python
https://redd.it/1i20lvm
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!
# Weekly Thread: Professional Use, Jobs, and Education 🏢
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
---
## How it Works:
1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.
---
## Guidelines:
- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.
---
## Example Topics:
1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?
---
Let's help each other grow in our careers and education. Happy discussing! 🌟
/r/Python
https://redd.it/1i2botq
What is the best way to ban someone's IP?
Long story short, I operate a golf wiki, and it's grown enough to have my first horrific and racist troll updating courses with wildly inappropriate things.
It's pretty clear that this person *doesn't realize your full IP is posted with any anonymous edit*.
Having never encountered this problem before, I'm trying to figure out an effective way of taking edit privileges away without the user trying to find a workaround.
First however, I need to know which IP to ban. I've been using **request.access_route** rather than **request.remote_addr** because it seems to be more complete, but I'm going to be honest that I'm not entirely sure whether that is necessary.
It seem like the best method would be to use **request.access_route**, but then to take the -1th list item from that list and ban that? Or should I simple ban the entire access route.
I don't want to accidentally ban the public library, but we don't exactly have access to mac addresses... so... I'm not entirely sure what to do.
Any advice from someone who is better informed on networking stuff?
/r/flask
https://redd.it/1i27y66
Hard to master topics in Django
Recently I have been using Django quite alot I have about 2 years of experience in it now and I can almost always think of a solution in django when implementing new features, so I am starting to think that I am entering a comfort zone and not really learning new things.
So I wanted to get recommendations about features or changes that people may have struggled with and if I like something I may end up implementing it.
Thank you all for the suggestions.
/r/django
https://redd.it/1i22cpz
I've Created a Python Library That Tracks and Misleads Hackers
Background
Hello everyone! A few months ago, I created a small web platform. Since I have many security engineer followers, I knew they would actively search for vulnerabilities. So, I decided to plant some realistic-looking fake vulnerabilities for fun. It was fun, and I realized that it can be actually very useful in other projects as well. I could monitor how many people were probing the platform while having them waste time on decoy vulnerabilities. Therefore, I've created BaitRoute: https://github.com/utkusen/baitroute
What My Project Does
It’s a web honeypot project that serves realistic, vulnerable-looking endpoints to detect vulnerability scans and mislead attackers by providing false positive results. It can be loaded as a library to your current project. It currently supports Django, FastAPI and Flask frameworks. When somebody hits a decoy endpoint, you can send that alarm to another service such as Sentry, Datadog, etc. to track hackers. Also, if you enable all rules, attackers' vulnerability scans become a mess with false-positive results. They'll waste considerable time trying to determine which vulnerabilities are genuine.
Target Audience
It can be used in web applications and API services.
Comparison
I’m not aware of any similar projects.
/r/Python
https://redd.it/1i208uo
I Made Search Engine Using Python And Flask.
https://youtu.be/Wy6j7EiuyLY
/r/flask
https://redd.it/1i0axr7
spss syntax to pandas
does anyone have a good resource showing spss syntax to python pandas, a crosswalk showing the code? i am aware that not everything is a 1 to 1 match. but most of the tabular data wrangling the methodology is the same. thanks western watts
/r/Python
https://redd.it/1hzszu4
I made a Blood Analysis Tool because I'm a True Crime junkie
I made this project with OpenCV and Streamlit. Let me know what you think?
https://youtu.be/SGF-PqMpctY
GitHub (please watch the video): https://github.com/saifaldin14/BloodSplatterAnalysis
What My Project Does: This is a small 2D Blood Analysis App inspired by the True Crime videos I like watching!
Target Audience: Programmers and YouTube enthusiasts who like seeing cool projects
Comparison: This is a simplified version of real-world forensic analysis tools. It uses a lot of the same computer vision techniques in other projects but its idea is far more unique. I think the techniques showed in this video are really useful for people trying to learn image analysis and computer vision.
/r/Python
https://redd.it/1hzqc40
Built My First Document Scanning and OCR App – Would Love to Hear Your Thoughts!
Hi everyone! 👋
I recently finished ocr-tools ,a small project, and as someone still learning and exploring new skills, I wanted to share it with you all! It’s a simple web app where you can:
# What My Project Does
Upload an image (like a photo of a document).
Automatically detect the document's corners and apply perspective correction.
Extract text from the document with OCR and save it as a searchable PDF.
I built this using FastAPI, along with OpenCV for the image processing and Tesseract for the OCR. The process taught me so much about working with images, handling user inputs, and creating APIs. It’s designed to be straightforward and helpful for anyone who wants to scan documents or images quickly and cleanly.
Here are some of the main features:
Clean UI: Upload images easily and process them in a few clicks.
Perspective correction: Automatically detects and crops the document to give you a straightened view.
OCR output: Extracts text and saves it to a PDF.
# Target Audience
It is just a toy project to learn new skills
# Comparison
There are a lot of projects like this and better than this one
Thanks for reading, and I hope you find it as fun as I did
/r/Python
https://redd.it/1hzpohx
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/1hzprm8
How to prepare for aptitude?
I am just starting to prepare for aptitude tests, but I find it hard to solve the problems. I understand in videos that how to solve ,but i can’t figure out how to solve it. Many problems also seem the same, which confuses me. Can you suggest some easy-to-understand YouTube channels for learning aptitude and give tips to help me improve?
/r/django
https://redd.it/1hzpnzu
This is a "Fantasy Investment" game - built on Flask/AlpineJS/TailwindCSS
https://redd.it/1hzhc5e
@pythondaily
Train an LLM from Scratch
# What My Project Does
I created an end-to-end LLM training project, from downloading the training dataset to generating text with the trained model. It currently supports the PILE dataset, a diverse data for LLM training. You can limit the dataset size, customize the default transformer architecture and training configuration, and more.
This is what my 13 million parameter-trained LLM output looks like, trained on a Colab T4 GPU:
In ***1978, The park was returned to the factory-plate that the public share to the lower of the electronic fence that follow from the Station's cities. The Canal of ancient Western nations were confined to the city spot. The villages were directly linked to cities in China that revolt that the US budget and in Odambinais is uncertain and fortune established in rural areas.
# Target audience
This project is for students and researchers who want to learn how tiny LLMs work by building one themselves. It's good for people who want to change how the model is built or train it on regular GPUs.
# Comparison
Instead of just using existing AI tools, this project lets you see all the steps of making an LLM. You get more control over how it works.
/r/Python
https://redd.it/1hzg5fh
Django + htmx
Hello is there people making theirs own saas web apps with django + htmx if yes how is the experience is it as fast as going with a js framework like next js , nuxt js ..
i m struggling to choose to learn python + django or going for react + next js to build my own saas apps
Thnks for the feedback
/r/django
https://redd.it/1hzal6h