How to build AI Agents with Django
I have written an article on how to build AI Agents with Django using Celery and redis as a broker. I explain how to communicate with a frontend server in real time with channels (websockets)
https://medium.com/@cubode/how-to-build-ai-agents-with-django-5abf1b228e00
Hope you enjoy it :) Ask me if you would like something more detailed
/r/django
https://redd.it/1ib7xht
I have written an article on how to build AI Agents with Django using Celery and redis as a broker. I explain how to communicate with a frontend server in real time with channels (websockets)
https://medium.com/@cubode/how-to-build-ai-agents-with-django-5abf1b228e00
Hope you enjoy it :) Ask me if you would like something more detailed
/r/django
https://redd.it/1ib7xht
Medium
How to build AI Agents with Django
The intersection of artificial intelligence and web development has opened the doors to creating smarter, more interactive applications. AIโฆ
Question about implementation of sending emails
I'm creating a web application following Miguel's mega-tutorial.
I'm on lesson 7 and I've encountered a problem: for some reason, despite having intentionally caused an error in my site, no message appears in the second terminal where aiosmtpd is running.
I don't understand why nothing appears. These are my bits of code that I used to try to make this stuff work:
in config file:
import os
basedir = os.path.abspath(os.path.dirname(__file__)) # Questa variabile immagazzina il percorso della directory principale sottoforma di stringa
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or b'mykey'
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'app.db')
MAIL_SERVER = os.environ.get('MAIL_SERVER')
MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25)
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
ADMINS = ['mymail@example.com']
in init file:
/r/flask
https://redd.it/1ibjlyy
I'm creating a web application following Miguel's mega-tutorial.
I'm on lesson 7 and I've encountered a problem: for some reason, despite having intentionally caused an error in my site, no message appears in the second terminal where aiosmtpd is running.
I don't understand why nothing appears. These are my bits of code that I used to try to make this stuff work:
in config file:
import os
basedir = os.path.abspath(os.path.dirname(__file__)) # Questa variabile immagazzina il percorso della directory principale sottoforma di stringa
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or b'mykey'
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'app.db')
MAIL_SERVER = os.environ.get('MAIL_SERVER')
MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25)
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
ADMINS = ['mymail@example.com']
in init file:
/r/flask
https://redd.it/1ibjlyy
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
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/1ibo7qe
# 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/1ibo7qe
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
Spend lots of time and effort with this python project. I hope this can be of use to anyone.
https://github.com/irfanbroo/Netwarden
What my project does
What it does is basically captures live
network traffic using Wireshark, analyzing packets for suspicious activity such as malicious DNS queries, potential SYN scans,, and unusually large packets. By integrating Nmap, It also performs vulnerability scans to assess the security of networked systems, helping detect potential threats. I also added netcat, nmap arm spoofing detection etc.
Target audience
This is targeted mainly for security enthusiasts for those people who wants to check their network for any malicious activities
Comparison
I tried to integrate all the features I can find into this one script which can save the hassle of using different services to check for different attacks and malicious activities
I would really appreciate any contributions or help regarding optimising the code further and making it more cleaner. Thanks ๐๐ป
/r/Python
https://redd.it/1ibg5co
https://github.com/irfanbroo/Netwarden
What my project does
What it does is basically captures live
network traffic using Wireshark, analyzing packets for suspicious activity such as malicious DNS queries, potential SYN scans,, and unusually large packets. By integrating Nmap, It also performs vulnerability scans to assess the security of networked systems, helping detect potential threats. I also added netcat, nmap arm spoofing detection etc.
Target audience
This is targeted mainly for security enthusiasts for those people who wants to check their network for any malicious activities
Comparison
I tried to integrate all the features I can find into this one script which can save the hassle of using different services to check for different attacks and malicious activities
I would really appreciate any contributions or help regarding optimising the code further and making it more cleaner. Thanks ๐๐ป
/r/Python
https://redd.it/1ibg5co
GitHub
GitHub - irfanbroo/Netwarden: Work in progress, as of now, it captures live network traffic using Wireshark, analyzing packetsโฆ
Work in progress, as of now, it captures live network traffic using Wireshark, analyzing packets for suspicious activity such as malicious DNS queries, potential SYN scans, and unusually large pack...
Google Search introduced JavaScript
Has anyone figured out how to get data from the first page of Google search results now? Selenium?
BeautifulSoup seemed to do the job just fine (like getting headers of search results).
Now apparently a bare minimum would be Selenium to mimic user interface interaction.
But it still don't seem to accomplish that.
Although this is introduced:
driver.implicitly_wait(30)
and
profile.set_preference("javascript.enabled", True)
Overall it looks something like
profile = webdriver.FirefoxProfile()
profile.set_preference("general.useragent.override", "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0")
profile.set_preference("javascript.enabled", True)
broswer = webdriver.Firefox(profile)
broswer.get('https://Google.xyz xyz xyz')
driver.implicitly_wait(1000)
soup = BeautifulSoup(driver.page_source,'html.parser')
print(soup)
Is that suffice? Or supposed to be suffice?
/r/Python
https://redd.it/1ibu91r
Has anyone figured out how to get data from the first page of Google search results now? Selenium?
BeautifulSoup seemed to do the job just fine (like getting headers of search results).
Now apparently a bare minimum would be Selenium to mimic user interface interaction.
But it still don't seem to accomplish that.
Although this is introduced:
driver.implicitly_wait(30)
and
profile.set_preference("javascript.enabled", True)
Overall it looks something like
profile = webdriver.FirefoxProfile()
profile.set_preference("general.useragent.override", "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0")
profile.set_preference("javascript.enabled", True)
broswer = webdriver.Firefox(profile)
broswer.get('https://Google.xyz xyz xyz')
driver.implicitly_wait(1000)
soup = BeautifulSoup(driver.page_source,'html.parser')
print(soup)
Is that suffice? Or supposed to be suffice?
/r/Python
https://redd.it/1ibu91r
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Lost $25k usd and access to my web app
I have a Django Web Application built on 5.0.6
I was "partnered" with an individual. This individual more or less has stripped me of a little over $25,000 in revenue, has added another developer to the hosting platform (DigitalOcean).
I reached out to DigitalOcean explaining the situation and they said their was nothing they could do without details I don't have access to.
Lesson learned the hard way.
I spent around 9 months building this project from nothing. I have reached out to a lawyer and the lawyer has verified that I do own 100% of it. (I just wanted to be certain.)
I've exhausted every method I know to get administrative access back but I've ran out of options. I created a script in one of the app.py files to create a new user and promote them to superuser. The new developer turned off autodeploy from my repo so I cant modify it the actual django app that is running anymore.
How can I create an admin account without console access?
What should I do?
I've tried everything I know.
Please help.
Update #1
Lawyer said to go ahead and file a DMCA Claim to DO. Lawyer will contacting the parties in the AM. I appreciate everyone's
/r/django
https://redd.it/1ibocln
I have a Django Web Application built on 5.0.6
I was "partnered" with an individual. This individual more or less has stripped me of a little over $25,000 in revenue, has added another developer to the hosting platform (DigitalOcean).
I reached out to DigitalOcean explaining the situation and they said their was nothing they could do without details I don't have access to.
Lesson learned the hard way.
I spent around 9 months building this project from nothing. I have reached out to a lawyer and the lawyer has verified that I do own 100% of it. (I just wanted to be certain.)
I've exhausted every method I know to get administrative access back but I've ran out of options. I created a script in one of the app.py files to create a new user and promote them to superuser. The new developer turned off autodeploy from my repo so I cant modify it the actual django app that is running anymore.
How can I create an admin account without console access?
What should I do?
I've tried everything I know.
Please help.
Update #1
Lawyer said to go ahead and file a DMCA Claim to DO. Lawyer will contacting the parties in the AM. I appreciate everyone's
/r/django
https://redd.it/1ibocln
Reddit
From the django community on Reddit
Explore this post and more from the django community
Super Simple Python From Anywhere Task Runner
https://github.com/Sinjhin/scripts
What my project does
I whipped this up real quick for myself.
Seems pretty powerful. After I was done I took a brief look around realizing I could have just used someone else's tool and didn't immediately see anything like this. It's a bit opinionated, but essentially lets you use python scripts from a directory from anywhere on your computer. Could replace bash/zsh if you wanted.
After setup, you make a python file. Add a Poe task to pyproject.toml and then you can do `p <poe_task>` from anywhere. Has an example of getting different location relative to where the script was ran. Also has an `hp` command to get into a set conda venv and run a Poetry command within that scripts dir like `hp add torch`.
Could be expanded on a lot actually.
Target audience
Anyone who finds themselves constantly writing little utility functions to use around their computer and needing a quick way to run them from anywhere.
Comparison
I looked briefly (after the fact) and saw things like Invoke or Fabric, but I am not sure that they handle venv switching.
/r/Python
https://redd.it/1ibq4jx
https://github.com/Sinjhin/scripts
What my project does
I whipped this up real quick for myself.
Seems pretty powerful. After I was done I took a brief look around realizing I could have just used someone else's tool and didn't immediately see anything like this. It's a bit opinionated, but essentially lets you use python scripts from a directory from anywhere on your computer. Could replace bash/zsh if you wanted.
After setup, you make a python file. Add a Poe task to pyproject.toml and then you can do `p <poe_task>` from anywhere. Has an example of getting different location relative to where the script was ran. Also has an `hp` command to get into a set conda venv and run a Poetry command within that scripts dir like `hp add torch`.
Could be expanded on a lot actually.
Target audience
Anyone who finds themselves constantly writing little utility functions to use around their computer and needing a quick way to run them from anywhere.
Comparison
I looked briefly (after the fact) and saw things like Invoke or Fabric, but I am not sure that they handle venv switching.
/r/Python
https://redd.it/1ibq4jx
GitHub
GitHub - Sinjhin/scripts: A repo for keeping utility scripts in my home dir and using python as shell... probably.
A repo for keeping utility scripts in my home dir and using python as shell... probably. - Sinjhin/scripts
Python 1.0.0, released 31 years ago today
Python 1.0.0 is out!
https://groups.google.com/g/comp.lang.misc/c/\_QUzdEGFwCo/m/KIFdu0-Dv7sJ?pli=1
>\--> Tired of decyphering the Perl code you wrote last week?
>\--> Frustrated with Bourne shell syntax?
>\--> Spent too much time staring at core dumps lately?
>Maybe you should try Python...
\~ Guido van Rossum
/r/Python
https://redd.it/1ibxols
Python 1.0.0 is out!
https://groups.google.com/g/comp.lang.misc/c/\_QUzdEGFwCo/m/KIFdu0-Dv7sJ?pli=1
>\--> Tired of decyphering the Perl code you wrote last week?
>\--> Frustrated with Bourne shell syntax?
>\--> Spent too much time staring at core dumps lately?
>Maybe you should try Python...
\~ Guido van Rossum
/r/Python
https://redd.it/1ibxols
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Django Channels: Asynchronous Magic for Real-Time Applications ๐
Ever wondered how to build real-time features like chat applications, notifications, or live updates in your Django project? Django Channels makes it possible by bringing asynchronous capabilities to Django.
Iโve been working on this Django-Channels repository to make it easier for developers to understand and implement these real-time features. ๐ฏ
๐ Check it out here:
GitHub Repository
โจ If you find it helpful, please show your support by giving the repo a โญ and following me on GitHub. Every star and follow encourages me to create more helpful resources for the community! ๐
Letโs keep building awesome projects and pushing boundaries together. ๐ป๐ก
/r/django
https://redd.it/1ibx9qg
Ever wondered how to build real-time features like chat applications, notifications, or live updates in your Django project? Django Channels makes it possible by bringing asynchronous capabilities to Django.
Iโve been working on this Django-Channels repository to make it easier for developers to understand and implement these real-time features. ๐ฏ
๐ Check it out here:
GitHub Repository
โจ If you find it helpful, please show your support by giving the repo a โญ and following me on GitHub. Every star and follow encourages me to create more helpful resources for the community! ๐
Letโs keep building awesome projects and pushing boundaries together. ๐ป๐ก
/r/django
https://redd.it/1ibx9qg
GitHub
GitHub - Matu-sunuwawa/Django-Channels
Contribute to Matu-sunuwawa/Django-Channels development by creating an account on GitHub.
Terminal based Python debuggers
Are there any TUI python debuggers? I found a couple hobby projects but they seem WIP/unmaintained.
Ideally, it should replicate vscode debugger like being able to
EDIT: I'm aware of pdb/pdb++/ipython. I'm specifically asking for alternatives to these that are more graphical.
/r/Python
https://redd.it/1iby62a
Are there any TUI python debuggers? I found a couple hobby projects but they seem WIP/unmaintained.
Ideally, it should replicate vscode debugger like being able to
watch expressions etc.EDIT: I'm aware of pdb/pdb++/ipython. I'm specifically asking for alternatives to these that are more graphical.
/r/Python
https://redd.it/1iby62a
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Day 2: Building Expense Tracker App
Hey everyone ๐
I'm currently working on an Expense Tracker App to learn how to display data on graphs using Chart.js. It's been a fun project so far, and I've made a few updates:
1. User-friendly interface: I focused on creating a more intuitive experience to keep users engaged.
2. Dismissible messages: Users are now better informed about their post progress with helpful notifications.
3. Robust error handling: Errors are now handled gracefully, preventing any app crashes.
4. Data persistence: Users wonโt have to re-enter data when they encounter an error โ it's saved for them!
This project has been a great opportunity to focus more on UI/UX instead of my usual backend-heavy approach, and Iโve learned a lot in the process.
View project on GitHub
If you're new to Django or looking for a fun project, why not give this a try? Youโll find a full description in the repo.
For my previous post **click here**
https://preview.redd.it/3w6oysi6dqfe1.png?width=2496&format=png&auto=webp&s=93deeb48f3fe9ca4fef43a9d12ed1b6141a2484c
https://preview.redd.it/arsi2859dqfe1.jpg?width=751&format=pjpg&auto=webp&s=20bc5fae30bc8cbbed3d91d4820840086f319d59
https://preview.redd.it/enjc8759dqfe1.jpg?width=747&format=pjpg&auto=webp&s=71685691d986318001575b11a3f97cb46410ad77
https://preview.redd.it/iapym759dqfe1.jpg?width=709&format=pjpg&auto=webp&s=2e1ca5f1879f1a3053e5a29db037f386195e02cb
/r/django
https://redd.it/1ic0pwv
Hey everyone ๐
I'm currently working on an Expense Tracker App to learn how to display data on graphs using Chart.js. It's been a fun project so far, and I've made a few updates:
1. User-friendly interface: I focused on creating a more intuitive experience to keep users engaged.
2. Dismissible messages: Users are now better informed about their post progress with helpful notifications.
3. Robust error handling: Errors are now handled gracefully, preventing any app crashes.
4. Data persistence: Users wonโt have to re-enter data when they encounter an error โ it's saved for them!
This project has been a great opportunity to focus more on UI/UX instead of my usual backend-heavy approach, and Iโve learned a lot in the process.
View project on GitHub
If you're new to Django or looking for a fun project, why not give this a try? Youโll find a full description in the repo.
For my previous post **click here**
https://preview.redd.it/3w6oysi6dqfe1.png?width=2496&format=png&auto=webp&s=93deeb48f3fe9ca4fef43a9d12ed1b6141a2484c
https://preview.redd.it/arsi2859dqfe1.jpg?width=751&format=pjpg&auto=webp&s=20bc5fae30bc8cbbed3d91d4820840086f319d59
https://preview.redd.it/enjc8759dqfe1.jpg?width=747&format=pjpg&auto=webp&s=71685691d986318001575b11a3f97cb46410ad77
https://preview.redd.it/iapym759dqfe1.jpg?width=709&format=pjpg&auto=webp&s=2e1ca5f1879f1a3053e5a29db037f386195e02cb
/r/django
https://redd.it/1ic0pwv
GitHub
GitHub - keith244/Expense-Tracker: This is an expense tracking app. It helps track your expenses and displays them on a graph.
This is an expense tracking app. It helps track your expenses and displays them on a graph. - keith244/Expense-Tracker
Windows Hotspot
I am trying to run my web app via my windows hotspot on my laptop but the application seems unable to listen on the hotspot. I have tried listening on my laptops hotspot interface (
/r/flask
https://redd.it/1ibylju
I am trying to run my web app via my windows hotspot on my laptop but the application seems unable to listen on the hotspot. I have tried listening on my laptops hotspot interface (
192.168.137.1) and all interfaces (0.0.0.0) when listening on all interfaces my hotspot interface does not appear in the list. Is there a way to resolve this? Would this application work on the hotspot from a Raspberry Pi? Happy to provide selected code snippets as required but much of the code is sensitive so won't be uploaded in an uncensored form./r/flask
https://redd.it/1ibylju
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Can't make Nginx see Gunicorn socket. Please help.
Hi all.
Iยดm trying to install a Nginx/Gunicorn/Flask app (protocardtools is its name) in a local server following this tutorial.
Everything seems to work fine down to the last moment: when I run
Gunicorn seems to be running fine when I do
Contents of my
Contents of my
Can anyone please help me shed a light on this? Thank you so much in advance.
/r/flask
https://redd.it/1ic372l
Hi all.
Iยดm trying to install a Nginx/Gunicorn/Flask app (protocardtools is its name) in a local server following this tutorial.
Everything seems to work fine down to the last moment: when I run
sudo nginx -t I get the error "/etc/nginx/proxy_params" failed (2: No such file or directory) in /etc/nginx/conf.d/protocardtools.conf:22Gunicorn seems to be running fine when I do
sudo systemctl status protocardtoolsContents of my
/etc/nginx/conf.d/protocardtools.conf:server {
listen 80;
server_name cards.proto.server;
location / {
include proxy_params;
proxy_pass http://unix:/media/media/www/www-protocardtools/protocardtools.sock;
}
}
Contents of my
/etc/systemd/system/protocardtools.service:[Unit]
Description=Gunicorn instance to serve ProtoCardTools
After=network.target
[Service]
User=proto
Group=www-data
WorkingDirectory=/media/media/www/www-protocardtools
Environment="PATH=/media/media/www/www-protocardtools/venv/bin"
ExecStart=/media/media/www/www-protocardtools/venv/bin/gunicorn --workers 3 --bind unix:protocardtools.sock -m 007 wsgi:app
[Install]
WantedBy=multi-user.target
Can anyone please help me shed a light on this? Thank you so much in advance.
/r/flask
https://redd.it/1ic372l
Digitalocean
How To Serve Flask Applications with Gunicorn and Nginx on Ubuntu 22.04 | DigitalOcean
In this guide, you will build a Python application using the Flask microframework on Ubuntu 22.04. The majority of this tutorial is about how to set up the โฆ
Created a cool python pattern generator parser
Hey everyone!
Like many learning programmers, I cut my teeth on printing star patterns. It's a classic way to get comfortable with a new language's syntax. This got me thinking: what if I could create an engine to generate these patterns automatically? So, I did! I'd love for you to check it out and give me your feedback and suggestions for improvement.
**What My Project Does:**
This project, PatternGenerator, takes a simple input defined by my language and generates various patterns. It's designed to be easily extensible, allowing for the addition of more pattern types and customization options in the future. The current version focuses on core pattern generation logic. You can find the code on GitHub: [https://github.com/ajratnam/PatternGenerator](https://github.com/ajratnam/PatternGenerator)
**Target Audience:**
This is currently a toy project, primarily for learning and exploring different programming concepts. I'm aiming to improve it and potentially turn it into a more robust tool. I think it could be useful for:
* **Anyone wanting to quickly generate patterns:** Maybe you need a specific pattern for a project or just for fun.
* **Developers interested in contributing:** I welcome pull requests and contributions to expand the pattern library and features.
**Comparison:**
While there are many online pattern generators, this project differs in a few key ways:
*
/r/Python
https://redd.it/1ic4j5b
Hey everyone!
Like many learning programmers, I cut my teeth on printing star patterns. It's a classic way to get comfortable with a new language's syntax. This got me thinking: what if I could create an engine to generate these patterns automatically? So, I did! I'd love for you to check it out and give me your feedback and suggestions for improvement.
**What My Project Does:**
This project, PatternGenerator, takes a simple input defined by my language and generates various patterns. It's designed to be easily extensible, allowing for the addition of more pattern types and customization options in the future. The current version focuses on core pattern generation logic. You can find the code on GitHub: [https://github.com/ajratnam/PatternGenerator](https://github.com/ajratnam/PatternGenerator)
**Target Audience:**
This is currently a toy project, primarily for learning and exploring different programming concepts. I'm aiming to improve it and potentially turn it into a more robust tool. I think it could be useful for:
* **Anyone wanting to quickly generate patterns:** Maybe you need a specific pattern for a project or just for fun.
* **Developers interested in contributing:** I welcome pull requests and contributions to expand the pattern library and features.
**Comparison:**
While there are many online pattern generators, this project differs in a few key ways:
*
/r/Python
https://redd.it/1ic4j5b
GitHub
GitHub - ajratnam/PatternGenerator: Powerful Pattern Generator written in Python
Powerful Pattern Generator written in Python. Contribute to ajratnam/PatternGenerator development by creating an account on GitHub.
[D] Ever feel like you're reinventing the wheel with every scikit-learn project? Let's talk about making ML recommended practices less painful. ๐ค
Hey fellow data scientists,
While scikit-learn is powerful, we often find ourselves:
* Manually checking for cross-validation errors
* Bouncing between Copilot, StackOverflow, and docs just to follow recommended practices
* Reinventing validation processes that need to work for DS teams and stakeholders
* Notebooks that become a graveyard of model iterations
I'm curious how you handle these challenges in your workflow:
* What's your approach to validation across different projects? Is there any unified method, or does each project end up with its own validation style?
* How do you track experiments without overcomplicating things?
* What tricks have you found to maintain consistency?
We (at probabl) have built an open-source library ([skore](https://github.com/probabl-ai/skore)) to tackle these issues, but I'd love to hear your solutions first. What workflows have worked for you? What's still frustrating?
* GitHub: [github.com/probabl-ai/skore](http://github.com/probabl-ai/skore)
* Docs: [skore.probabl.ai](http://skore.probabl.ai/)
/r/MachineLearning
https://redd.it/1ic5e7f
Hey fellow data scientists,
While scikit-learn is powerful, we often find ourselves:
* Manually checking for cross-validation errors
* Bouncing between Copilot, StackOverflow, and docs just to follow recommended practices
* Reinventing validation processes that need to work for DS teams and stakeholders
* Notebooks that become a graveyard of model iterations
I'm curious how you handle these challenges in your workflow:
* What's your approach to validation across different projects? Is there any unified method, or does each project end up with its own validation style?
* How do you track experiments without overcomplicating things?
* What tricks have you found to maintain consistency?
We (at probabl) have built an open-source library ([skore](https://github.com/probabl-ai/skore)) to tackle these issues, but I'd love to hear your solutions first. What workflows have worked for you? What's still frustrating?
* GitHub: [github.com/probabl-ai/skore](http://github.com/probabl-ai/skore)
* Docs: [skore.probabl.ai](http://skore.probabl.ai/)
/r/MachineLearning
https://redd.it/1ic5e7f
GitHub
GitHub - probabl-ai/skore: ๐ข๐๐ป ๐ฌ๐ผ๐๐ฟ ๐๐ฎ๐๐ฎ ๐ฆ๐ฐ๐ถ๐ฒ๐ป๐ฐ๐ฒ. Skore's open-source Python library accelerates ML model development with automatedโฆ
๐ข๐๐ป ๐ฌ๐ผ๐๐ฟ ๐๐ฎ๐๐ฎ ๐ฆ๐ฐ๐ถ๐ฒ๐ป๐ฐ๐ฒ. Skore's open-source Python library accelerates ML model development with automated evaluation reports, smart methodological guidance, and comprehensive cross-validati...
Django security best practices for software engineers.
Hi all,
I'm Ahmad, founder of Corgea. We've built a scanner that can find vulnerabilities in Django applications, so we decided to write a guide for software engineers on Django security best practices: https://corgea.com/Learn/django-security-best-practices-a-comprehensive-guid-for-software-engineers
We wanted to cover Django's security features, things we've seen developers do that they shouldn't, and all-around best practices. While we can't go into every detail, we've tried to cover a wide range of topics and gotcha's that are typically missed.
I'd love to get feedback from the community. Is there something else you'd include in the article? What's best practice that you've followed?
Thanks!
PS: we're using Django too for some of our services โค๏ธ
/r/django
https://redd.it/1ic9c1w
Hi all,
I'm Ahmad, founder of Corgea. We've built a scanner that can find vulnerabilities in Django applications, so we decided to write a guide for software engineers on Django security best practices: https://corgea.com/Learn/django-security-best-practices-a-comprehensive-guid-for-software-engineers
We wanted to cover Django's security features, things we've seen developers do that they shouldn't, and all-around best practices. While we can't go into every detail, we've tried to cover a wide range of topics and gotcha's that are typically missed.
I'd love to get feedback from the community. Is there something else you'd include in the article? What's best practice that you've followed?
Thanks!
PS: we're using Django too for some of our services โค๏ธ
/r/django
https://redd.it/1ic9c1w
Corgea
Django Security Best Practices: A Comprehensive Guide for Software Engineers - Corgea - Home
Corgea is an AI-native security platform that automatically finds, triages, and fixes insecure code. Sign up today for free to try Corgea.
etl4py - Beautiful, whiteboard-style, typesafe dataflows for Python
https://github.com/mattlianje/etl4py
What my project does
etl4py is a simple DSL for pretty, whiteboard-style, typesafe dataflows that run anywhere - from laptop, to massive PySpark clusters to CUDA cores.
Target audience
Anyone who finds themselves writing dataflows or sequencing tasks - may it be for local scripts or multi-node big data workflows. Like it? Star it ... but issues help more ๐โโ๏ธ
Comparison
As far as I know, there aren't any libraries offering this type of DSL (but lmk!) ... although I think overloading >> is not uncommon.
Quickstart:
from etl4py import
# Define your building blocks
five_extract: Extract[None, int] = Extract(lambda _:5)
double: Transform[int, int] = Transform(lambda x: x 2)
add10: Transform[int, int] = Extract(lambda x: x + 10)
attempts = 0
def riskytransform(x: int) -> int:
global attempts; attempts += 1
if attempts <= 2: raise
/r/Python
https://redd.it/1ic9b2m
https://github.com/mattlianje/etl4py
What my project does
etl4py is a simple DSL for pretty, whiteboard-style, typesafe dataflows that run anywhere - from laptop, to massive PySpark clusters to CUDA cores.
Target audience
Anyone who finds themselves writing dataflows or sequencing tasks - may it be for local scripts or multi-node big data workflows. Like it? Star it ... but issues help more ๐โโ๏ธ
Comparison
As far as I know, there aren't any libraries offering this type of DSL (but lmk!) ... although I think overloading >> is not uncommon.
Quickstart:
from etl4py import
# Define your building blocks
five_extract: Extract[None, int] = Extract(lambda _:5)
double: Transform[int, int] = Transform(lambda x: x 2)
add10: Transform[int, int] = Extract(lambda x: x + 10)
attempts = 0
def riskytransform(x: int) -> int:
global attempts; attempts += 1
if attempts <= 2: raise
/r/Python
https://redd.it/1ic9b2m
GitHub
GitHub - mattlianje/etl4py: etl4 โ in Python
etl4 โ in Python. Contribute to mattlianje/etl4py development by creating an account on GitHub.
PyPI security funding in limbo as Trump executive order pauses NSF grant reviews
Seth Larson, PSF Security-Developer-in-Residence, posts on LinkedIn:
> The threat of Trump EOs has caused the National Science Foundation to pause grant review panels. Critically for Python and PyPI security I spent most of December authoring and submitting a proposal to the "Safety, Security, and Privacy of Open Source Ecosystems" program. What happens now is uncertain to me.
> Shuttering R&D only leaves open source software users more vulnerable, this is nonsensical in my mind given America's dependence on software manufacturing.
> https://www.npr.org/sections/shots-health-news/2025/01/27/nx-s1-5276342/nsf-freezes-grant-review-trump-executive-orders-dei-science
This doesn't have immediate effects on PyPI, but the NSF grant money was going to help secure the Python ecosystem and supply chain.
/r/Python
https://redd.it/1iccu2q
Seth Larson, PSF Security-Developer-in-Residence, posts on LinkedIn:
> The threat of Trump EOs has caused the National Science Foundation to pause grant review panels. Critically for Python and PyPI security I spent most of December authoring and submitting a proposal to the "Safety, Security, and Privacy of Open Source Ecosystems" program. What happens now is uncertain to me.
> Shuttering R&D only leaves open source software users more vulnerable, this is nonsensical in my mind given America's dependence on software manufacturing.
> https://www.npr.org/sections/shots-health-news/2025/01/27/nx-s1-5276342/nsf-freezes-grant-review-trump-executive-orders-dei-science
This doesn't have immediate effects on PyPI, but the NSF grant money was going to help secure the Python ecosystem and supply chain.
/r/Python
https://redd.it/1iccu2q
Linkedin
Seth Michael Larson on LinkedIn: National Science Foundation freezes grant review in response to Trumpโฆ
The threat of Trump EOs has caused the National Science Foundation to pause grant review panels. Critically for Python and PyPI security I spent most ofโฆ
Wednesday Daily Thread: Beginner questions
# Weekly Thread: Beginner Questions ๐
Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.
## How it Works:
1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.
## Guidelines:
This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).
## Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
## Example Questions:
1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?
Let's help each other learn Python! ๐
/r/Python
https://redd.it/1icge4n
# Weekly Thread: Beginner Questions ๐
Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.
## How it Works:
1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.
## Guidelines:
This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).
## Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
## Example Questions:
1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?
Let's help each other learn Python! ๐
/r/Python
https://redd.it/1icge4n
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
Problem with env variables
I'm trying to set up an email sending system. The problem is that if I set MAIL_SERVER and MAIL_PORT their values โโalways remain None. How can I solve it?
/r/flask
https://redd.it/1ic7n1s
I'm trying to set up an email sending system. The problem is that if I set MAIL_SERVER and MAIL_PORT their values โโalways remain None. How can I solve it?
/r/flask
https://redd.it/1ic7n1s
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Alternatives to session and global variables in flask
I currently am making an app that will query weather data from an AWS bucket and display it on a map. Right now I am using global variables to store progress data (small dictionary that records amount of files read, if program is running, etc) and the names of files that match certain criteria. However, I understand this is bad pratice for a web app. When trying to look for alternatives, I discovered flask's session, but my "results" variable will need to store anywhere from 50-100 filenames, with the possibility of having up to 2700. From my understanding this list of files seems like way too much data for a session variable. When I tested the code, 5 filenames was 120 bytes, so I think that its pretty impossible to stay under 4kb. Does anyone have any ideas instead? Once a user closes the tab, the data is not important (there are download functions for maps and files). I would perfer not to use a db, but will if that is outright the best option.
/r/flask
https://redd.it/1icknxu
I currently am making an app that will query weather data from an AWS bucket and display it on a map. Right now I am using global variables to store progress data (small dictionary that records amount of files read, if program is running, etc) and the names of files that match certain criteria. However, I understand this is bad pratice for a web app. When trying to look for alternatives, I discovered flask's session, but my "results" variable will need to store anywhere from 50-100 filenames, with the possibility of having up to 2700. From my understanding this list of files seems like way too much data for a session variable. When I tested the code, 5 filenames was 120 bytes, so I think that its pretty impossible to stay under 4kb. Does anyone have any ideas instead? Once a user closes the tab, the data is not important (there are download functions for maps and files). I would perfer not to use a db, but will if that is outright the best option.
/r/flask
https://redd.it/1icknxu
Reddit
From the flask community on Reddit
Explore this post and more from the flask community