Convert fontawesome codes back to font
I wrote some code to pass json for my arch installation, but it changed the fontawesome-icons to something like \\ue663, is there some way to convert that back?
/r/Python
https://redd.it/1er5i8w
help me deploy my django app i was following CoreyMSchafer's Django series
Hey everyone,
I've been following CoreyMSchafer's Django series and made it halfway through, but now I'm stuck at the deployment module. I'm trying to deploy my app using Linode, but the process seems really complicated. The series is about 5 years old, so I'm wondering if the deployment steps are still relevant. Has anyone else used this tutorial recently, and can you confirm if I can still deploy my app without running into too many issues? I've been stuck on this for days now, and I really want to make this work. Any advice would be greatly appreciated!
Thanks in advance!
/r/djangolearning
https://redd.it/1er2ipb
PEP 750 – Tag Strings For Writing Domain-Specific Languages
PEP 750 – Tag Strings For Writing Domain-Specific Languages https://peps.python.org/pep-0750/
# Abstract
This PEP introduces tag strings for custom, repeatable string processing. Tag strings are an extension to f-strings, with a custom function – the “tag” – in place of the f
prefix. This function can then provide rich features such as safety checks, lazy evaluation, domain-specific languages (DSLs) for web templating, and more.
Tag strings are similar to JavaScript tagged template literals and related ideas in other languages. The following tag string usage shows how similar it is to an f
string, albeit with the ability to process the literal string and embedded values:
name = "World"
greeting = greet"hello {name}"
assert greeting == "Hello WORLD!"
Tag functions accept prepared arguments and return a string:
def greet(args):
"""Tag function to return a greeting with an upper-case recipient."""
salutation, recipient, = args
getvalue, * = recipient
return f"{salutation.title().strip()} {getvalue().upper()}!"
/r/Python
https://redd.it/1equd6q
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/1eqthqn
Daily API call at same time
Hello, I've just started learning Django and am working on a project right now utilizing Django as the backend. So I have a little over 300 locations with their coordinates that I'm using to get daily weather data from https://www.weatherapi.com/ , and I was curious how can i automate this so these calls are made daily at 12:01 am to grab the current days forecast? I plan on storing the data in my postgresql database and having the db drop itself to get rid of previous day's forecast and then rebuild with the current days data.
/r/django
https://redd.it/1eqp96s
I’m a medical doctor, just began learning Python. My world is changed. Anyone else?
Like seriously. Never knew I had a talent for it.
How beautiful it is to organize data and systematic steps. Now, my whole world is factual data that we take in and spit out. There’s almost zero room for creativity.
But with Python( or programming in general) it’s like an arsenal tool that’s ever-growing and infinitely capable.
Any other non-CS people ever start programming and suddenly fell in love with it?
/r/Python
https://redd.it/1eqm7he
Calling all Djangonautes: what’s your go-to Front-End pattern?
Hi Djangonautes,
As much as I love Django, I can't help but feel that the front-end situation is a bit messy.
With numerous packages attempting to tackle the pain points of the template engine or implement patterns from other major frameworks, it feels at times like navigating a maze, especially as all these libs and packages might not always play well with other.
I’ve created a table outlining some of the top front-end patterns used in Django. I’m leaving it blank for now to encourage all of you to share your experiences and insights! I will update the table based on the feedback received.
For now, let's discuss!
|Pattern|Description|Depends on|Reasons to avoid|Reasons to adopt|
|:-|:-|:-|:-|:-|
|Plain html|Basic HTML without any additional libraries or frameworks|N/A|Limited interactivity, may not meet modern user expectations|dependency free, simple, will last forever|
|HTMX||htmx|||
|HTMX + Django Components|| django-components|||
|HTMX + Django Components Kit||django-component-kit|||
|HTMX + Django Template partials||django-template-partials|||
|Inertia.js||inertia-django|||
|Reactor||django-reactor|||
|Unicorn||django-unicorn|||
|FE Framework + API||DRF, Ninja, React, Vue, Svelte etc.|||
Discussion Points:
Compatibility Issues: Have you faced any challenges when integrating these patterns with existing Django projects?
Performance Considerations: Which patterns have you found to be the most efficient in terms of performance?
Learning Curve: For those new to Django, which patterns offer the easiest entry point?
/r/django
https://redd.it/1eqdc16
RAGoon is now available on PyPI, GitHub, and as a Space on HF for batched embeddings generation
RAGoon is a set of NLP utilities for multi-model embedding production, high-dimensional vector visualization, and aims to improve language model performance by providing contextually relevant information through search-based querying, web scraping and data augmentation techniques.
Link to GitHub: [https://github.com/louisbrulenaudet/ragoon](https://github.com/louisbrulenaudet/ragoon)
Link to Hugging Face Space: [https://huggingface.co/spaces/louisbrulenaudet/ragoon](https://huggingface.co/spaces/louisbrulenaudet/ragoon)
[RAGoon is out](https://preview.redd.it/h5u2uami76id1.jpg?width=2880&format=pjpg&auto=webp&s=ee8580c2760b30057e9971a9772fa77525961afd)
Here is an example of code to produce Embeddings for a given list of models:
from ragoon import EmbeddingsDataLoader
from datasets import load_dataset
# Initialize the dataset loader with multiple models
loader = EmbeddingsDataLoader(
token="hf_token",
dataset=load_dataset("louisbrulenaudet/dac6-instruct", split="train"), # If dataset is already loaded.
# dataset_name="louisbrulenaudet/dac6-instruct", # If you want to load the dataset from the class.
model_configs=[
{"model": "bert-base-uncased", "query_prefix": "Query:"},
{"model": "distilbert-base-uncased", "query_prefix": "Query:"}
# Add more model configurations as needed
/r/Python
https://redd.it/1eq5wh0
Pre-Requisites for Django
Hey everybody. I hope everyone reading this is doing fine. I am planning to go for django. I know python and cpp. What im trying to ask is that is it necessary to learn databases before django? If yes, then which should i learn first, SQL or MySQL? Kindly help me in this regard. Ill be really glad
/r/django
https://redd.it/1eq8uyb
Another static site generator in Python?
Hey everyone!
I wanted to share a little project I've been working on called Allround Website Static Site Generator (AW-SSG). The idea behind it is pretty simple: not every project needs the complexity of a full server framework in Python. Sometimes, you just want to keep things straightforward without sacrificing flexibility and power.
What My Project Does
AW-SSG is a tool that lets you generate static websites with the ease of using Jinja2 templates and Tailwind CSS, all powered by Python. It’s perfect for those situations where you need something quick and reliable—like a landing page, a personal portfolio, or a simple "business card" site—but don’t want to dive into the heavy lifting that comes with frameworks like Django or Flask.
Target Audience
If you’re looking to create something simple but effective, without dealing with the overhead of a full-stack framework, AW-SSG could be right up your alley. It’s great for developers who want to maintain the speed and efficiency of static sites while still having the power of Python at their fingertips. Plus, I’m considering adding markdown support in the future, which should make generating websites even easier.
Comparison
So how does AW-SSG stand out from the crowd? While there are plenty of static site generators
/r/Python
https://redd.it/1eq6j7o
Feeback On Project to see if its resume worthy or not
Hey guys, I finished a little weather API w/GUI project and wanted people's thoughts on it. I don't know if it is resume-worthy and I wanted some insight on what I can improve. I have a git link - https://github.com/HarshaKarapureddy/WeatherAPI/tree/v2-GUI\_UPDATE. P.S. I'm sorry if the project isn't that professional or great.
/r/Python
https://redd.it/1epxjiy
Seeking technical cofounder for my retro online multiplayer competitive educational math game I built 4 years ago.
Gameplay footage: https://imgur.com/a/6ais2yv
Lobby (broken): http://web.archive.org/web/20221024015305/https://gameapollius.herokuapp.com/
Yes, it has been called Apollius, flux math, and math Tron. It has a new name, but I'm not making it public so people don't steal the name.
The game is Tron Light cycles, but in order to turn one must solve a math problem. Its online multiplayer. With a matchmaking lobby and everything
I'm looking for an agency (or an exceptional person) with whom to partner, so that we can continue development on it (I've quit coding) and help the product grow.
It will be a hit. The idea for this game is not new. Its a near exact copy of a game that was extremely popular at my elementary school (except my version has a matchmaking lobby). During recess, if we stayed indoors, all the computers would be taken, and they'd all be playing this game
This game helps you get fast at calculating math problems mentally (without pen and paper) The game, even, was called Mental Math.
The game is responsible for my math (and later coding) prowess
I'm looking to publish @ coolmathgames
Stack: heroku, Django, postgresql, jQuery
Yes sorry I'm oldschool, and the code isn't clean, just functional. Apologies in advance haha.
Ideally, I want to host the game at
/r/django
https://redd.it/1epx9vy
Python debugger: properties of a protobuf generated class are not showing
Note how, inline with request
, we see message: "Hello, Server!"
. However, when I expand the dropdown for request
, the property message
is nowhere to be found.
screenshot of the debugger
Here is the definition of the request:
message PingRequest {
string message = 1;
}
And here is the command I'm using to generate the python from the proto:
python3 -m grpctools.protoc -I proto/src \
--pythonout=./proto \
--grpcpythonout=./proto \
--mypyout=./proto \
proto/src/apitypes.proto
/r/Python
https://redd.it/1epspma
I created my own Python Framework
I was curious how frameworks like django or flask worked. So after a sleepless night and hacking around here what I created for fun (nothing serious) https://github.com/goyal-aman/SimpleHTTPServe
What my project does?
TBH its a simple framework like flask or django. Importantly I used no third party dependency. What do you think? FYI: this is a fun project. No way for anything serious.
Update:
Its no way close to django or flask as some people rightly pointed out. Its a fun project - not for anything serious.
Update 2: Its a python web-server framework and not framework I guess.
/r/Python
https://redd.it/1epml72
Swaggerspect: JSON schema for python API:s
# What My Project Does
So you are building a website that runs some back-end pipelines that can be configured by the user? You'd like to not hard-code the parameters for the pipelines in the GUI. But how?
Swaggerspect lets you use python type hints and numpydoc docstrings to generate json-schema for your python functions or clases implementing the pipelines. This can then be used by the front end with something like https://github.com/json-editor/json-editor to generate a form that the user can use to set parameters for a pipeline.
Note that swaggerspect does not impose any framework for neither front end nor webserver or pipeline runner. Or even require any of these: it simply generates json-schema from python code!
# Target Audience
Web developers who use python for the backend. Especially people who run more elaborate/expensive pipeline jobs on the behalf of web users.
# Comparison
Django includes ModelForms, so you could make each pipeline be a django model. However, the flexibility of django forms is smaller than that of json-schema, so this would only work for simpler things. Also, any form changes would require a django migration (database change), and keeping multiple versions around would be hard. With swaggerspect, you can have multiple pipeline software versions available,
/r/Python
https://redd.it/1ep5i78
Public API with DRF best practices
I was wondering what the community is considering good practice when implementing public API in DRF. I do not necessarily ask for REST best practice but rather internal details of development of API in Django, e.g. do you implement your own viewsets or reuse APIView from DRF etc. I am asking to implement those in my organization and revamp old API implemented still for Django 3.
/r/django
https://redd.it/1er2e6v
Insurance Portal Development: Key Features, Best Practices
https://www.quickwayinfosystems.com/blog/insurance-portal-development/
/r/flask
https://redd.it/1er1gjr
Help with Django backend and ReactJS
Hi,
We have a backend and trying to integrate the frontend through ReactJS. After the successful response from backend, the session_id is not being passed to the subsequent requests from frontend.
Any help here?
/r/django
https://redd.it/1eqwiue
Launching a background process through a Flask server
Hi all,
I have a Flask server that's serving a mobile app. I want to create a process that runs asynchronously - that is, the mobile app won't need to wait for it to finish (it could take a few minutes). I've created such a process (using the asyncio package) but when I tried to integrate it with my Flask application it seems not to work, even though it did work locally. In hindsight, perhaps it's something I should've expected. Any ideas how to create such a process in a way that works with Flask? I would be grateful for any suggestions.
Many thanks
/r/flask
https://redd.it/1eqpl6s
What kind of projects should i put on my resume as a junior django developer?
I started learning django a while ago
I think i have a good grasp of the basics and i don’t want to enter the tutorial hell so i thought i should make some projects.
Can you help me brain storm ideas for projects that can be put on my resume?
Chatgpt suggested e-commerce website and a blog and a social media website should i just try making those?
/r/django
https://redd.it/1eqiwwn
FastAPI without ORMs: Setup, Migrations, Testing
Hi all,
I've written a series of posts that walks through how to setup FastAPI server without using ORMs for database queries.
* [FastAPI without ORM: Getting started with asyncpg](https://www.sheshbabu.com/posts/fastapi-without-orm-getting-started-with-asyncpg/)
* [Demystifying Postgres Schema Migrations: Building it from Scratch](https://www.sheshbabu.com/posts/demystifying-postgres-schema-migrations/)
* [FastAPI without ORM: Testing with asyncpg](https://www.sheshbabu.com/posts/fastapi-without-orm-testing-with-asyncpg/)
Hope you find it helpful!
/r/Python
https://redd.it/1eqftsl
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/1epmsrd
Boilerplate for new projects with Pixi, Flask, Jupyter Notebook, and Docker
Hey peeps, sharing this boilerplate template that I created here that should get you started with one command (if you have docker installed), hope it helps someone https://github.com/mshaaban0/pixi-docker-template
/r/Python
https://redd.it/1eqchvx
How Much Python Should I Know Before Starting Django?
I have a good understanding of Python basics. I can create functions and write logic to perform common tasks. Is this enough to start learning Django, or should I know more about Python first?
/r/djangolearning
https://redd.it/1enllrd
Correct way to implement authentication using flask
Without using flask-login, what is the correct (secure) way to implement a authentication system? Is hashing with salt done on client side or server side? Is the email and password are posted from client to server and server uses GET the email and password? Can someone explain. and also how to prevent from exposing api endpoints to clients
/r/flask
https://redd.it/1epfnta
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/1epzext
I created my own autoclicker using Customtkinter
I wanted to create replacement for an old autoclicker called EasyAutoClicker and some others. It is also very simple and effective. Currently only works on windows. [Link to GitHub](https://github.com/Lemon4ksan/SimpleAutoClicker) (Preview Included)
* **What My Project Does**: SimpleAutoClicker allows to automatially create click events. You can change the frequency of clicks, time and mouse positon offset, choose wich button to click with, create hotkey to start clicking and set killswitch for closing the app in case of emergency, set how many times to click and customize appearence.
* **Target Audience**: My project is a small utility and doesn't take a lot of space. Sure everyone will find a good use for it. Simplest case is to play clicker games.
* **Comparison**: Compared to other alternatives, my app is much more modern, very small and simple. I also tried to make my code as readable as I could, so you may learn something from it and use it to create your own ctk based apps. It's also packed into compact .exe file.
Any code improvement suggestions are welcomed
/r/Python
https://redd.it/1epurz2
Do you think DSA is important in Django?
I just finished everything related to Python, OOP, methods you name it, but not DSA, and I have been programming with Django for a while till now I did not encounter a problem that required DSA , I might learn it if I want to get employed, What do you guys think?
/r/django
https://redd.it/1epm98y
The contextvars and the chain of asyncio tasks in Python
Talks about how the context is maintained in the chain of async function calls.
https://valarmorghulis.io/tech/202408-the-asyncio-tasks-and-contextvars-in-python/
/r/Python
https://redd.it/1ephl0g
[P] Vison Language Models from Scratch
https://sachinruk.github.io/blog/2024-08-11-vision-language-models.html
/r/MachineLearning
https://redd.it/1epga39