Django 5.x Technical Board Candidate Registration
https://www.djangoproject.com/weblog/2023/apr/22/technical-board-candidate-registration/
/r/django
https://redd.it/12vl1hs
https://www.djangoproject.com/weblog/2023/apr/22/technical-board-candidate-registration/
/r/django
https://redd.it/12vl1hs
Django Project
Django 5.x Technical Board Candidate Registration
Posted by Katie McLaughlin on April 22, 2023
Display information from another model in another admin model
I have two models in my Models.py; "Award" and "Status"
There is a link from User to Status to mark who made the update, from their the Status is linked to Award. This allows a user to update the status of a specific award over a period of time. It also ensures that if multiple people work on it and update the status it reflects the correct person who made the update. This is because the whole thing needs to be tracked each time someone "touches" it. Nothing can be deleted.
I would like to display the most current status inside the Admin table (where all awards would be list).
Here is my models.py.
class Award(models.Model):
datecreated = models.DateTimeField(autonowadd=True)
datemodified = models.DateTimeField(autonow=True)
firstname = models.CharField(maxlength=50, verbosename = "First Name")
lastname = models.CharField(maxlength=50, verbosename = "Last Name")
rank = models.CharField(maxlength=5, default=None,
choices=RANKCHOICES)
unit = models.CharField(maxlength=6,
/r/djangolearning
https://redd.it/12vjqp8
I have two models in my Models.py; "Award" and "Status"
There is a link from User to Status to mark who made the update, from their the Status is linked to Award. This allows a user to update the status of a specific award over a period of time. It also ensures that if multiple people work on it and update the status it reflects the correct person who made the update. This is because the whole thing needs to be tracked each time someone "touches" it. Nothing can be deleted.
I would like to display the most current status inside the Admin table (where all awards would be list).
Here is my models.py.
class Award(models.Model):
datecreated = models.DateTimeField(autonowadd=True)
datemodified = models.DateTimeField(autonow=True)
firstname = models.CharField(maxlength=50, verbosename = "First Name")
lastname = models.CharField(maxlength=50, verbosename = "Last Name")
rank = models.CharField(maxlength=5, default=None,
choices=RANKCHOICES)
unit = models.CharField(maxlength=6,
/r/djangolearning
https://redd.it/12vjqp8
Reddit
r/djangolearning on Reddit: Display information from another model in another admin model
Posted by u/HeadlineINeed - 2 votes and 2 comments
Sunday Daily Thread: What's everyone working on this week?
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/12vod9k
Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.
/r/Python
https://redd.it/12vod9k
Reddit
r/Python on Reddit: Sunday Daily Thread: What's everyone working on this week?
Posted by u/Im__Joseph - 1 vote and 1 comment
This media is not supported in your browser
VIEW IN TELEGRAM
[P] I built a tool that auto-generates scrapers for any website with GPT
https://redd.it/12v0vda
@pythondaily
https://redd.it/12v0vda
@pythondaily
Thought you might like my Todoist dashboard
Hello,
Long time lurker.
I'm a huge fan of Todoist and use it every day for work. One feature that I felt was missing though, was a nicely laid out, clean dashboard which would just show my tasks for that day.
So, I built one!
Originally it was just for personal use, but a few others at work liked it and wanted access, so I've made it available for free.
This is the first release, and I'm not a professional coder, so I'm sure there will be some bugs, but I'd appreciate any feedback and hope some might get some use from it.
https://www.today.ninja
Thanks,
/r/flask
https://redd.it/12vp3id
Hello,
Long time lurker.
I'm a huge fan of Todoist and use it every day for work. One feature that I felt was missing though, was a nicely laid out, clean dashboard which would just show my tasks for that day.
So, I built one!
Originally it was just for personal use, but a few others at work liked it and wanted access, so I've made it available for free.
This is the first release, and I'm not a professional coder, so I'm sure there will be some bugs, but I'd appreciate any feedback and hope some might get some use from it.
https://www.today.ninja
Thanks,
/r/flask
https://redd.it/12vp3id
Reddit
r/flask on Reddit: Thought you might like my Todoist dashboard
Posted by u/amateur-dev-dave - 1 vote and no comments
AttributeError with Psycopg3 vs Psycopg2
# Anyone having issues using psycopg 3.1.8 on Django 4.2?
On Psycopg2 (psycopg2==2.9.6), everything works fine.
On Psycopg3 (psycopg==3.1.8), somethings work fine.
* I can make migrations
* I can CRUD from the shell
* **However I can not connect to the server**
​
Traceback (most recent call last):
File "/home/username/server/web_app/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/utils/deprecation.py", line 133, in __call__
response = self.process_request(request)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/contrib/sites/middleware.py", line 12, in process_request
request.site = get_current_site(request)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/contrib/sites/shortcuts.py", line 16, in get_current_site
return Site.objects.get_current(request)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/contrib/sites/models.py", line 59, in get_current
return self._get_site_by_id(site_id)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/contrib/sites/models.py", line 30, in _get_site_by_id
site = self.get(pk=site_id)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/db/models/manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/db/models/query.py", line
/r/django
https://redd.it/12vp8j9
# Anyone having issues using psycopg 3.1.8 on Django 4.2?
On Psycopg2 (psycopg2==2.9.6), everything works fine.
On Psycopg3 (psycopg==3.1.8), somethings work fine.
* I can make migrations
* I can CRUD from the shell
* **However I can not connect to the server**
​
Traceback (most recent call last):
File "/home/username/server/web_app/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/utils/deprecation.py", line 133, in __call__
response = self.process_request(request)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/contrib/sites/middleware.py", line 12, in process_request
request.site = get_current_site(request)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/contrib/sites/shortcuts.py", line 16, in get_current_site
return Site.objects.get_current(request)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/contrib/sites/models.py", line 59, in get_current
return self._get_site_by_id(site_id)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/contrib/sites/models.py", line 30, in _get_site_by_id
site = self.get(pk=site_id)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/db/models/manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/username/server/web_app/lib/python3.10/site-packages/django/db/models/query.py", line
/r/django
https://redd.it/12vp8j9
Reddit
r/django on Reddit: AttributeError with Psycopg3 vs Psycopg2
Posted by u/jpegger85 - 6 votes and no comments
CustomTkinter is an easy to use desktop UI library based on Tkinter
https://customtkinter.tomschimansky.com
/r/Python
https://redd.it/12v9p1h
https://customtkinter.tomschimansky.com
/r/Python
https://redd.it/12v9p1h
Tomschimansky
Official Documentation And Tutorial | CustomTkinter
CustomTkinter is a python desktop UI-library based on Tkinter, which provides modern looking and fully customizable widgets.
Form data not saving to database
https://stackoverflow.com/questions/76082658/django-contact-form-data-not-being-saved
/r/djangolearning
https://redd.it/12vw020
https://stackoverflow.com/questions/76082658/django-contact-form-data-not-being-saved
/r/djangolearning
https://redd.it/12vw020
Stack Overflow
django Contact Form data not being saved
I am building a website for my brother and it needs a contact form, the HTML template had one pre built so i custom build a model form based off what was included in the template, so far it all wor...
I've written a tutorial on how to use ChatGPT (GPT3) over your own documents
https://www.reaminated.com/run-chatgpt-style-questions-over-your-own-files-using-the-openai-api-and-langchain
/r/Python
https://redd.it/12vq8mm
https://www.reaminated.com/run-chatgpt-style-questions-over-your-own-files-using-the-openai-api-and-langchain
/r/Python
https://redd.it/12vq8mm
Reaminated's Blog
Run ChatGPT-Style Questions Over Your Own Files
ChatGPT No Longer Just For The Web - Query Your Own Files!
What is difference between
/r/flask
https://redd.it/12vznkf
redirect_url, login_url and authorized_url in flask dance GitHub provider?/r/flask
https://redd.it/12vznkf
Reddit
r/flask on Reddit: What is difference between `redirect_url`, `login_url` and `authorized_url` in flask dance GitHub provider?
Posted by u/harkishan01 - 5 votes and 1 comment
[P] I built a simple and efficient rate limiter for the OpenAI API
https://github.com/shobrook/openlimit
/r/MachineLearning
https://redd.it/12w6k44
https://github.com/shobrook/openlimit
/r/MachineLearning
https://redd.it/12w6k44
GitHub
GitHub - shobrook/openlimit: Efficient, per-second rate limiter for the OpenAI API
Efficient, per-second rate limiter for the OpenAI API - shobrook/openlimit
As if there weren't enough packaging tools already: mitsuhiko/rye: an experimental alternative to poetry/pip/pipenv/venv/virtualenv/pdm/hatch/…
https://github.com/mitsuhiko/rye
/r/Python
https://redd.it/12w2ws7
https://github.com/mitsuhiko/rye
/r/Python
https://redd.it/12w2ws7
GitHub
GitHub - astral-sh/rye: a Hassle-Free Python Experience
a Hassle-Free Python Experience. Contribute to astral-sh/rye development by creating an account on GitHub.
Question about unit testing
Suppose I have a User entity and I have this business rule: usernames should be saved in lowercase letters.
If we need to enforce this rule with a test, what layer does this test belong to?
Controller? Service? Domain model? Repository? Integration test?
What layer should this test live in?
/r/Python
https://redd.it/12wcyf0
Suppose I have a User entity and I have this business rule: usernames should be saved in lowercase letters.
If we need to enforce this rule with a test, what layer does this test belong to?
Controller? Service? Domain model? Repository? Integration test?
What layer should this test live in?
/r/Python
https://redd.it/12wcyf0
Reddit
r/Python on Reddit: Question about unit testing
Posted by u/Zumcddo - 11 votes and 8 comments
Deploying a Flask and Vue App to Heroku with Docker and Gitlab CI
https://testdriven.io/blog/deploying-flask-to-heroku-with-docker-and-gitlab/
/r/flask
https://redd.it/12w9idz
https://testdriven.io/blog/deploying-flask-to-heroku-with-docker-and-gitlab/
/r/flask
https://redd.it/12w9idz
testdriven.io
Deploying a Flask and Vue App to Heroku with Docker and Gitlab CI
This tutorial looks at how to containerize a full-stack web app powered by Flask and Vue and deploy it to Heroku using Gitlab CI.
Trying out tunnel.dev
Hey, what's up, everyone? I'm building a startup called Tunnel. Tunnel is a super fast way to get a locally running app on the web, and it comes with a bunch of tools for collecting feedback like commenting and video chat.
I would love it if you all could check out our docs and give me some feedback! Here's the link: https://docs.tunnel.dev
I'm also happy to answer any questions you have, like "Why is Tunnel better than ngrok?"
Thanks, builders!
/r/flask
https://redd.it/12wksay
Hey, what's up, everyone? I'm building a startup called Tunnel. Tunnel is a super fast way to get a locally running app on the web, and it comes with a bunch of tools for collecting feedback like commenting and video chat.
I would love it if you all could check out our docs and give me some feedback! Here's the link: https://docs.tunnel.dev
I'm also happy to answer any questions you have, like "Why is Tunnel better than ngrok?"
Thanks, builders!
/r/flask
https://redd.it/12wksay
Tunnel
What is Tunnel? - Tunnel
Monday Daily Thread: Project ideas!
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.
/r/Python
https://redd.it/12wvgm0
Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.
/r/Python
https://redd.it/12wvgm0
Reddit
r/Python on Reddit: Monday Daily Thread: Project ideas!
Posted by u/Im__Joseph - No votes and no comments
Solarflare
Hello! I made a simple Python Library for solar/lunar calculations. Its main focus is on Sunset/rise times, but it can calculate other things (solar noon, moon phases, etc.). You can view its documentation at https://solarflare.w3spaces.com , and the source code at Github (https://github.com/PyndyalaCoder/solarflare ). Tell me what you think! If you like it, please star the repository on Github.
/r/Python
https://redd.it/12wvwsa
Hello! I made a simple Python Library for solar/lunar calculations. Its main focus is on Sunset/rise times, but it can calculate other things (solar noon, moon phases, etc.). You can view its documentation at https://solarflare.w3spaces.com , and the source code at Github (https://github.com/PyndyalaCoder/solarflare ). Tell me what you think! If you like it, please star the repository on Github.
/r/Python
https://redd.it/12wvwsa
GitHub
GitHub - PyndyalaCoder/Solarflare: A python library for calculating solar events
A python library for calculating solar events. Contribute to PyndyalaCoder/Solarflare development by creating an account on GitHub.
Does anyone know of a good tutorial for documenting code and what I should use for flask?
Does anyone know of a good tutorial for documenting code and what I should use for flask?
/r/flask
https://redd.it/12wz3fw
Does anyone know of a good tutorial for documenting code and what I should use for flask?
/r/flask
https://redd.it/12wz3fw
Reddit
r/flask on Reddit: Does anyone know of a good tutorial for documenting code and what I should use for flask?
Posted by u/notprimenumber12344 - 2 votes and 2 comments
I have made some easy tools to rip webpages, clean the data, and vectorize it for a Pinecone DB. Great if you want your AI to consult a webpage.
[https://github.com/Sstobo/Site-Sn33k](https://github.com/Sstobo/Site-Sn33k)
Take a look :)
# Website Scraper and Vectorizer
This Python repository contains a set of scripts that allow you to scrape a website, clean the data, organize it, chunk it, and then vectorize it. The resulting vectors can be used for a variety of machine learning tasks, such as similarity search or clustering.
## Files
* cleaner.py
: This script downloads a website using wget, reads and cleans the HTML files using Beautiful Soup, and saves the resulting text files in a specified directory.
* chunker.py
: This script splits the text files into smaller chunks, using a recursive character-based text splitter. The resulting chunks are saved in a JSONL file.
* vectorizor.py
: This script loads the JSONL file, creates embeddings using OpenAI's text-embedding-ada-002 model, and indexes the embeddings using Pinecone. This is the one script you need api keys to run
​
Enjoy and let me know if this helps with anything, or you have any feedback :)
/r/Python
https://redd.it/12wqzbk
[https://github.com/Sstobo/Site-Sn33k](https://github.com/Sstobo/Site-Sn33k)
Take a look :)
# Website Scraper and Vectorizer
This Python repository contains a set of scripts that allow you to scrape a website, clean the data, organize it, chunk it, and then vectorize it. The resulting vectors can be used for a variety of machine learning tasks, such as similarity search or clustering.
## Files
* cleaner.py
: This script downloads a website using wget, reads and cleans the HTML files using Beautiful Soup, and saves the resulting text files in a specified directory.
* chunker.py
: This script splits the text files into smaller chunks, using a recursive character-based text splitter. The resulting chunks are saved in a JSONL file.
* vectorizor.py
: This script loads the JSONL file, creates embeddings using OpenAI's text-embedding-ada-002 model, and indexes the embeddings using Pinecone. This is the one script you need api keys to run
​
Enjoy and let me know if this helps with anything, or you have any feedback :)
/r/Python
https://redd.it/12wqzbk
GitHub
GitHub - Sstobo/Site-Sn33k: A collection of tools to rip webpages, and clean them for pinecone
A collection of tools to rip webpages, and clean them for pinecone - Sstobo/Site-Sn33k