10 Tips to Optimize PostgreSQL Queries in Django - w/ Jupyter notebook
Hi there! Those working with big RDBS might be interested in this new entry on optimizing Django and SQL queries. There is also a jupyter notebook to test the tips linked in the article.
Enjoy!
https://blog.gitguardian.com/10-tips-to-optimize-postgresql-queries-in-your-django-project/
/r/Python
https://redd.it/10av799
Hi there! Those working with big RDBS might be interested in this new entry on optimizing Django and SQL queries. There is also a jupyter notebook to test the tips linked in the article.
Enjoy!
https://blog.gitguardian.com/10-tips-to-optimize-postgresql-queries-in-your-django-project/
/r/Python
https://redd.it/10av799
GitGuardian Blog - Take Control of Your Secrets Security
10 Tips to Optimize PostgreSQL Queries in Your Django Project
Philippe is back, this time joined by Laurent, to reveal their best tips & tricks to make Django and Postgres the best friends in the world.
I made Light Config (LCO) - a super small package/snippet to load a config once and use it anywhere in your application
Light Config (LCO)
I made this package for prototypes, MVPs or research code, not really something I would use for production. I find it neat since you can just load a config like so from anywhere in your code.
import lco
lco.init("yourconfigfile.yml")
And access the configuration parameters specified in the YAML file from anywhere (across threads and processes) like so:
import lco
lco"some_key"
lco"some_group""some_key"
I hope this is useful for anyone besides me :)
Edit:
If you don't have tons of nested parameters and different data types I would recommend using dotenv over my solution!
/r/Python
https://redd.it/10axlc6
Light Config (LCO)
I made this package for prototypes, MVPs or research code, not really something I would use for production. I find it neat since you can just load a config like so from anywhere in your code.
import lco
lco.init("yourconfigfile.yml")
And access the configuration parameters specified in the YAML file from anywhere (across threads and processes) like so:
import lco
lco"some_key"
lco"some_group""some_key"
I hope this is useful for anyone besides me :)
Edit:
If you don't have tons of nested parameters and different data types I would recommend using dotenv over my solution!
/r/Python
https://redd.it/10axlc6
GitHub
GitHub - MiniXC/lco: Light Config for research code, MVPs and prototypes.
Light Config for research code, MVPs and prototypes. - GitHub - MiniXC/lco: Light Config for research code, MVPs and prototypes.
Python bindings for RocksDB and LevelDB
My team and I have been working on a large project to unify interfaces across the most famous Key-Value Stores and extend their functionality to support Documents, Graphs, and other forms of content. Similar to how RedisJSON, RedisGraph, and RediSearch augment the functionality of Redis.
import ukv.rocksdb as embedded
db = embedded.DataBase('/tmp/ukv/rocksdb/')
db.main[42] = 'Hi'
Python is the most critical language for the bindings, as we do a fair share of Machine Learning. We are building the bindings for Graph collections to look like NetworkX and the ones for Tabular collections - like Pandas. But the latter is still far from being feature-complete.
db['social'].graph.add_edge(alice_id, bob_id)
db['payments'].table[['name', 'amount']].tail(5)
There is also little difference between having it locally vs. remotely. You can set up a remote machine with 100 TBs of NVMe SSDs, running RocksDB, storing a graph with 1 Trillion edges, and still talk to it as if it is a tiny local in-memory graph.
The project is still in its infancy, and we would appreciate any feedback! Thank you!
[GitHub](https://github.com/unum-cloud/ukv)
[Documentation](https://unum.cloud/ukv)
/r/Python
https://redd.it/10b4n3v
My team and I have been working on a large project to unify interfaces across the most famous Key-Value Stores and extend their functionality to support Documents, Graphs, and other forms of content. Similar to how RedisJSON, RedisGraph, and RediSearch augment the functionality of Redis.
import ukv.rocksdb as embedded
db = embedded.DataBase('/tmp/ukv/rocksdb/')
db.main[42] = 'Hi'
Python is the most critical language for the bindings, as we do a fair share of Machine Learning. We are building the bindings for Graph collections to look like NetworkX and the ones for Tabular collections - like Pandas. But the latter is still far from being feature-complete.
db['social'].graph.add_edge(alice_id, bob_id)
db['payments'].table[['name', 'amount']].tail(5)
There is also little difference between having it locally vs. remotely. You can set up a remote machine with 100 TBs of NVMe SSDs, running RocksDB, storing a graph with 1 Trillion edges, and still talk to it as if it is a tiny local in-memory graph.
The project is still in its infancy, and we would appreciate any feedback! Thank you!
[GitHub](https://github.com/unum-cloud/ukv)
[Documentation](https://unum.cloud/ukv)
/r/Python
https://redd.it/10b4n3v
GitHub
GitHub - unum-cloud/ustore: Multi-Modal Database replacing MongoDB, Neo4J, and Elastic with 1 faster ACID solution, with NetworkX…
Multi-Modal Database replacing MongoDB, Neo4J, and Elastic with 1 faster ACID solution, with NetworkX and Pandas interfaces, and bindings for C 99, C++ 17, Python 3, Java, GoLang 🗄️ - unum-cloud/us...
Forwarded from Python Daily
How do I integrate TailwindCSS with Django? I’ve tried multiple tutorials and nothing is working.
What’s the best way to do this? Looking for a current tutorial and directions.
/r/djangolearning
https://redd.it/10baq06
What’s the best way to do this? Looking for a current tutorial and directions.
/r/djangolearning
https://redd.it/10baq06
reddit
How do I integrate TailwindCSS with Django? I’ve tried multiple...
What’s the best way to do this? Looking for a current tutorial and directions.
why SQL is a requirement for Django jobs?
I was researching job requirements for Django developers, I have conducted a study on various job listings and have noticed that a significant number of companies require knowledge of raw SQL as a skill. However, I am puzzled by this requirement as I understand that Django follows the MVT (Model View Template) pattern, where database-related code is handled by the Model. This raises a question as to why raw SQL skills would be necessary for a Django developer. Can you provide a detailed explanation on the importance of raw SQL skills in the context of Django development and how it relates to the MVT pattern? Are there any specific tasks or scenarios that would require the use of raw SQL in a Django project? Are there any particular industry segments or areas where this skill is particularly valued?
/r/djangolearning
https://redd.it/10b3ls8
I was researching job requirements for Django developers, I have conducted a study on various job listings and have noticed that a significant number of companies require knowledge of raw SQL as a skill. However, I am puzzled by this requirement as I understand that Django follows the MVT (Model View Template) pattern, where database-related code is handled by the Model. This raises a question as to why raw SQL skills would be necessary for a Django developer. Can you provide a detailed explanation on the importance of raw SQL skills in the context of Django development and how it relates to the MVT pattern? Are there any specific tasks or scenarios that would require the use of raw SQL in a Django project? Are there any particular industry segments or areas where this skill is particularly valued?
/r/djangolearning
https://redd.it/10b3ls8
reddit
why SQL is a requirement for Django jobs?
I was researching job requirements for Django developers, I have conducted a study on various job listings and have noticed that a significant...
A tutorial for class based views user registration with email verification?
/r/djangolearning
https://redd.it/10avzs0
/r/djangolearning
https://redd.it/10avzs0
reddit
A tutorial for class based views user registration with email...
Posted in r/djangolearning by u/KhZaym • 1 point and 1 comment
Is it right to create a custom authentication form.Forms instead of extending the Django AuthenticationForm?
I've been working on my first authentication system using Django and I wanted to make it complete, with field validations, login with email and even send a confirmation email to activate the account (which I haven't done yet). So far, I have made: A small custom user model with email field, an extension of the UserCreationForm to register users using their emails (which works), and finally the main problem, I tried to make an extension of the AuthenticationForm to login users using their emails instead of their usernames, but it doesn't seem to work. First, I tried to overwrite the clean method of the form but it didn't work, then I tried to make a backend.py to overwrite how the authentication system works but it failed and I couldn't understand why, so I created my own form using form.Forms with all the necessary fields and validations and it worked fine. I've heard that it's not a good idea to use form.Forms if I interact with models, but it was the only solution I could think of. Should I try to extend the AuthenticationForm instead of creating a form from scratch? Or is my form fine for the system I want
/r/djangolearning
https://redd.it/10a43cg
I've been working on my first authentication system using Django and I wanted to make it complete, with field validations, login with email and even send a confirmation email to activate the account (which I haven't done yet). So far, I have made: A small custom user model with email field, an extension of the UserCreationForm to register users using their emails (which works), and finally the main problem, I tried to make an extension of the AuthenticationForm to login users using their emails instead of their usernames, but it doesn't seem to work. First, I tried to overwrite the clean method of the form but it didn't work, then I tried to make a backend.py to overwrite how the authentication system works but it failed and I couldn't understand why, so I created my own form using form.Forms with all the necessary fields and validations and it worked fine. I've heard that it's not a good idea to use form.Forms if I interact with models, but it was the only solution I could think of. Should I try to extend the AuthenticationForm instead of creating a form from scratch? Or is my form fine for the system I want
/r/djangolearning
https://redd.it/10a43cg
reddit
Is it right to create a custom authentication form.Forms instead...
I've been working on my first authentication system using Django and I wanted to make it complete, with field validations, login with email and...
10 Tips to Optimize PostgreSQL Queries in Your Django Project
Hi there! Those working with big RDBS might be interested in this new entry on optimizing Django and SQL queries. There is also a jupyter notebook to test the tips linked in the article.
Enjoy!
​
https://blog.gitguardian.com/10-tips-to-optimize-postgresql-queries-in-your-django-project/
/r/django
https://redd.it/10av4y9
Hi there! Those working with big RDBS might be interested in this new entry on optimizing Django and SQL queries. There is also a jupyter notebook to test the tips linked in the article.
Enjoy!
​
https://blog.gitguardian.com/10-tips-to-optimize-postgresql-queries-in-your-django-project/
/r/django
https://redd.it/10av4y9
GitGuardian Blog - Take Control of Your Secrets Security
10 Tips to Optimize PostgreSQL Queries in Your Django Project
Philippe is back, this time joined by Laurent, to reveal their best tips & tricks to make Django and Postgres the best friends in the world.
Need help finding django projects that use asgi
Hi guys , can you please suggest any mature/working projects that use asgi for my reference/learning ? I kinda am stuck trying to decide whether I have to port my work project to asgi from wsgi once we migrate from 2.2 to 3.2. any help is appreciated. Thanks.
/r/django
https://redd.it/10bdnac
Hi guys , can you please suggest any mature/working projects that use asgi for my reference/learning ? I kinda am stuck trying to decide whether I have to port my work project to asgi from wsgi once we migrate from 2.2 to 3.2. any help is appreciated. Thanks.
/r/django
https://redd.it/10bdnac
reddit
Need help finding django projects that use asgi
Hi guys , can you please suggest any mature/working projects that use asgi for my reference/learning ? I kinda am stuck trying to decide whether I...
Exciting news! I have just released a new tutorial series on Youtube, where I walk through the process of building a CV scanning and job-matching web application using Django. In this first tutorial, we will be giving an overview of the project and discussing the main features, functionality,
https://youtube.com/watch?v=ZcY9EILTpYM&feature=share
/r/django
https://redd.it/10bhptt
https://youtube.com/watch?v=ZcY9EILTpYM&feature=share
/r/django
https://redd.it/10bhptt
YouTube
00 Building a CV Scanning and Job Matching Web App with Django Overview Tutorial
In this tutorial, we will be giving an overview of the Django project we built for scanning CVs and matching them with job description keywords. We will be discussing the project's main features, functionality, and the technologies used to build it. By the…
What is so great about HTMX?
I’m curious why many people using Django is suggesting HTMX. What makes HTMX so different than making requests using plain Javascript (event listeners, fetch, etc…)? Not to mention it makes the code difficult to read. I’ve used it in the past, ended up replacing all the functionality with Javascript and I want to know if I’m missing something
/r/django
https://redd.it/10b0uxs
I’m curious why many people using Django is suggesting HTMX. What makes HTMX so different than making requests using plain Javascript (event listeners, fetch, etc…)? Not to mention it makes the code difficult to read. I’ve used it in the past, ended up replacing all the functionality with Javascript and I want to know if I’m missing something
/r/django
https://redd.it/10b0uxs
reddit
What is so great about HTMX?
I’m curious why many people using Django is suggesting HTMX. What makes HTMX so different than making requests using plain Javascript (event...
How do I get the most used choice from my queryset? (Postgres)
I'd like to receive the Max for an aggregated queryset where the modelfield I target is a PositiveSmallIntegerField connected with the Integer Choice class above.
Currently, I've tried it with the standard qs.aggregate(max=Max("label")), but as expected, I've received an error:
1 invalid literal for int() with base 10: 'Positive'
Can somebody help me out with a nice soloution for selecting the most used choice? Thanks in advice
​
/r/django
https://redd.it/10awubw
I'd like to receive the Max for an aggregated queryset where the modelfield I target is a PositiveSmallIntegerField connected with the Integer Choice class above.
Currently, I've tried it with the standard qs.aggregate(max=Max("label")), but as expected, I've received an error:
1 invalid literal for int() with base 10: 'Positive'
Can somebody help me out with a nice soloution for selecting the most used choice? Thanks in advice
​
/r/django
https://redd.it/10awubw
reddit
How do I get the most used choice from my queryset? (Postgres)
I'd like to receive the Max for an aggregated queryset where the modelfield I target is a PositiveSmallIntegerField connected with the Integer...
I have conducted a small research on the prevalent common requirements for Django-related job positions in Bangladesh. My findings are intended to serve as a valuable resource for individuals new to the field. I welcome any suggestions or feedback on how to improve this information.
https://docs.google.com/spreadsheets/d/1uLkCJrMpkHW-STciz0AmW8o_VQloseCWQUw4PmXWmuA/edit?usp=sharing
/r/django
https://redd.it/10b2npw
https://docs.google.com/spreadsheets/d/1uLkCJrMpkHW-STciz0AmW8o_VQloseCWQUw4PmXWmuA/edit?usp=sharing
/r/django
https://redd.it/10b2npw
Google Docs
Common Requirements for Django jobs
Sheet1
Robi Axiata Limited,Hire My Tech,HealthOS,inneed,TechForing,mediusware,BDtask,DivinIT,Common requirements,Out of 8 company required in
B.Sc/M.Sc in CSE or related field from reputed university,Frontend and Backend Architecture Integration, Development…
Robi Axiata Limited,Hire My Tech,HealthOS,inneed,TechForing,mediusware,BDtask,DivinIT,Common requirements,Out of 8 company required in
B.Sc/M.Sc in CSE or related field from reputed university,Frontend and Backend Architecture Integration, Development…
Simple "Frictionless" Authentication that is Secure "Enough"
I'm developing a django app where "frictionless" user authentication is a key selling point. The app is designed to enable group meal planning (e.g. on a vacation). A group leader generates a meal plan, inserts the names of "friends". A link is generated that can be shared outside of the app (e.g. an instant messenger app). Users get the link, and "claim" a user within this list of "friends", and can then participate in the meal planning.
I don't want users to have to authenticate traditionally using email/password or openID etc.. As this doesn't need to be super secure (there is assumed trust within your small group of friends), I still want persistence for the user so they don't always have to find the public link to get back "in".
Does a 3rd party module already exist for something like this?
I'm thinking of just using localStorage to persist the session. If that fails in the browser (disabled, or is cleared), then I could transparently "re-authenticate" the user if they have the same IP address used originally and possibly the same browser User Agent. Failing all that, I could also
/r/django
https://redd.it/10b22ip
I'm developing a django app where "frictionless" user authentication is a key selling point. The app is designed to enable group meal planning (e.g. on a vacation). A group leader generates a meal plan, inserts the names of "friends". A link is generated that can be shared outside of the app (e.g. an instant messenger app). Users get the link, and "claim" a user within this list of "friends", and can then participate in the meal planning.
I don't want users to have to authenticate traditionally using email/password or openID etc.. As this doesn't need to be super secure (there is assumed trust within your small group of friends), I still want persistence for the user so they don't always have to find the public link to get back "in".
Does a 3rd party module already exist for something like this?
I'm thinking of just using localStorage to persist the session. If that fails in the browser (disabled, or is cleared), then I could transparently "re-authenticate" the user if they have the same IP address used originally and possibly the same browser User Agent. Failing all that, I could also
/r/django
https://redd.it/10b22ip
reddit
Simple "Frictionless" Authentication that is Secure "Enough"
I'm developing a django app where "frictionless" user authentication is a key selling point. The app is designed to enable group meal planning...
So i got a python developer interview. What do I prepare?
I got an interview for a 1-2 years of experience required job. Its for python developer and I have some django experience. Im an electrical engineer who has learnt machine learning and python. The company is called “ML sense” so i assume its all related to machine learning. What do I prepare for the interview?
When they called me to schedule the interview, they asked me if Ive worked on AWS. Ive deployed an application on digital ocean before but never ran into AWS other than the digital ocean spaces storage which uses AWS.
/r/django
https://redd.it/10avbou
I got an interview for a 1-2 years of experience required job. Its for python developer and I have some django experience. Im an electrical engineer who has learnt machine learning and python. The company is called “ML sense” so i assume its all related to machine learning. What do I prepare for the interview?
When they called me to schedule the interview, they asked me if Ive worked on AWS. Ive deployed an application on digital ocean before but never ran into AWS other than the digital ocean spaces storage which uses AWS.
/r/django
https://redd.it/10avbou
reddit
So i got a python developer interview. What do I prepare?
I got an interview for a 1-2 years of experience required job. Its for python developer and I have some django experience. Im an electrical...
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
/r/Python
https://redd.it/10b9r0f
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?
Use this thread to chat about and share Python resources!
/r/Python
https://redd.it/10b9r0f
reddit
Saturday Daily Thread: Resource Request and Sharing! Daily Thread
Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic? Use this thread to chat about and...
ChatGPT is coming for python devs
Today I met with a coworker to gather requirements for a new geospatial data feed he needed built. The meeting's outcome was a decision to script the process of comparing and merging 30+ CSV files into a single flattened schema for import into a cloud-based data store. Said data store was a non-negotiable constraint that only accepts a single CSV as the input. We've got two python devs in-house and a geospatial platform with python and Jupyter baked in, so python is usually our weapon of choice for scripts like this. I digress...
Based on the complexity of the task and requirements I asked for one day to write and test the script, a second day to test further, and then go-live. He was fine with that but said he wanted to try something first.
A few hours later he walked up to my desk, stuck out his hand and said "It's been nice working with you". I did that thing where you think someone's joking, but then the joke persists a little longer than you expect and you start to think they're serious, only to realize they are in fact joking....sort of.
He goes on to
/r/Python
https://redd.it/10bcjhy
Today I met with a coworker to gather requirements for a new geospatial data feed he needed built. The meeting's outcome was a decision to script the process of comparing and merging 30+ CSV files into a single flattened schema for import into a cloud-based data store. Said data store was a non-negotiable constraint that only accepts a single CSV as the input. We've got two python devs in-house and a geospatial platform with python and Jupyter baked in, so python is usually our weapon of choice for scripts like this. I digress...
Based on the complexity of the task and requirements I asked for one day to write and test the script, a second day to test further, and then go-live. He was fine with that but said he wanted to try something first.
A few hours later he walked up to my desk, stuck out his hand and said "It's been nice working with you". I did that thing where you think someone's joking, but then the joke persists a little longer than you expect and you start to think they're serious, only to realize they are in fact joking....sort of.
He goes on to
/r/Python
https://redd.it/10bcjhy
reddit
ChatGPT is coming for python devs
Today I met with a coworker to gather requirements for a new geospatial data feed he needed built. The meeting's outcome was a decision to script...
ChatGPT-Desktop-Webview GUI app.
Is a Private ChatGPT Desktop Webview app made with QtWebView.
Features:
1. Private doesn't make any connections to Google, Mozilla, or Microsoft, Brave unless you login via Google etc..
2. Light Weight.
3. Page reloading can be done using a simple Right-click Reload if ChatGPT gets stuck/errors out.
4. Zoom in or out to configure text size.
5. Supports back button.
6. User-Agent is adjustable but not implemented by default see source code.
Compiled as a windows executable only using pyinstaller check releases or self compile.
You can Recommend extra features by opening a new issue on Github.
Github Repository Link
/r/Python
https://redd.it/10bijtd
Is a Private ChatGPT Desktop Webview app made with QtWebView.
Features:
1. Private doesn't make any connections to Google, Mozilla, or Microsoft, Brave unless you login via Google etc..
2. Light Weight.
3. Page reloading can be done using a simple Right-click Reload if ChatGPT gets stuck/errors out.
4. Zoom in or out to configure text size.
5. Supports back button.
6. User-Agent is adjustable but not implemented by default see source code.
Compiled as a windows executable only using pyinstaller check releases or self compile.
You can Recommend extra features by opening a new issue on Github.
Github Repository Link
/r/Python
https://redd.it/10bijtd
GitHub
GitHub - 7gxycn08/ChatGPT-Desktop-Webview: Private ChatGPT Desktop Webview app made with QtWebView.
Private ChatGPT Desktop Webview app made with QtWebView. - GitHub - 7gxycn08/ChatGPT-Desktop-Webview: Private ChatGPT Desktop Webview app made with QtWebView.
Is there an equivalent of npmtrends.com but for python packages?
I really like python but other than mouth(youtube) to ear package recommendations and the occasional stackoverflow or github find I have been really struggling to find both popular (that are not obvious) and well-maintained packages and also compare them to other packages.
On the other hand, npm have this amazing website called npmtends which allow comparisons of packages and deeper understanding of the echo system when combined with npm's search and some basic googling...
Is there such a website for python package? what's your routine for finding new packages that are interesting and may or may not be popular?
/r/Python
https://redd.it/10b75mh
I really like python but other than mouth(youtube) to ear package recommendations and the occasional stackoverflow or github find I have been really struggling to find both popular (that are not obvious) and well-maintained packages and also compare them to other packages.
On the other hand, npm have this amazing website called npmtends which allow comparisons of packages and deeper understanding of the echo system when combined with npm's search and some basic googling...
Is there such a website for python package? what's your routine for finding new packages that are interesting and may or may not be popular?
/r/Python
https://redd.it/10b75mh
Reddit
r/Python - Is there an equivalent of npmtrends.com but for python packages?
21 votes and 9 comments so far on Reddit