Telegram Group Search
PuePy - Reactive Frontend Framework

## What PuePy Project Does

PuePy builds on PyScript (Python+Webassembly) to offer something similar to Vue.js or React, but in 100% pure Python. It supports PyScript's two runtimes: MicroPython and Pyodide. MicroPython is tiny, while Pyodide is basically CPython.

## Target Audience

Presumably anyone who wants to have a web project where they code the frontend in Python, not JavaScript. This might be a limited number of people, however, because it does mean you'll miss out on JavaScript tooling (eg, in-browser debuggers), JavaScript projects, etc.

You can, however, make use of web components like Shoelace.style, so you're not necessarily starting from scratch.

## Comparison

There are a lot of Python "frontend" options, though none I'm aware of are quite like PuePy.

- Reflex lets you define React-style logic in Python and it runs in the browser. It doesn't, however, let you have a full Python environment on the client.
- LTK is a GUI toolkit written with PyScript that you could use to build powerful frontend frameworks. However, it isn't reactive and does presume you're going to use it as a toolkit in a roughly similar way to how you'd use Gtk or Qt, but on the web.
- Flet is a Flutter wrapper in Python where a thin

/r/Python
https://redd.it/1dr7xfu
Need help with creating custom validators for a Serializer in Django REST framework

I am writing a serializer for a complicated put API with a large validate function. To simplify the logic and make it more readable, I want to create validators for individual fields (I want to make my serializer class as small as possible and hence don't want to write individual validate methods for each field). I am passing context to my serializer from the view and each of my fields share a common context. I want to use that context in the validator to perform the required checks.

This is how I am attempting to create custom validators:

My validator class:

class MyCustomValidator:
requirescontext = True

def call(self, value, serializer
field):
context = serializerfield.context
print(f"got this context: {context}")

my serializer:

class MySerializer(serializers.Serializer):
my
field = serializers.IntegerField(required=True, validators=MyCustomValidator())


sending context in my view:

def getserializercontext(self):
context = super().getserializercontext()


/r/django
https://redd.it/1drdla1
Run mgcv package in python via rpy2

I am trying to create a python package to run mgcv in R, to replace the functionality of pyGAM. I want to start with the r command gam(), and need to use rpy2 to transfer data from R. I don't know how to define the command in python to encapsulate the functionality of running the gam command from r (mainly to simplify the python code), and I am trying to understand some of the functions of the pymer4 package on how data is transferred between the two languages.

I don't have a lot of experience with developing packages and I'd like to understand a little bit about how these functions are defined

/r/Python
https://redd.it/1drdq78
Integrating issue between django and react

hello my team is building full stack web app using django and react .

i am working on Django and others are working on react .

now we have started integrating them and we are getting error.

i have diagnosed the problem little bit and i found that the error is with static file and src link in frontend , because it always gives me "not Found Error" . so the issue might be with linking .

anyone hear has any knowledge or experienced such problem pls help , as deadline is near

https://preview.redd.it/yn94d4mzui9d1.png?width=422&format=png&auto=webp&s=c6c6a8329b6c299a4afbde3d567c9fc19da368ad

https://preview.redd.it/cpzw37mzui9d1.png?width=848&format=png&auto=webp&s=f4b791aba1988859bfe71cd6d46c6b1460532426



/r/django
https://redd.it/1drck77
Django Rest Browsable API vs axios post

Hey everyone,

I recently started logging the time requests take in my django project.

I have a rest framework viewset for a model with a custom action that performs a lot of processing and a complex lookup on that model.

It all works fine, but I have come to realize that when I use the form in the browsable rest_framework api, the code on the serverside is executed twice as fast as when i call the very same action from a template using axios/fetch or anything similar.

I logged the time for every function that is being executed in the view and they all run at minimum twice as fast.

I cannot figure out why. Does anyone have an idea why?

Thanks!

/r/django
https://redd.it/1drmbh7
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/1dromws
Sonos Moments - A simple web app to control Sonos speakers

I finally open-sourced my tiny side-project where I implemented a web app for controlling Sonos speakers, especially switching between pre-defined "moments".

**Link**: [Sonos Moments](https://github.com/falkoschindler/sonos_moments)

After the latest update of the official [Sonos app for Android](https://play.google.com/store/apps/details?id=com.sonos.acr2) with an average rating of 1.2 stars, I needed an alternative solution for common tasks like changing the volume or pausing/unpausing the music. And starting my morning routine with a single click is not possible at all with the official app. Apart from that it is a great opportunity to use [NiceGUI](https://nicegui.io/) for rapidly solving a real-world problem at hand.

**What My Project Does**

* Provide a simple web UI for controlling Sonos speakers in a local network.
* Allow capturing and managing the state of multiple speakers ("moments") and restoring them with a single click.
* Allow to quickly play/pause speakers and control their volume without opening the official mobile app.

**Target Audience**

* Python developers and smart home enthusiasts in need for a better Sonos app.

**Comparison**

* As far as I'm aware, there is no other open-source web UI for Sonos speakers.

/r/Python
https://redd.it/1drczng
FastAPI + Django Admin is the best practice?

Hey guys! I wanted to use Django Admin for my FastAPI project, namely django-unfold. So what do you think about this idea?

My used orm: SQLAlchemy

/r/django
https://redd.it/1drj08o
Discord trading bot

I follow a very successful day trader that posts all his trades on discord. I was wondering if it would be possible to develop a bot that buys and sells a stock exactly when he posts his trades. I have no experience in programming but I really want to create this bot so that I can make trades while I do my day job. Any help is appreciated.

/r/Python
https://redd.it/1drx7qr
Flask MongoEngine ListField(StringField) error

\` from .db import db

class Movie(db.Document):
name = db.StringField(required=True, unique=True)
casts = db.ListField(db.StringField(), required=True)
genres = db.ListField(db.StringField(), required=True)`


in flask when trying to do `db.ListField(db.StringField(), required=True)`

I get an error like

`casts = db.ListField(db.StringField(), required=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: WtfFieldMixin.__init__() takes 1 positional argument but 2 were given`

then tried `casts = db.ListField(required=True)` and it works.

But I need list of string in model. how to do it?

/r/flask
https://redd.it/1drsa15
Things you dont like about python package manager

Share some things you dont like about this.



NOTE: not mentioning the name since the bot is programmed to do too much and whenever i mention it i get flagged



/r/Python
https://redd.it/1drznbg
AI contextualization for scraping

Hi everyone,

I’m the founder and chairperson of the Association of Computer Science students at my university. In my free time, I enjoy creating scripts for our community. Currently, I’m working on a web scraper to collect and share bursaries, internships, graduate programs, learnerships and more with our students through our communication platforms like whatsapp.

However, I’ve encountered a problem, the descriptions of these opportunities vary widely and often don’t explicitly state that they are related to computer science. I want to integrate a tool that can help contextualize these descriptions and determine whether they are relevant to computer science.

Is there a free method to connect my script to an AI service that can assist with this? Any recommendations or advice would be greatly appreciated.

Thank you.

/r/Python
https://redd.it/1ds0r50
Django SaaS Boilerplate

Hi all !

Since quite many people found my previous website template helpful, wanted to share a simple, open-source SaaS boilerplate as well.

You can get the code on Github: [Django saas Boilerplate](https://github.com/PaulleDemon/Django-SAAS-Boilerplate)

You can check out the demo here: [https://django-saas-boilerplate.vercel.app/](https://django-saas-boilerplate.vercel.app/)

Signup is disabled, For demo login use

[email protected]
demo123*

This template is built on top of previous template.

**Some of the features of Django Saas boilerplate include**

* **Responsive UI**: Comes with a responsive base template, so you can focus on other parts of your websites.
* **Login flow:** Comes with Login, signup, password rest, etc.
* **Payment integration:** Comes with default stripe integration, add your API keys and get started.
* **Pricing page:** Display exactly what your customers get.
* **Landing page**: Comes with a landing page you can modify.
* **Contact us page**: An inquiry form, to allow your users to contact you.
* **Blog with Trix Editor:** An integrated Trix editor on admin panel to manage and write blogs about your SaaS webstite.
* **Custom User model**: Comes with an existing custom user model you can modify.
* **Tailwind Css:** For rapid prototyping and development.
* **Frontend framework independent**: Comes with basic html, css just enough for your about page, you are free to use any

/r/django
https://redd.it/1ds0ubg
Flask socketio doesn't work on Chrome Android

I made a chat websitee with socketio, firstly I tested in localhost, it worked between PC and ANDROID, then I put it on heroku and bought a custom domain, and I got an SSL certification, but it seems the socketio on android chrome just does not want to connect. I can't solve the issue because there isn't any devtools on android.

/r/flask
https://redd.it/1drziqg
Django 5 By Example: Build powerful and reliable Python web applications from scratch, any good?

Just wondered if anyone had read this book by Antonio Melé and could share their opinions on it as I am considering purchasing it, thanks in advance.

/r/django
https://redd.it/1ds2t2e
A Twitter bot that posts about public domain science fiction books

Source code: https://github.com/ben-n93/pg\_scifi\_twitter\_bot

What my Project Does

Picks a random science fiction book from Project Gutenberg and posts about it on Twitter.

Target Audience
Anyone interested in Twitter bots and/or free science fiction books!

/r/Python
https://redd.it/1ds1xs7
Django REST vs Django Ninja

I'm curious if Django Ninja is mature enough now

/r/django
https://redd.it/1ds6rlt
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/1dsfboc
Add a GUI or not?

I recently convinced my IT department to allow me to install and develop python scripts for internal use in our company. I am the only one with any python knowledge and the ability to run scripts, so in order to share anything with my colleagues I will have to distribute them as .exe files.

I have made my first useful script and now I'm not sure if I should add a simple tkinter gui or not. The script can work on its own as long as it's placed in the folder (it changes some documents and converts them to pdfs).

Here are my thoughts on adding a GUI.

Pros:
It would create a user experience they are more familiar with. It would make the script/app more dynamic as it would make it easier for them to tweak settings.

Cons:
it would increase file size of the .exe, I know it's not a low but some colleagues are old school and will share it by email.
It would make the code more complex and harder to maintain for myself (and potentially others in the future)
Tkinter looks and feels outdated to many users (I know could use another gui framework but that would require I

/r/Python
https://redd.it/1dsebb8
2024/07/01 06:01:57
Back to Top
HTML Embed Code: