How can I enable connection pooling in Django REST Framework with PostgreSQL without using PgBouncer?
I do not want to use PgBouncer because there are no proper articles on how to enable it. Could you please share articles on how to do this without using PgBouncer
/r/django
https://redd.it/1du7h8k
I do not want to use PgBouncer because there are no proper articles on how to enable it. Could you please share articles on how to do this without using PgBouncer
/r/django
https://redd.it/1du7h8k
Reddit
From the django community on Reddit
Explore this post and more from the django community
Looking for Internship
Hello. I am a 2nd year student in Computer Science, and self learned in Django with proficiency in Django Authentication, CRUD, API Integration and Solid grasp on database management. I am looking for remote internship that will help me more to learn about backend web development. I can't find good internships to gain more skills. Everybody is mostly demanding for a last year student, also applied in Internshala but couldn't get any internship offer. kindly recommend me remote internships that will help me gain skills. And also recommend me if internship is helpful or not, and other tips to utilize my summers.
/r/djangolearning
https://redd.it/1dtlnfj
Hello. I am a 2nd year student in Computer Science, and self learned in Django with proficiency in Django Authentication, CRUD, API Integration and Solid grasp on database management. I am looking for remote internship that will help me more to learn about backend web development. I can't find good internships to gain more skills. Everybody is mostly demanding for a last year student, also applied in Internshala but couldn't get any internship offer. kindly recommend me remote internships that will help me gain skills. And also recommend me if internship is helpful or not, and other tips to utilize my summers.
/r/djangolearning
https://redd.it/1dtlnfj
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
Have 2 different Add User Pages in Django Admin
Is it possible to have 2 Different Add User Pages in Django Admin and have that info save to the same Custom User Model? What we want is to have another Add User Page that has different fields that the default Add User. so far, I managed to override the template and add a "Add Personnel Button", but it has not functionality as of yet.
Example we have 2 Users: User and Personnel
User have username, passwords + address and a File Upload Fields(required field).
Personnel only have the username, passwords + address fields
The default Add Button directs to the Add User page of User.
I want the Add Personnel Button to redirect me to an Add User Page to add Personnel Users. How can I do this?
https://preview.redd.it/hje0fm5kr9ad1.png?width=1856&format=png&auto=webp&s=49be6eed73c35d68e4884d61dfa116433a9a86f8
/r/django
https://redd.it/1du9xd7
Is it possible to have 2 Different Add User Pages in Django Admin and have that info save to the same Custom User Model? What we want is to have another Add User Page that has different fields that the default Add User. so far, I managed to override the template and add a "Add Personnel Button", but it has not functionality as of yet.
Example we have 2 Users: User and Personnel
User have username, passwords + address and a File Upload Fields(required field).
Personnel only have the username, passwords + address fields
The default Add Button directs to the Add User page of User.
I want the Add Personnel Button to redirect me to an Add User Page to add Personnel Users. How can I do this?
https://preview.redd.it/hje0fm5kr9ad1.png?width=1856&format=png&auto=webp&s=49be6eed73c35d68e4884d61dfa116433a9a86f8
/r/django
https://redd.it/1du9xd7
What change in Python 3.12 is so hard for deep learning frameworks to support?
I noticed that both Pytorch and Tensorflow don't support Python 3.12 yet. It's obviously not a big deal, but I'm curious. What changed in 3.12 that is so difficult to support? Should we expect this sort of n-1 issue at every point release?
/r/Python
https://redd.it/1du7myj
I noticed that both Pytorch and Tensorflow don't support Python 3.12 yet. It's obviously not a big deal, but I'm curious. What changed in 3.12 that is so difficult to support? Should we expect this sort of n-1 issue at every point release?
/r/Python
https://redd.it/1du7myj
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
How do you male sure you have a robust architecture for your App ?
Hey guys,
I managed to deploy an app on an EC2 instance with Cron jobs and a webhook. I know that the architecture is poor, this is why I am asking for pieces of advice to help me on deploying a solid architecture on AWS for an app that would need lot of syncs with third party APIs.
Thanks in advance for the help :)
/r/djangolearning
https://redd.it/1ducrkw
Hey guys,
I managed to deploy an app on an EC2 instance with Cron jobs and a webhook. I know that the architecture is poor, this is why I am asking for pieces of advice to help me on deploying a solid architecture on AWS for an app that would need lot of syncs with third party APIs.
Thanks in advance for the help :)
/r/djangolearning
https://redd.it/1ducrkw
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
I made a game it's a rouge like inspired by balatro
I made a game it's a rouge like inspired by balatro my target audience is balatro/rouge like gamers it is the first of its developers so fist Comparison or another edition. https://github.com/FurtiveThomas/FurtiveCards-v0.3.2 its the first public release.
/r/Python
https://redd.it/1duf1g2
I made a game it's a rouge like inspired by balatro my target audience is balatro/rouge like gamers it is the first of its developers so fist Comparison or another edition. https://github.com/FurtiveThomas/FurtiveCards-v0.3.2 its the first public release.
/r/Python
https://redd.it/1duf1g2
GitHub
GitHub - FurtiveThomas/FurtiveCards-v0.3.2: FurtiveCards is a rogue like deck builder inspired by balatro
FurtiveCards is a rogue like deck builder inspired by balatro - FurtiveThomas/FurtiveCards-v0.3.2
Difficult to decide on node vs django
Can someone please help me choosing one framework between these two?
Requirement:
- Must be highly scalable
- API should be fast working
- Should not take time for development
And please mention why to choose that framework.
/r/django
https://redd.it/1duhw4f
Can someone please help me choosing one framework between these two?
Requirement:
- Must be highly scalable
- API should be fast working
- Should not take time for development
And please mention why to choose that framework.
/r/django
https://redd.it/1duhw4f
Reddit
From the django community on Reddit
Explore this post and more from the django community
ecommerce characteristics side bar
So I am a beginner when it comes to Django and web development, and I need to make a sidebar containing characteristics to filter the products by characteristic (color, RAM, storage, ...). I have the characteristics stored as a JSON object, and I don't know how to make use of that (I am open to changing the storage method if needed). I use PostgreSQL for the DB. Any advice is appreciated, and if possible, please use simpler technical terms as English is not my first language.
here is refrence of an example from amazon that i want to follow.
as for the type of products, the website contains a wide range of products from tech stuff to perfumes and clothes.
/r/django
https://redd.it/1dujd8e
So I am a beginner when it comes to Django and web development, and I need to make a sidebar containing characteristics to filter the products by characteristic (color, RAM, storage, ...). I have the characteristics stored as a JSON object, and I don't know how to make use of that (I am open to changing the storage method if needed). I use PostgreSQL for the DB. Any advice is appreciated, and if possible, please use simpler technical terms as English is not my first language.
here is refrence of an example from amazon that i want to follow.
as for the type of products, the website contains a wide range of products from tech stuff to perfumes and clothes.
/r/django
https://redd.it/1dujd8e
Reddit
From the django community on Reddit
Explore this post and more from the django community
How to Visualize your Python Project’s Dependency Graph
https://www.gauge.sh/blog/how-to-visualize-your-python-projects-dependency-graph
/r/Python
https://redd.it/1dui8pr
https://www.gauge.sh/blog/how-to-visualize-your-python-projects-dependency-graph
/r/Python
https://redd.it/1dui8pr
www.gauge.sh
How to Visualize your Python Project’s Dependency Graph - Gauge - Solving the monolith/microservices dilemma
How to Visualize your Python Project’s Dependency Graph. Gauge is solving the monolith/microservices dilemma. We’re building tools to untangle codebases through incremental modularization. Our open-source toolkit supports defining and enforcing rules for…
Flask-Tenants: Contributors and testers wanted
Hello all!
Flask-Tenants is a subdomain-based event-driven multitenancy module that allows for custom tenant-scoped models, automatic schema switching, and more. The project is mostly functional with some small bugs here and there that are in the process of being patched. There are probably features that would be nice that I haven't thought of either.
You can access the GitHub here: https://github.com/Flask-Tenants/flask-tenants
There is a demo application to help you get started here: https://github.com/Flask-Tenants/demo\_app
If you don't want to help with writing code, there are many other ways you can contribute as well: testing, ideas, and documentation all come to mind, but there is probably more.
All help is appreciated for what is sure to be a popular module in the near future :).
/r/flask
https://redd.it/1dupjwa
Hello all!
Flask-Tenants is a subdomain-based event-driven multitenancy module that allows for custom tenant-scoped models, automatic schema switching, and more. The project is mostly functional with some small bugs here and there that are in the process of being patched. There are probably features that would be nice that I haven't thought of either.
You can access the GitHub here: https://github.com/Flask-Tenants/flask-tenants
There is a demo application to help you get started here: https://github.com/Flask-Tenants/demo\_app
If you don't want to help with writing code, there are many other ways you can contribute as well: testing, ideas, and documentation all come to mind, but there is probably more.
All help is appreciated for what is sure to be a popular module in the near future :).
/r/flask
https://redd.it/1dupjwa
GitHub
GitHub - Flask-Tenants/flask-tenants: Multitenancy solution using Flask, SQLAlchemy, and PostgreSQL. Please join our Discord server…
Multitenancy solution using Flask, SQLAlchemy, and PostgreSQL. Please join our Discord server at https://discord.gg/3AV2GkcB2Q. - Flask-Tenants/flask-tenants
Current practices for static(ish) high-traffic parts of django projects?
Hi, it's been many years since I did a lot of django, so excuse the ignorance. I am launching a site soon though, with a backend on Django (using the Pegasus SaaS boilerplate to be specific), and it has a reasonable chance of getting mentioned on high traffic channels, which could lead to bursts of drive-by traffic. I anticipate a lot of folks checking out the landing pages, watching the first minute of videos (hosted on youtube) and moving on. Some tiny percentage will actually sign up and use the app, moving into normal dynamic app territory.
Sooo... I'm wondering what the smart thing is these days to make the largely static pages as light as possible on the server. I could load balance to a static server, but I'd really prefer not to have to figure out some static site builder system in addition to Django. Maybe caching is enough? Maybe there is a way to render django pages to static content so I can reuse my templates?
For what it is worth, the current deployment plan is that the site runs from docker images on a VPS.
Any pointers to resources much appreciated! thanks
/r/django
https://redd.it/1duqbo2
Hi, it's been many years since I did a lot of django, so excuse the ignorance. I am launching a site soon though, with a backend on Django (using the Pegasus SaaS boilerplate to be specific), and it has a reasonable chance of getting mentioned on high traffic channels, which could lead to bursts of drive-by traffic. I anticipate a lot of folks checking out the landing pages, watching the first minute of videos (hosted on youtube) and moving on. Some tiny percentage will actually sign up and use the app, moving into normal dynamic app territory.
Sooo... I'm wondering what the smart thing is these days to make the largely static pages as light as possible on the server. I could load balance to a static server, but I'd really prefer not to have to figure out some static site builder system in addition to Django. Maybe caching is enough? Maybe there is a way to render django pages to static content so I can reuse my templates?
For what it is worth, the current deployment plan is that the site runs from docker images on a VPS.
Any pointers to resources much appreciated! thanks
/r/django
https://redd.it/1duqbo2
Reddit
From the django community on Reddit
Explore this post and more from the django community
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!
# Weekly Thread: Professional Use, Jobs, and Education 🏢
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
---
## How it Works:
1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.
---
## Guidelines:
- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.
---
## Example Topics:
1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?
---
Let's help each other grow in our careers and education. Happy discussing! 🌟
/r/Python
https://redd.it/1dut3lp
# Weekly Thread: Professional Use, Jobs, and Education 🏢
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
---
## How it Works:
1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.
---
## Guidelines:
- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.
---
## Example Topics:
1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?
---
Let's help each other grow in our careers and education. Happy discussing! 🌟
/r/Python
https://redd.it/1dut3lp
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Need help with s3 and django-storages
Hello everyone, this is my first time working with any cloud storage. I am following this tutorial here from Michael Herman, and there were a few discrepancies right from the beginning.
First, when I tried running the
botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
I looked up a bit, and apparently you have to set
So now my static files were being uploaded to the s3 bucket when I ran
But when I visited the webpages, the static images and stylesheets were not getting fetched as expected.
I tried many different things at this point, but none of them worked. I typed the s3 object url in the browser and this was the error I was getting:
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>419CX01JK1CAKYCS</RequestId>
<HostId>
rB7y8qLl5a5G0I1LVx2lexUbJpcvnrdKIMZ3AVq69C81B3j4BRWZwLq5THNLINwSv6q5HFSAednN1yq2tRCQ6THuxEn+S/Kj
</HostId>
</Error>
Now the next logical thing I did was to make all the bucket objects as public. The tutorial doesn't do this and I'm not sure if its a bad thing or not? Anyone
/r/djangolearning
https://redd.it/1dtndpn
Hello everyone, this is my first time working with any cloud storage. I am following this tutorial here from Michael Herman, and there were a few discrepancies right from the beginning.
First, when I tried running the
collectstatic command, I got this error:botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
I looked up a bit, and apparently you have to set
AWS_DEFAULT_ACL = None and doing that fixed it.So now my static files were being uploaded to the s3 bucket when I ran
collectstatic.But when I visited the webpages, the static images and stylesheets were not getting fetched as expected.
I tried many different things at this point, but none of them worked. I typed the s3 object url in the browser and this was the error I was getting:
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>419CX01JK1CAKYCS</RequestId>
<HostId>
rB7y8qLl5a5G0I1LVx2lexUbJpcvnrdKIMZ3AVq69C81B3j4BRWZwLq5THNLINwSv6q5HFSAednN1yq2tRCQ6THuxEn+S/Kj
</HostId>
</Error>
Now the next logical thing I did was to make all the bucket objects as public. The tutorial doesn't do this and I'm not sure if its a bad thing or not? Anyone
/r/djangolearning
https://redd.it/1dtndpn
testdriven.io
Storing Django Static and Media Files on Amazon S3
This tutorial shows how to configure Django to load and serve up static and media files, public and private, via an Amazon S3 bucket.
Question on how to avoid heavy queries
I’m building a Django app which is database intensive, I’d like to have reports (data similar to a database view) to avoid database load. What are the best practices ? Use Postgres views ? Create the report as a Django model ?
Pls guide me
/r/django
https://redd.it/1duuibx
I’m building a Django app which is database intensive, I’d like to have reports (data similar to a database view) to avoid database load. What are the best practices ? Use Postgres views ? Create the report as a Django model ?
Pls guide me
/r/django
https://redd.it/1duuibx
Reddit
From the django community on Reddit
Explore this post and more from the django community
Django + react , not integrating
Hey folks , i am making a web app using django and react . I have very well knowledge of django but not much in react . So i need a help of someone who has skills and experience in full stack of django and react .
Pls dm i am unable to integrate django and react , and deadline of project os near
/r/django
https://redd.it/1dv0kvc
Hey folks , i am making a web app using django and react . I have very well knowledge of django but not much in react . So i need a help of someone who has skills and experience in full stack of django and react .
Pls dm i am unable to integrate django and react , and deadline of project os near
/r/django
https://redd.it/1dv0kvc
Reddit
From the django community on Reddit
Explore this post and more from the django community
How to create thousands of records with factory boy?
# Issue
Let's say I'm running tests where I need to generate lots of data using factory\_boy and django orm like so:
class CompanyFactory(factory.Factory):
class Meta:
model = Company
name = factory.Faker('company')
email = factory.Faker('ascii_safe_email')
date_joined = factory.LazyFunction(datetime.datetime.now)
CompanyFacotry.create_batch(size=100_000)
**And this takes a lot of time to process.**
In the [factory\_boy docs](https://factoryboy.readthedocs.io/en/stable/reference.html#factory.CREATE_STRATEGY) it says, that \`create\_batch\` is using "create" strategy
I assume that it creates a bunch of save queries for each Company instance which impacts the performance.
# Solutions
* I found this factory\_boy [PR](https://github.com/FactoryBoy/factory_boy/pull/925) to implement a "true" bulk create. It has a lot of history and useful info on the subject but it seems to be stuck for now.
* There is [this article](https://www.rover.com/blog/engineering/post/speeding-django-test-runs-optimizing-factory-boy/) describing the solution which improves the performance but looks kinda hacky
* Also [this article](https://paul-grillenberger.de/2020/06/21/creating-test-data-with-faker-and-factory-boy/) besides describing basic faker/factory boy usage mentions this :
>The following method is appropriate for generating small- to medium-sized test
/r/django
https://redd.it/1dv0ubu
# Issue
Let's say I'm running tests where I need to generate lots of data using factory\_boy and django orm like so:
class CompanyFactory(factory.Factory):
class Meta:
model = Company
name = factory.Faker('company')
email = factory.Faker('ascii_safe_email')
date_joined = factory.LazyFunction(datetime.datetime.now)
CompanyFacotry.create_batch(size=100_000)
**And this takes a lot of time to process.**
In the [factory\_boy docs](https://factoryboy.readthedocs.io/en/stable/reference.html#factory.CREATE_STRATEGY) it says, that \`create\_batch\` is using "create" strategy
I assume that it creates a bunch of save queries for each Company instance which impacts the performance.
# Solutions
* I found this factory\_boy [PR](https://github.com/FactoryBoy/factory_boy/pull/925) to implement a "true" bulk create. It has a lot of history and useful info on the subject but it seems to be stuck for now.
* There is [this article](https://www.rover.com/blog/engineering/post/speeding-django-test-runs-optimizing-factory-boy/) describing the solution which improves the performance but looks kinda hacky
* Also [this article](https://paul-grillenberger.de/2020/06/21/creating-test-data-with-faker-and-factory-boy/) besides describing basic faker/factory boy usage mentions this :
>The following method is appropriate for generating small- to medium-sized test
/r/django
https://redd.it/1dv0ubu
Built with Flask
Hello developers 👋👋
I built scenestamps.com and readtxt.in with flask. You can check it out and share your feedback on it.
TechStack :
- for scenestamps.com : flask, sqlite, html,css, js, bootstrap, NGINX
- for readtxt.in : flask,html,css, bootstrap, NGINX
Both deployed on digital ocean droplet(OS : Ubuntu).
This pretty much became my go to stack for prototyping & deployment. Quite simple and efficient, nothing fancy.
Hope this serves as one among many real world apps built using Flask. Flask just works.
Have a nice day.
/r/flask
https://redd.it/1dv16gz
Hello developers 👋👋
I built scenestamps.com and readtxt.in with flask. You can check it out and share your feedback on it.
TechStack :
- for scenestamps.com : flask, sqlite, html,css, js, bootstrap, NGINX
- for readtxt.in : flask,html,css, bootstrap, NGINX
Both deployed on digital ocean droplet(OS : Ubuntu).
This pretty much became my go to stack for prototyping & deployment. Quite simple and efficient, nothing fancy.
Hope this serves as one among many real world apps built using Flask. Flask just works.
Have a nice day.
/r/flask
https://redd.it/1dv16gz
Scenestamps
Scenestamps - Your Cinephile Community
I am trying to create an email that when clicked on and the token is filled in the form turns `registration_confirmation_email` to True from the default to False. Also I noticed the token is always the same.
I am testing the code when I click the resent token button. The error is located below.
I am trying to create an email that when clicked on and the token is filled in the form turns `registration_confirmation_email` to `True` from the default to `False`. Also I noticed the token is always the same value
I am testing the code when I click the resent token button. The error is located below.
The error is https://pastebin.com/bG6SYJUp or put simply itsdangerous.exc.BadSignature: No b'.' found in value. How do I solve the same exact token in every email and the error?
Here is the code.
**registration_verification_code.html** (uses bootstrap)
`{% if user_db.emal_token == None %}`, should be `{% if user_db.emal_token != None %}`
https://pastebin.com/5QH3ab39
**_renderform.html** (uses bootstrap)**
https://pastebin.com/U4uruBAV
**models.py**
https://pastebin.com/2k0dsyjC
**routes.py**
https://pastebin.com/VLnAVP5B
I even created this images which run through some of what can go right and wrong when I click resend email button.
https://imgur.com/a/uuDXZ7b
Thank you to whoever helps in advance for the help.
/r/flask
https://redd.it/1duxze9
I am testing the code when I click the resent token button. The error is located below.
I am trying to create an email that when clicked on and the token is filled in the form turns `registration_confirmation_email` to `True` from the default to `False`. Also I noticed the token is always the same value
I am testing the code when I click the resent token button. The error is located below.
The error is https://pastebin.com/bG6SYJUp or put simply itsdangerous.exc.BadSignature: No b'.' found in value. How do I solve the same exact token in every email and the error?
Here is the code.
**registration_verification_code.html** (uses bootstrap)
`{% if user_db.emal_token == None %}`, should be `{% if user_db.emal_token != None %}`
https://pastebin.com/5QH3ab39
**_renderform.html** (uses bootstrap)**
https://pastebin.com/U4uruBAV
**models.py**
https://pastebin.com/2k0dsyjC
**routes.py**
https://pastebin.com/VLnAVP5B
I even created this images which run through some of what can go right and wrong when I click resend email button.
https://imgur.com/a/uuDXZ7b
Thank you to whoever helps in advance for the help.
/r/flask
https://redd.it/1duxze9
Pastebin
Traceback (most recent call last): File "C:\Users\user\OneDrive\Desktop\boots - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Which Python GUI Framework do you prefer?
I want to develop a desktop application. Since I want to use Python directly for many functions, I am looking for a good Python GUI framework. Please recommend the Python GUI framework you are using and why you recommend it.
* Tkinter
* PyQt/PySide
* Kivy
* wxPython
* Dear PyGui
* PyGTK
/r/Python
https://redd.it/1duzrky
I want to develop a desktop application. Since I want to use Python directly for many functions, I am looking for a good Python GUI framework. Please recommend the Python GUI framework you are using and why you recommend it.
* Tkinter
* PyQt/PySide
* Kivy
* wxPython
* Dear PyGui
* PyGTK
/r/Python
https://redd.it/1duzrky
Reddit
From the Python community on Reddit
Explore this post and more from the Python community