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
Help Needed: Unable to Update Field Values in Web App (304 Not Modified Issue)

Hi All,

Hi everyone,
I'm working on a small project involving web application development. While I can successfully create records for users, I'm running into trouble updating field values. Every time I try to update, I encounter a 304 Not Modified status response.

I suspect there's something wrong in my code or configuration, but I can't pinpoint the exact issue.

Here’s what I’d like help with:

Understanding why I might be receiving a `304 Not Modified` status.
Identifying the part of the code I should focus on (frontend or backend).

Below is a brief overview of the technologies I’m using and relevant details:

Frontend: \[HTML, CSS, JavaSCript\]
Backend: [Python\]
Database: \[SQLAlchemy, MySQL\]
HTTP Method for Update: POST, GET
Error Details:
127.0.0.1 \- - [25/Jan/2025 12:03:07\] "GET /static/css/style.css HTTP/1.1" 304 -
[127.0.0.1](http://127.0.0.1) \- - \[25/Jan/2025 12:03:07\] "GET /static/js/profile\_details.js HTTP/1.1" 304 -
127.0.0.1 \- - [25/Jan/2025 12:03:07\] "GET /static/images/default_placeholder.png HTTP/1.1" 304 -
[127.0.0.1](http://127.0.0.1) \- - \[25/Jan/2025 12:03:07\] "GET /static/js/calendar\_availability.js HTTP/1.1" 304 -
127.0.0.1 \- - [25/Jan/2025 12:03:23\] "GET /static/css/style.css HTTP/1.1" 304 -

I’d appreciate any guidance or suggestions. If needed, I can share snippets of the relevant code. Thank you in

/r/flask
https://redd.it/1i9uqpw
Possibility of Django being helpful to land a job

Hey guys I am an aspiring software engineer who has made and launched a live website using Django. I really like Django but I don’t see that many career opportunities that Django can give me, so I am thinking if I should focus on data science/analytics. What are your honest thoughts about this?

/r/django
https://redd.it/1ia5gbk
Sunday Daily Thread: What's everyone working on this week?

# Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

## How it Works:

1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.

## Guidelines:

Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

## Example Shares:

1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟

/r/Python
https://redd.it/1ia0tm7
A technical intro to Ibis: The portable Python DataFrame library

We recently explored Ibis, a Python library designed to simplify working with data across multiple storage systems and processing engines. It provides a DataFrame-like API, similar to Pandas, but translates Python operations into backend-specific queries. This allows it to work with SQL databases, analytical engines like BigQuery and DuckDB, and even in-memory tools like Pandas. By acting as a middle layer, Ibis addresses challenges like fragmented storage, scalability, and redundant logic, enabling a more consistent and efficient approach to multi-backend data workflows. Wrote up some learnings here: https://blog.structuredlabs.com/p/a-technical-intro-to-ibis-the-portable?r=4pzohi&utm\_campaign=post&utm\_medium=web&showWelcomeOnShare=false

/r/Python
https://redd.it/1ia1gjx
Currex - Pythonic currency calculator with exchange rates

Repo: [https://github.com/stared/currex](https://github.com/stared/currex)
Demo: [try in Google Colab without installing anything](https://colab.research.google.com/github/stared/currex/blob/main/currex.ipynb)

I often use Python as a command-line calculator. However, I frequently found myself going back to Google Search to convert between currencies. So, I created this library to make adding, multiplying, and converting between currencies easy. One of its core features is autocasting - when working with multiple currencies, it automatically converts them to match the first currency used.

# What My Project Does

Currex is a Pythonic currency calculator that makes working with currencies and exchange rates simple and smooth. It allows you to:

- Add, subtract, multiply, and divide currencies as if they were numbers
- Easily convert between currencies (e.g., USD to EUR)
- Autocast when mixing multiple currencies (they automatically convert to the first currency referenced)
- Fetch exchange rates from [HexaRate](https://hexarate.paikama.co/) in real-time

Here's a simple example:

```python
from currex import *

# use currencies as if they were numbers
100 * USD # USD(100.00)
12 * USD(100) # USD(1200.00)

# convert currencies to other currencies
USD(100).to(EUR) # EUR(85.30)
USD(100).to(PLN) # PLN(430.50)

# this syntax is also supported
PLN(EUR(12)) # PLN(51.33)


/r/Python
https://redd.it/1i9sn69
Best AI for python programming?

I've been using Chatgpt, but it isn't up to the mark. Like it can code but when I prompt it to code without this module/function, it fails most of the time. Would love to get to know which AI does the best.



/r/Python
https://redd.it/1iabwj1
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/1iai5g6
Deploying Django and Wagtail on Cloud Servers: A Step-by-Step Guide

🚀 Are you struggling to deploy your Django or Wagtail projects on cloud servers like AWS, DigitalOcean, or Hetzner? I’ve been there too, which is why I’ve documented the entire process to help others simplify their deployment journey!

I’m excited to share two repositories that provide comprehensive deployment guides:

1️⃣ Django Deployment on Hetzner (and similar cloud servers):
🔗 GitHub: Django Hetzner Deployment

2️⃣ Wagtail Deployment on Hetzner (and similar cloud servers):
🔗 GitHub: Wagtail Hetzner Deployment

These repositories include:
Setting up your server environment
Installing necessary dependencies (e.g., Docker, PostgreSQL)
Configuring Nginx and Gunicorn for production
Tips for handling static and media files
Streamlined deployment steps

Whether you’re hosting on AWS, DigitalOcean, Hetzner, or another provider, the principles outlined here can be easily adapted to fit your setup.

💡 Why I created this:
I wanted to make it easier for developers to deploy their projects without running into unnecessary roadblocks. If you’re new to cloud hosting or looking for a practical guide, this documentation might be just what you need.

I’d love to hear your feedback or suggestions for improvement. Let me know if these guides help you, or feel free to contribute

/r/django
https://redd.it/1iaa8om
Django e-commerce

In the past couple of months, i have been updating my Django e-commerce project and would love to share.

It mainly involves utilizing Django template, DigitalOcean, Whitenoise for static files, and Azure for PostgreSQL, and Azure Blob Storage for handling media only

https://voxmart.co.tz/


/r/django
https://redd.it/1ia59ga
I have been enjoying django these months

I researched the suitable stack to use before working on the product idea in mind, some folks crucified Django while others praised it. But learning to know of some major tech coys using Django is some relief.

We built a mentee meet mentor app for data & AI folks purely on Django at the backend and it has been fun. Though I want to improve API response time in deployment, I'm good outside that. https://semis.reispartechnologies.com/. Mentors can host group sessions and share their profiles for folks to connect with them.

Django at the backend is great, our app has evolved and will still do. Currently, we vet mentors before accepting. We are not there yet obviously, it's a learning experience for me. . Thank you Python & Django :)

/r/django
https://redd.it/1iaon81
How do I host flask web application on ubuntu VPS? (hostinger)?

recently i purchased a vps from hostinger but unfortunately there's no support for python flask but it allows various apps, panels, and plain OS as well. but i genuinely don't know what I'm doing. and I do want to connect a custom domain as well.

/r/flask
https://redd.it/1iao8zo
Django, Postgres, and Pytest

Apologies for the rather basic question, but I'm developing an app locally and have just switched from sqlite to postgres. The database for the app is working fine, but not so the temporary database that Pytest (or unittest) sets up. I keep getting errors like this: 'django.db.utils.ProgrammingError: relation "users_customuser" does not exist', which suggests that the tables in the test DB are not being created correctly. I've tried mucking around with migrations, and the USER permissions for the test DB appear appropriate (though by no means do I have a lot of expertise with postgres). I'm wondering if anyone knows the answer to this, or is aware of some kind of resource or tutorial out there that focuses on the intersection of Django, postgres, and testing?



/r/django
https://redd.it/1iatk98
Flask-alchemy create Models

Hey Guys and Girls,

I´m wondering about a lot over Tutorials. I´m workin on my first little Flask Web App. I´m a student for Media Tech with intermediate or better good understanding whatsoever.

In many Tutorials this "Mapped" SQLALchemy 2.0 style just does not exist. Why is that? Is there any big difference?

The SQL ALchemy Tutorial tells me to use that style over the old style... I dont get it.

Or it is like Flask-alchemy is using the old style?

# SQL ALCHEMY 2.0 STYLE

class Base(DeclarativeBase):
    pass

db = SQLAlchemy(modelclass=Base)

class Sailor(Base):
    tablename = 'sailor'
    id: Mapped[int] = mapped
column(primarykey=True)
    username: Mapped[str] = mapped
column(String(50), nullable=False)
    password: Mappedstr = mappedcolumn(String(50), nullable=False)

#S SQL ALCHEMY OLD STYLE

class Sailor(db.base):
tablename = 'sailor'
id = db.Column(db.Integer, primary
key =

/r/flask
https://redd.it/1iac4im