D How is your neurips discussion period going?
How is your neurips discussion period going?
Any funny anecdotes?
/r/MachineLearning
https://redd.it/1eowx75
Display Ad implementation
I’m currently building an Ad feature for my companies website and building all the models from scratch with html and styles as well. I’m wondering if there are some other open source repos that have good setups for what I want. I’m only looking for display ads so nothing complicated like videos or anything.
Any help is appreciated.
/r/django
https://redd.it/1epasio
I'm building a Django Boilerplate Code Platform to save a lot of time when developing Django projects.
If you have some time (2 minutes) I'm trying to gather suggestions from the Django Developer community to build a software that generates you a Django Project with a lot of stuff pre-configured, saving you a lot of hours of boring and repetitive code and configurations.
I would love if you could spend 2 minutes filling this form or just leave some suggestions for the platform down here on the comments:
https://forms.gle/ZG99oqZsEWohmzK88
Thank you all!
/r/django
https://redd.it/1ep5sts
Can anyone suggest me a yt playlist
Hey can anyone please recommend me to a good YouTube playlist to learn Django which is not to difficult to learn but teachs all the concepts.
Thank in advance ☺️
/r/djangolearning
https://redd.it/1eo0vg7
Hosting Options for React+Django
Hi
Are there any hosting providers that provide a react+django hosting plan? I tried https://choreo.dev/ but it does not seem that mature.
Thanks!
/r/django
https://redd.it/1eowd1y
How handle files such as images
Guys I’m an unable to save files such as images in the database using flaskform. I choose an image and I submit I keep on seeing no selected image, I have tried using secure_filename() it also didn’t work. How do you guys solve this problem
/r/flask
https://redd.it/1eogfej
Website to app
I have a functional website with frontend react and backend django. Now, i want to make a mobile application for the same+ i am a beginner. I want to know how can i create a mobile app using the same django backend. Should i use flutter or react native.
Please give any advice u have
/r/django
https://redd.it/1eoo6nv
Flake8 Import Guard: Automate Import Restriction Checks in Python Projects
# What My Project Does?
Flake8 Import Guard is a Flake8 plugin that automates the enforcement of import restrictions in Python projects. It detects forbidden imports in new and modified files, focusing on newly added imports in Git-versioned files.
The plugin is highly configurable through `.flake8` or `pyproject.toml` files, allowing teams to tailor import restrictions to their specific needs.
# Target Audience
* Python developers working on medium to large-scale projects
* Development teams looking to enforce coding standards
* Open-source maintainers wanting to control library usage
* Anyone looking to gradually phase out deprecated modules or prevent the use of certain libraries
* Teams aiming to streamline their code review process
# Comparison
While there are several Flake8 plugins that handle various aspects of import checking(While plugins like `flake8-forbidden-imports`, or `flake8-tidy-imports` offer some similar functionalities), Flake8 Import Guard offers a unique combination of features not found in other plugins:
* Git-aware checking
* Unlike other plugins, it only flags newly added imports by considering Git change history. This makes it ideal for introducing to existing projects without causing immediate disruption.
* Flexible configuration
* Offers easy setup through `.flake8` or `pyproject.toml` files, allowing teams to tailor import restrictions to their specific needs. Seamless integration with existing Flake8
/r/Python
https://redd.it/1eoip79
[R] Apple Intelligence Foundation Language Models
https://arxiv.org/abs/2407.21075
/r/MachineLearning
https://redd.it/1eogp0c
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
# Weekly Thread: Resource Request and Sharing 📚
Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!
## How it Works:
1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.
## Guidelines:
Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.
## Example Shares:
1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.
## Example Requests:
1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.
Share the knowledge, enrich the community. Happy learning! 🌟
/r/Python
https://redd.it/1eof43a
How to convert ipynb to pdf inside Jupyter notebook? I came across a solution stating we need to install pandoc but the official pandoc redirects us to the GitHub files which one to download now ??
/r/IPython
https://redd.it/1eo5ipp
Unable to resolve 404 Not Found Error
I have a functioning HTML page with the following 'Accept' anchor button inside a table.<td><a href="{{ url_for('accept_req', ad_id = ele[0].ad_id) }}" class="btn btn-outline-success">Accept</a></td>
Now I know for sure that ele[0].ad_id
isnt causing the problem. Because the link is being generated.
But somehow the control is not reaching to the function definition:
@app.route('/edittable/acceptreq/<int:adid>', methods = 'GET', 'POST')
def acceptreq(adid):
#--------func definitions----
return
(rendertemplate("successpage.html"))
I am convinced that there is no similar named function or similar address (tried changing the route address but same result) function in my file.
-------------------------------------------------
Please guide me where am i going wrong?
/r/flask
https://redd.it/1em8c6b
Any startup or small / fast-moving teams using TDD with Django?
I am contemplating the idea of moving towards TDD when using Django. I've noticed that I spend a lot of time writing temporary scripts or playing around with the django shell when working on a specific piece of code. It feels fast enough and intuitive, but I feel like all this parallel work could be used to also have tests beside my code, and benefit from it a few months down the line.
I was scared of over engineering things or do too much at the same time, so haven't put too much effort in testing for my current project. My intuition was that, in order to be fast and simple for a first prototype / MVP, it was better to put TDD on the side. But things get complex fast and a couple months are enough to forget about certain pieces of my codebase.
I was wondering if some people are consistent in using TDD from the very start, even for small projects or prototypes that require fast delivery? Or if on the other hand some people have tried and concluded it was too much overhead?
Thank you!
/r/django
https://redd.it/1enwvfi
Not understanding topics while self teaching.
I am teaching myself Python using online resources. After learning a topic, I sometimes feel like I only retained like 60% of it. Has anyone else felt like that when learning ?
/r/Python
https://redd.it/1ensz5h
emval: validating email addresses at 1000x the speed.
What My Project Does: Python Email Validation at turbo speeds.
Target Audience: Developers
Comparison: emval largely draws it's inspiration from python-email-validator. They key difference is performance. emval validates emails at 1000x the speed.
Over the course of a year, I've become obsessed with speeding up all things python. Drawing inspiration from authors of UV, Pydantic, Polars I set out to build an amazingly fast email validator. Let me know what you think!
https://github.com/bnkc/emval
/r/Python
https://redd.it/1enbm7r
cambd: cli dictionary app with suggestions feature on misspelt words
What My Project Does: a CLI dictionary app that offers auto-suggestions for related words on typos with an interactive selection menu. It handles past and past participle forms, returning the original word's definition. It comes with persistent caching for faster results by avoiding repeated lookup.
>It was initially developed as a personal project to assist me as a non-native English speaker.
Target Audience: Terminal power users/developers
Comparison: Don't know if any alternatives for this exists with the same features as this tool.
https://github.com/rocktimsaikia/cambd
/r/Python
https://redd.it/1epe9oa
[R] Tree Attention: Topology-aware Decoding for Long-Context Attention on GPU clusters
https://arxiv.org/abs/2408.04093
/r/MachineLearning
https://redd.it/1ep9qpa
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/1ep73kv
Sharing what I would consider as a win
I consider myself as a baby in programming even though I have a CE degree.
I had received a notification on my Google account that its storage had reached 75%.
I could always pay a very small fee just for 100GB, but that's just a temporary fix - morphine for the pain.
So I needed to clean up my gmail manually - but not that manually.
I started googling and reading other people's codes who had already developed their own application for the same objective.
I don't know if this is considered stealing or cheating, but I took some for their code, tweaked it and mentioned their links in the [main.py](http://main.py/) file.
# Comparison
Here are their links (for comparison):
[https://github.com/marin117/Gmail-deleter/blob/master/src/gmail\_deleter.py](https://github.com/marin117/Gmail-deleter/blob/master/src/gmail_deleter.py)
[https://thepythoncode.com/article/use-gmail-api-in-python#google\_vignette](https://thepythoncode.com/article/use-gmail-api-in-python#google_vignette)
This is nothing more than a *personal project* - an idea that came to mind instead of temporarily fixing it with 100GB of additional storage.
# What My Project Does
Basically, it uses gmail's API to:
* **send messages** (did it to test the API).
* **get message-ids**.
* **delete messages**.
# Target Audience
Here is the link of the project for the curious minds:
[https://github.com/benSharon/Gmail-Manager](https://github.com/benSharon/Gmail-Manager)
Obviously, this project is for personal use.
I have used it to clean up my gmail's storage and, to be able to
/r/Python
https://redd.it/1eouavj
Best book to learn Django?
i am almost done with Corey's course and will be building projects so i want a book for Django
so recommend me one
/r/django
https://redd.it/1eorgd5
I THINK I NEED HELP
In my internship they asked me for a few things
1. Deployment of Djano
2. SSL (HTTPS MODE) the issue is the company said they wanna see me deploy it on their local host for once (no cloud) and they want their intranet pcs to be able to use it
The issue is I dont quite get the deployment part
secondly their server is windows 2008 server
LIKE HOW CAN I DO IT NOW
I saw some youtube tutorials about nginx and waitress but idk
SO I AM HERE FOR HELP
/r/djangolearning
https://redd.it/1eov6a6
A Slick n Lightweight screen recorder for linux! With some cool features :]
What My Project Does:
Slick Recorder is a lightweight and stylish recording application designed specifically for Linux. It offers a sleek user interface and powerful features to make your recording experience seamless and enjoyable.
Target Audience :
Linux Users
Comparison :
Noise Reduction: Automatically reduces background noise for clear audio recordings.
Easy to install just run 'pip install SlickRecorder'
Keyboard Input Display: Show your keyboard inputs in the recordings.
Subtitle Generation: Generate subtitles for your recordings effortlessly.
Lightweight GUI: A cool and minimalistic graphical interface to manage all your recording tasks.
Custom Cursors: Personalize your recording experience with custom cursor options.
Github : https://github.com/merwin-asm/SlickRecorder
/r/Python
https://redd.it/1eoptj5
Fits2db -Tool to load fits file tables into a sql database
What My Project Does:
fits2db is an open-source tool designed to convert FITS files (commonly used in astronomy) into SQL databases. This makes it easier to handle, query, and analyze the large datasets typically stored in FITS files.
Target Audience:
This tool is perfect for astronomers, data scientists, and anyone who regularly works with FITS files and needs an efficient way to manage and query their data.
Comparison:
Compared to existing tools, fits2db focuses specifically on seamless conversion to SQL databases, allowing for more flexible and powerful data manipulation than basic FITS file readers or converters that may not support complex queries.
I’m looking for feedback, feature suggestions, and potential contributors. Please check it out and share your thoughts!
GitHub: fits2db
/r/Python
https://redd.it/1eoa7ir
How to go from intermediate to advanced in Django & HTMX? Seeking Guidance on Django & HTMX Best Practices
Dear Django Community,
Like many of you, I've fully embraced the HTMX hype and have been developing an application as part of my job (1-2 days per week) for the past two years. Working solo, I've made stellar progress and implemented an astonishing amount of features given my limited time. However, now that the codebase is growing, I'm running into challenges with architectural decisions and could really use some expert advice on how to improve further. Here are a few of the issues I've been struggling with lately:
1. Front-end Code Organization:
I have numerous partials that get swapped in and out, and it’s becoming increasingly difficult to manage. My code is not very DRY; I find myself repeatedly implementing similar HTML swaps across the codebase. However, I’m also uncertain about reusing the same HTML code block in multiple locations. I’m unsure how to test such html blocks for proper swap-ins, and tracking dependencies reliably seems daunting. How do experts organize their front-end codebases to avoid such issues?
2. Dynamic Forms:
Initially, I implemented everything in pure HTML with HTMX, but the number of endpoints and swaps quickly spiraled out of control. Now, I use crispy_forms and submit the form on each change and then
/r/django
https://redd.it/1eoahao
LLM Aided OCR (Correcting Tesseract OCR Errors with LLMs with Python)
Code: https://github.com/Dicklesworthstone/llm\_aided\_ocr
# What My Project Does
Almost exactly 1 year ago, I made a little project using Llama2 (which had just come out) to improve the output of Tesseract OCR by correcting obvious OCR errors. That was exciting at the time because OpenAI's API calls were still quite expensive for GPT4, and the cost of running it on a book-length PDF would just be prohibitive. In contrast, you could run Llama2 locally on a machine with just a CPU, and it would be extremely slow, but "free" if you had a spare machine lying around.
Well, it's amazing how things have changed since then. Not only have models gotten a lot better, but the latest "low tier" offerings from OpenAI (GPT4o-mini) and Anthropic (Claude3-Haiku) are incredibly cheap and incredibly fast. So cheap and fast, in fact, that you can now break the document up into little chunks and submit them to the API concurrently (where each chunk can go through a multi-stage process, in which the output of the first stage is passed into another prompt for the next stage) and assemble it all in a shockingly short amount of time, and for basically a rounding error in terms of cost.
My original
/r/Python
https://redd.it/1eo6dxz
Crawling Pages with Infinite Scroll using Scrapy and Playwright
Starting to document parts of my recent crawling journey in some blog posts. The first was navigating infinite scroll pages with inconsistent behaviors.
Crawling Pages with Infinite Scroll using Scrapy and Playwright
/r/Python
https://redd.it/1eo2yry
Add examples to Sphinx docs automatically
You have developer a package with an examples folder containing several examples of how to use your package and you would like to include them into your sphinx docs.
screenshot
We expect that you are familiar with Sphinx (a tool that automatically generate the documentation for your package).
How to include code examples into Sphinx docs?
1. Manually. You can write the rst files yourself and then add them manually into the the index.rst.
2. Automatically. Use the package to generate the rst files for each of your examples (and generate a toc file for them).
What do you need?
A folder containing your python examples.
How to use the package?
1. Install the package.
2. Generate your documentations using Sphinx (e.g., make html).
3. Use the package to generate the examples rst files and the examples toc file.
4. Regenerate the documentation (e.g., make html).
Example of how to add examples to index.rst.. toctree::
:maxdepth: 3
:caption: Contents:
modules
examples
Here is the project repo on GitHub: https://github.com/ahmad88me/sphinx\_example\_includer
/r/Python
https://redd.it/1eo0yie
Spotify batch import script
Hello all. Sharing this script for batch uploading files to spotify. Couldnt find any free services and figured this would be a fairly easy automation task. All contributions welcome, enjoy! [https://github.com/SlideeScherz/spotify-batcher](https://github.com/SlideeScherz/spotify-batcher)
**What My Project Does**
* **given a text file of songs, add all to Spotify library or user playlist**
**Target Audience** (e.g., Is it meant for production, just a toy project, etc.)
* Spotify users, Automation lovers
**Comparison** (A brief comparison explaining how it differs from existing alternatives.)
* free, open source
/r/Python
https://redd.it/1enp91w
D FlexAttention: Flexibility of PyTorch with Performance of FlashAttention
https://pytorch.org/blog/flexattention/
/r/MachineLearning
https://redd.it/1en6h4b
Need help with flask @login_required redirection
In my account route, I have a \`login\_required\` decorator. But when I log in, it doesn't redirect back to the account page; instead, it redirects the user back to the home page.
@app.route("/login", methods=['POST', 'GET'])
def login():
if current_user.is_authenticated:
return redirect(url_for('home'))
form = LoginForm()
if form.validate_on_submit():
user = User.query.filter_by(email=form.email.data).first()
if user and bcrypt.check_password_hash(user.password, form.password.data):
login_user(user, remember=form.remember.data)
next_page = request.args.get('next')
# Correct handling of the next page parameter
if next_page:
return redirect(next_page)
else:
return redirect(url_for('home'))
else:
/r/flask
https://redd.it/1em9a5h