Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Where to store passwords in production

Hello everyone. I have a flask app i want to deploy on pythonanywhere. In my app i have a function that sends an email and i need to store a password for the email that is a sender. My question is how do i store that password safely when deployed so that i cant be viewed. Also would appreciate if anyone can suggest any other sites for deployment of flask apps. Thanks

/r/flask
https://redd.it/1hgycgl
D Best survey papers of 2024?

As an AI researcher who is starting out, I usually start by seeing survey papers related to a field, then creating a roadmap to further deep dive into my research topic. I am eager to see the sub's viewpoint of the best survey papers they came across in 2024.

/r/MachineLearning
https://redd.it/1hgwjqu
Django reaches its 2024 fundraising goal 🌈🎉

/r/django
https://redd.it/1hh1zjq
Benchmark library that uses PostgreSQL

I am writing an open-source library that simplifies CRUD operations for PostgreSQL. The most similar library would be SQLAlchemy Core.

I plan to benchmark my library against SQLAlchemy ORM, SQLAlchemy Core, and SQLModel. I am unsure about the setup. I have the following considerations:

\- Local DB vs Remote DB. Or both?
\- My library depends on psycopg. Should I only use psycopg for the others?
\- Which test cases should I cover?
\- My library integrates pydantic / msgspec for serialisation and validation. What' the best practice for SQLAlchemy here? Do I need other libraries?

What are your opinions. Do you maybe have some good guidelines or examples?

My library is not yet released but quite stable. You can find more details here:
Github: https://github.com/dakivara/pgcrud
Docs: https://pgcrud.com

/r/Python
https://redd.it/1hh4s52
Rest GET api deployed in flask+gunicorn giving 404 error

I have deployed a REST GET api in my development environment using gunicorn+flask on linux. However, I'm getting 404 error. This api used to work in the same environment before but now started getting 404. I checked the code and the url map as well in my flask app and this api is listed there. Any ideas how to troubleshoot this thing.

/r/flask
https://redd.it/1hh4srh
Deployed my basic app to Render but CSS isn’t working

I have “django-tailwind” installed in my project the theme name is “theme”

I ran collect static and pushed to git. When I run gunicorn on my local machine after collecting static it worked.


My images shows up, but my tailwind css isn’t showing.

/r/djangolearning
https://redd.it/1hhidrx
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/1hhfmi6
I made a step-by-step tutorial on setting up JWT authentication with HttpOnly cookies using Django and Next.js

This is my second DRF JWT authentication tutorial. I made it because, after my first tutorial, where tokens were stored in local storage, I was asked for an httpOnly cookies implementation and for more detailed explanations for each step.

In this tutorial, I tried to keep things simple; I didn’t add too many custom features. Instead, I focused on explaining the process as I coded, while trying not to be too boring.

Here’s the link:
https://youtu.be/TS1v\_-ppICk

I really hope you find it helpful! Feel free to let me know your thoughts or if you have any suggestions!

/r/django
https://redd.it/1hhc7vp
Implementing Retrieval-Augmented Generation with LangChain, Pgvector and OpenAI

https://www.codemancers.com/blog/2024-10-24-rag-with-langchain/?utm\_source=Social+media&utm\_medium=reddit

/r/Python
https://redd.it/1hhlg8x
I made an open source, self hostable, AI meeting Copilot

Hey Everyone 👋

I recently built **Amurex**, a self-hosted AI meeting copilot that actually works:

**What My Project Does**

Amurex is a self-hosted AI meeting copilot that:

* Records meetings seamlessly (no bot interruptions).
* Delivers accurate transcripts instantly.
* Drafts follow-up emails automatically.
* Keeps a memory of past meetings for easy context.
* Provides **real-time engagement suggestions** during boring meetings (unique feature!).

It’s open source, self-hosted, and ensures full data privacy with no subscriptions or vendor lock-in. And of course, it uses [Robyn](https://github.com/sparckles/Robyn) as the backend ;)

**Target Audience**

Perfect for professionals, privacy-conscious users, and open-source enthusiasts who want smarter meeting tools.

**Comparison**

|**Feature**|**Amurex**|**Others**|
|:-|:-|:-|
|Real-Time Suggestions|Yes|No|
|Seamless Recording|Yes|Bot interruptions|
|Self-Hosted Privacy|Full control|Third-party servers|

**GitHub**: [https://github.com/thepersonalaicompany/amurex](https://github.com/thepersonalaicompany/amurex)
**Website**: [https://www.amurex.ai/](https://www.amurex.ai/)

Would love to know what you all think of it. 😊

/r/Python
https://redd.it/1hh89i3
How to Set Up a Django Frontend: A Complete Tutorial

Today, I shared a guide on setting up the Django frontend, diving into file structure, static files, and how to integrate them seamlessly.

* **Blog Link :** [How to Set Up a Django Frontend: A Complete Tutorial](https://django-learning.hashnode.dev/how-to-set-up-a-django-frontend-a-complete-tutorial)

This blog builds on the previous one, where we explored Django Admin and Models, including tips on creating classes and using foreign keys effectively.

* **Previous Blog Link** : [How to Use Django Admin and Models: A Beginner’s Guide](https://django-learning.hashnode.dev/how-to-use-django-admin-and-models-a-beginners-guide)
* **First Blog Link :** [Getting Started with Django: Basic Setup and Overview](https://django-learning.hashnode.dev/django-setup-and-basic-overview)

Give it a read and let me know your thoughts in the comments! 💬 Your feedback helps me make these guides even better! 😊

/r/django
https://redd.it/1hhop30
Modern JS in Django

I would like to know how you all handle modern js in your django projects, stuff like installing third-party package, usage of bundlers or no build approach. I wanna improve my DX, so I interested on how other django dev do

/r/django
https://redd.it/1hhqdd6
JH container shows regular CPU spikes even when no clients are connected: normal behavior?

I'm running the JupyterHub single-user image and noticing spikes in CPU usage ever ~30s or so

Is this normal for JH? Looking at the output of top in the container shows the python3 process is being called periodically. Any thoughts on how I can troubleshoot this assuming it's not normal behavior? Thanks.

/r/IPython
https://redd.it/1hhvom8
unable to access config from celery task

I am currently working on an app where i need to have scheduled tasks that perform som api calls to external service and store results in a db.

I use Celery to achieve this using this guide https://flask.palletsprojects.com/en/stable/patterns/celery/
, i am able to schedule my tasks but the config containing all the api endpoint details and stuff is empty.

here is my testing code if i instead pass currentapp.config in helloworld() the only config variable set is "rootpath"

### in app/tasks
from celery import shared
task
from flask import currentapp
from app import app, config

@sharedtask(ignoreresult=False)
def hello
world():
print(config.dict)




### in app/Config.py
CELERY = dict(
brokerurl="redis://",
result
backed="redis://",
taskignoreresult=True,


/r/flask
https://redd.it/1hhptwm
🌟 NanoDjango Enthusiasts, Assemble! 🚀

Hi everyone! 👋

I'm working on a small project using [NanoDjango](https://github.com/kracekumar/nanodjango), a lightweight Django-like framework, to build a **Provident Fund Tracker App**. I've got the app mostly set up, but I’m running into some challenges and would love some guidance from anyone who has experience with NanoDjango or Django in general.

# What I’ve Done So Far:

1. **Models:** I’ve defined `Company`, `Employee`, and `PFPayment` models for storing company and employee data.
2. **Data Fetching:** I implemented a custom management command to fetch data from an Excel file and an XML file and populate the database.
3. **Web Views:** I’ve created views for:
* A homepage listing all companies.
* A detailed view for each company, showing its employees.
* A detailed view for each employee, showing their payment history.
4. **Templates:** HTML templates are located in the `templates` folder and are working fine with the `render` function.

**Update: I can easily populate using admin panel but want to do with custom command which will take data from excel file.**

# The Problem:

I’m struggling with:

1. Running my custom management command to populate the database. What’s the correct command to use with NanoDjango ?.

I will share the repo if anyone intested in helping

/r/django
https://redd.it/1hhotil
D chat-gpt jailbreak to extract system prompt

### Instructions

https://github.com/AgarwalPragy/chatgpt-jailbreak

### Original author
https://www.reddit.com/r/LocalLLaMA/comments/1hhyvjc/iextractedmicrosoftcopilotssystem/

### Extracted System prompt

You are ChatGPT, a large language model trained by OpenAI.
You are chatting with the user via the ChatGPT Android app. This means most of the time your lines should be a sentence or two, unless the user's request requires reasoning or long-form outputs. Never use emojis, unless explicitly asked to.
Knowledge cutoff: 2023-10
Current date: 2024-12-20

Image input capabilities: Enabled
Personality: v2

# Tools

## bio

The bio tool is disabled. Do not send any messages to it.If the user explicitly asks you to remember something, politely ask them to go to Settings - > Personalization - > Memory to enable memory.

## dalle

// Whenever a description of an image is given, create a prompt that dalle can use to generate the image and abide to the following policy:


/r/MachineLearning
https://redd.it/1hi429q
Friday Daily Thread: r/Python Meta and Free-Talk Fridays

# Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

## How it Works:

1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

## Guidelines:

All topics should be related to Python or the /r/python community.
Be respectful and follow Reddit's Code of Conduct.

## Example Topics:

1. New Python Release: What do you think about the new features in Python 3.11?
2. Community Events: Any Python meetups or webinars coming up?
3. Learning Resources: Found a great Python tutorial? Share it here!
4. Job Market: How has Python impacted your career?
5. Hot Takes: Got a controversial Python opinion? Let's hear it!
6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟

/r/Python
https://redd.it/1hi6vlj