Proxy Model
I've a model "Approval" and its inherited model "ApprovalType" where i have put proxy = True. In the Approval model I've this "type":
so when I'm creating the entries in the model using
/r/django
https://redd.it/10blk9u
I've a model "Approval" and its inherited model "ApprovalType" where i have put proxy = True. In the Approval model I've this "type":
type = models.CharField(max_length=30)so when I'm creating the entries in the model using
Approval.objects.create() my manager has asked me to (call the proxy model) or (create) the entries without actually putting type="abc" in the create(). I don't know how to this. please help me out on this/r/django
https://redd.it/10blk9u
reddit
Proxy Model
I've a model "Approval" and its inherited model "ApprovalType" where i have put proxy = True. In the Approval model I've this "type": `type =...
Need to restart the Kernel frequently
Basically the title. The Kernel dies to frequently. Any solution?
/r/JupyterNotebooks
https://redd.it/10bk5sf
Basically the title. The Kernel dies to frequently. Any solution?
/r/JupyterNotebooks
https://redd.it/10bk5sf
reddit
Need to restart the Kernel frequently
Basically the title. The Kernel dies to frequently. Any solution?
Cannot figure out how to get dictionary values to show up on the page
I am very new to Django, so please be patient if this is something trivial. I have been trying to figure out a way to solve it for hours.
The problem:
I have a json file that looks something like this:
{
"Estonia": {
"dialcode": "+372",
"countrycode": "EE",
"emoji": "🇪🇪",
"imageurl": "https://www.flagpictures.com/static/images/flags/ee.png",
"flagcolors":
"Blue",
"Black",
"White"
},
"Eswatini": {
/r/django
https://redd.it/10caeh1
I am very new to Django, so please be patient if this is something trivial. I have been trying to figure out a way to solve it for hours.
The problem:
I have a json file that looks something like this:
{
"Estonia": {
"dialcode": "+372",
"countrycode": "EE",
"emoji": "🇪🇪",
"imageurl": "https://www.flagpictures.com/static/images/flags/ee.png",
"flagcolors":
"Blue",
"Black",
"White"
},
"Eswatini": {
/r/django
https://redd.it/10caeh1
API response time
After clean instalation of django and django-rest-framework simple APIView that returns one serialized objects {id:1,name:"test"} has response time around 45ms. While FastAPI response time is around 10ms.
Why is that?
/r/django
https://redd.it/10c566t
After clean instalation of django and django-rest-framework simple APIView that returns one serialized objects {id:1,name:"test"} has response time around 45ms. While FastAPI response time is around 10ms.
Why is that?
/r/django
https://redd.it/10c566t
reddit
API response time
After clean instalation of django and django-rest-framework simple APIView that returns one serialized objects {id:1,name:"test"} has response...
Is there an platform dedicated to deploy django application like laravel Forge ?
Hi,
I have been using django since many years now and i always wonder if there was a platform that could be use to deploy a django project without pain and followong the same process regardless of where it's deployed.
I mean if you deploy on AWS ECS the process is different than on Digital Ocean, even if you are using Docker. So I thought maybe there is a platform providing such service, so i can deploy any of my project and client's project very quicly and easily.
/r/django
https://redd.it/10avt4h
Hi,
I have been using django since many years now and i always wonder if there was a platform that could be use to deploy a django project without pain and followong the same process regardless of where it's deployed.
I mean if you deploy on AWS ECS the process is different than on Digital Ocean, even if you are using Docker. So I thought maybe there is a platform providing such service, so i can deploy any of my project and client's project very quicly and easily.
/r/django
https://redd.it/10avt4h
reddit
Is there an platform dedicated to deploy django application like...
Hi, I have been using django since many years now and i always wonder if there was a platform that could be use to deploy a django project...
A tutorial for class based views user registration with email verification?
/r/django
https://redd.it/10avecz
/r/django
https://redd.it/10avecz
reddit
A tutorial for class based views user registration with email...
Posted in r/django by u/KhZaym • 0 points and 3 comments
Django (Both in backend and frontend) or Django Rest Framework + React?
I would like to develop a website (like Zillow) by myself and I don't know if it would be easier to do it using only Django (with Django templates and vanilla Javascript for functionality and interactivity) or Django Rest Framework and React.
I have experience in React but I do not enjoy writing a separate backend and frontend. Also I don't like React that much. Is it possible, easier and better for only one dev to use only Django for a project like that?
/r/django
https://redd.it/10ai8h7
I would like to develop a website (like Zillow) by myself and I don't know if it would be easier to do it using only Django (with Django templates and vanilla Javascript for functionality and interactivity) or Django Rest Framework and React.
I have experience in React but I do not enjoy writing a separate backend and frontend. Also I don't like React that much. Is it possible, easier and better for only one dev to use only Django for a project like that?
/r/django
https://redd.it/10ai8h7
reddit
Django (Both in backend and frontend) or Django Rest Framework +...
I would like to develop a website (like Zillow) by myself and I don't know if it would be easier to do it using only Django (with Django ...
Django AWS S3 image files working locally but not in production
I'm creating a website with a blog that allows users to upload their own profile pictures, and this works locally. However, in deployment on OpenShift it returns an error ' The requested resource was not found on this server.'
​
My code in settings:
​
MEDIAROOT = os.path.join(BASEDIR, 'media')
MEDIAURL = '/media/'
AWSACCESSKEYID = 'xxx'
AWSSECRETACCESSKEY = 'xxx'
AWSSTORAGEBUCKETNAME = 'xxx'
AWSS3REGIONNAME = 'eu-west-2'
AWSS3ADDRESSINGSTYLE = "virtual"
AWSS3SIGNATUREVERSION = 's3v4'
AWSS3FILEOVERWRITE = False
AWSDEFAULTACL = None
DEFAULTFILESTORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
Locally, the link to an example image is: https://personal-portfolio-website-files.s3.amazonaws.com/profile\_pics/dog.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA5HK62K4UKN4EU6UQ%2F20230111%2Feu-west-2%2Fs3%2Faws4\_request&X-Amz-Date=20230111T120246Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=7ca52e78c5c266d18d24d4fc1bdb6ddb22267d06c09ba3eae1f6853fba7f1b91
​
Whereas on OpenShift, it's: http://personal-portfolio-web-personal-portfolio.apps.openshift.cs.cf.ac.uk/media/profile\_pics/dog.jpg
​
Does anyone know what's causing this?
I've tried changing all the permissions of my bucket to allow everything.
/r/django
https://redd.it/1093i83
I'm creating a website with a blog that allows users to upload their own profile pictures, and this works locally. However, in deployment on OpenShift it returns an error ' The requested resource was not found on this server.'
​
My code in settings:
​
MEDIAROOT = os.path.join(BASEDIR, 'media')
MEDIAURL = '/media/'
AWSACCESSKEYID = 'xxx'
AWSSECRETACCESSKEY = 'xxx'
AWSSTORAGEBUCKETNAME = 'xxx'
AWSS3REGIONNAME = 'eu-west-2'
AWSS3ADDRESSINGSTYLE = "virtual"
AWSS3SIGNATUREVERSION = 's3v4'
AWSS3FILEOVERWRITE = False
AWSDEFAULTACL = None
DEFAULTFILESTORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
Locally, the link to an example image is: https://personal-portfolio-website-files.s3.amazonaws.com/profile\_pics/dog.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA5HK62K4UKN4EU6UQ%2F20230111%2Feu-west-2%2Fs3%2Faws4\_request&X-Amz-Date=20230111T120246Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=7ca52e78c5c266d18d24d4fc1bdb6ddb22267d06c09ba3eae1f6853fba7f1b91
​
Whereas on OpenShift, it's: http://personal-portfolio-web-personal-portfolio.apps.openshift.cs.cf.ac.uk/media/profile\_pics/dog.jpg
​
Does anyone know what's causing this?
I've tried changing all the permissions of my bucket to allow everything.
/r/django
https://redd.it/1093i83
Django Knox login endpoint not working
I used files from "https://github.com/Omkar0231/Django-Login-API" with no change. But, the login request from Postman is resulting in error, "detail": "JSON parse error - Expecting value: line 1 column 1 (char 0)", while the terminal shows "Bad request...".
The source code developer in above git also explained it in a video, "https://www.youtube.com/watch?v=6d0fiPj0dsA", however, in video everything seems to be working as expected.
Whatever I understood from Googling, I thought that a bearer token is to be included in the login request as header. But I don't know where to find the bearer token in my Django app. However, in the video, the original author/developer did not include any such header token for the login request from Postman.
Please help me figure out the issue.
/r/django
https://redd.it/108yj85
I used files from "https://github.com/Omkar0231/Django-Login-API" with no change. But, the login request from Postman is resulting in error, "detail": "JSON parse error - Expecting value: line 1 column 1 (char 0)", while the terminal shows "Bad request...".
The source code developer in above git also explained it in a video, "https://www.youtube.com/watch?v=6d0fiPj0dsA", however, in video everything seems to be working as expected.
Whatever I understood from Googling, I thought that a bearer token is to be included in the login request as header. But I don't know where to find the bearer token in my Django app. However, in the video, the original author/developer did not include any such header token for the login request from Postman.
Please help me figure out the issue.
/r/django
https://redd.it/108yj85
GitHub
GitHub - Omkar0231/Django-Login-API
Contribute to Omkar0231/Django-Login-API development by creating an account on GitHub.
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/10c4t91
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/10c4t91
reddit
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...
What are people using to organize virtual environments these days?
Thinking multiple Python versions and packages
Is Anaconda still a go to? Are there any better options in circulation that I could look into?
/r/Python
https://redd.it/10bxkjp
Thinking multiple Python versions and packages
Is Anaconda still a go to? Are there any better options in circulation that I could look into?
/r/Python
https://redd.it/10bxkjp
reddit
What are people using to organize virtual environments these days?
Thinking multiple Python versions and packages Is Anaconda still a go to? Are there any better options in circulation that I could look into?
Total beginner - Could Python be interesting for sales?
Hi there kind Python people.
Thank you for taking the time to read my question! It might be different to what normally gets posted in this sub. It's not about programming, but about career choices.
I am a 28 year old with a masters degree in Communication Sciences. Ever since finishing my studies I have been very interested in programming, AI, big data... Yet for the last years I preferred a life of travelling around and parties instead of really sharpening my skills. The time has really come for me to dedicate myself. I have taken up routines and discipline, and I have an ambitious mindset.
At this moment I am about to start a sales job (wholesale in medical disposables) in a very small but growth-oriented company. It is far from my dream job, but I want to view this as a very important step on my ladder. I want to learn a lot.
I believe there would be an awful lot to learn before it even could become useful, but as far as I understand what this language does it could come in handy for creating and managing databases of (potential) customers, sales histories, keeping track of inventory
/r/Python
https://redd.it/10c4o15
Hi there kind Python people.
Thank you for taking the time to read my question! It might be different to what normally gets posted in this sub. It's not about programming, but about career choices.
I am a 28 year old with a masters degree in Communication Sciences. Ever since finishing my studies I have been very interested in programming, AI, big data... Yet for the last years I preferred a life of travelling around and parties instead of really sharpening my skills. The time has really come for me to dedicate myself. I have taken up routines and discipline, and I have an ambitious mindset.
At this moment I am about to start a sales job (wholesale in medical disposables) in a very small but growth-oriented company. It is far from my dream job, but I want to view this as a very important step on my ladder. I want to learn a lot.
I believe there would be an awful lot to learn before it even could become useful, but as far as I understand what this language does it could come in handy for creating and managing databases of (potential) customers, sales histories, keeping track of inventory
/r/Python
https://redd.it/10c4o15
reddit
Total beginner - Could Python be interesting for sales?
Hi there kind Python people. Thank you for taking the time to read my question! It might be different to what normally gets posted in this sub....
Check out AWESOME PANEL SHARING - An easy to use sharing service for Panel data apps
In 2022 Pyodide and PyScript paved the way for Python in the Browser. On top of that, the data app framework Panel made it easy to panel convert your data app to run in the browser only.
On top of that I created AWESOME PANEL SHARING that is a easy to use sharing service for Panel data apps.
Check out the growing Gallery of inspirational examples.
Awesome Panel Sharing Gallery
Or share your data app with the world.
https://reddit.com/link/10cbt17/video/caafvw9595ca1/player
/r/Python
https://redd.it/10cbt17
In 2022 Pyodide and PyScript paved the way for Python in the Browser. On top of that, the data app framework Panel made it easy to panel convert your data app to run in the browser only.
On top of that I created AWESOME PANEL SHARING that is a easy to use sharing service for Panel data apps.
Check out the growing Gallery of inspirational examples.
Awesome Panel Sharing Gallery
Or share your data app with the world.
https://reddit.com/link/10cbt17/video/caafvw9595ca1/player
/r/Python
https://redd.it/10cbt17
GitHub
GitHub - holoviz/panel: Panel: The powerful data exploration & web app framework for Python
Panel: The powerful data exploration & web app framework for Python - holoviz/panel
(Maybe) Everything You'll Ever Need to Know about Python Imports and Project Structure
It isn’t that hard, but it is a well-kept secret. And for good reason. I’ve had a draft of this article in my head for months, but it wasn’t until I started using Poetry that I found a method I could explain in a two-minute read.
(Maybe) Everything You'll Ever Need to Know About Python Imports and Project Structure (foundationsafety.com)
/r/Python
https://redd.it/10c49jo
It isn’t that hard, but it is a well-kept secret. And for good reason. I’ve had a draft of this article in my head for months, but it wasn’t until I started using Poetry that I found a method I could explain in a two-minute read.
(Maybe) Everything You'll Ever Need to Know About Python Imports and Project Structure (foundationsafety.com)
/r/Python
https://redd.it/10c49jo
Foundation Safety
(Maybe) Everything You'll Ever Need to Know About Python Imports and Project Structure
Trade - Multipurpose Business & Corporate Jekyll Template Jekyll Theme For Mobile Apps Download Landing Page And Blogging.
Web based GUI Application
I know that this question has been asked by many so Please bear me.
What is the best way to go about making web based GUIs using Python as backend ?
I don’t know anything about HTML CSS or JavaScript.
If you can suggest any designer tool that will be helpful Thanks
/r/flask
https://redd.it/10cfufj
I know that this question has been asked by many so Please bear me.
What is the best way to go about making web based GUIs using Python as backend ?
I don’t know anything about HTML CSS or JavaScript.
If you can suggest any designer tool that will be helpful Thanks
/r/flask
https://redd.it/10cfufj
reddit
Web based GUI Application
I know that this question has been asked by many so Please bear me. What is the best way to go about making web based GUIs using Python as backend...
Discord Bot pretending to be human using Chat GPT
Python script for a Discord bot that uses Chat GPT to generate responses for a conversation between multiple discord users.
The bot can converse in a conversation distinguishing between different people and responding like a friendly discord user. It understands the distinction between being involved in conversation and not being included.
These features only partially work, with the bot easily being able to be taken out of the immersion of being a "discord user". However, it was an interesting experiment to test the limits of GPT using the limited functionality we're currently available to. I believe it would definitely be possible to make a very convincing human! Hopefully API for Chat GPT will be released in the near future.
GitHub Link: https://github.com/karkin2002/Chat-GPT-Discord-Bot
Example conversations:
https://preview.redd.it/zk7ap6a9i7ca1.png?width=2085&format=png&auto=webp&v=enabled&s=a6d975e72e22323e115b19ad25a4da9d8b1004c6
https://preview.redd.it/dmdhmrpfi7ca1.png?width=2048&format=png&auto=webp&v=enabled&s=24102d01745ef3bfa3704e32750b5a9cfa3d216b
https://preview.redd.it/kqypicfvi7ca1.png?width=1657&format=png&auto=webp&v=enabled&s=5eb908593aa8b2a5b93e029bb46bd9756c8fd0d4
Example of distinguishing between being in conversation and not. For this test I made the bot respond with "N/A" if it thought it wasn't included in the conversation ("Friend" is the Discord bots name, "Kiwi" is another users name):
https://preview.redd.it/4sxdyhkuh7ca1.png?width=1116&format=png&auto=webp&v=enabled&s=91ba5271894d387b9d1d0bd941b7133fba562906
/r/Python
https://redd.it/10cjm62
Python script for a Discord bot that uses Chat GPT to generate responses for a conversation between multiple discord users.
The bot can converse in a conversation distinguishing between different people and responding like a friendly discord user. It understands the distinction between being involved in conversation and not being included.
These features only partially work, with the bot easily being able to be taken out of the immersion of being a "discord user". However, it was an interesting experiment to test the limits of GPT using the limited functionality we're currently available to. I believe it would definitely be possible to make a very convincing human! Hopefully API for Chat GPT will be released in the near future.
GitHub Link: https://github.com/karkin2002/Chat-GPT-Discord-Bot
Example conversations:
https://preview.redd.it/zk7ap6a9i7ca1.png?width=2085&format=png&auto=webp&v=enabled&s=a6d975e72e22323e115b19ad25a4da9d8b1004c6
https://preview.redd.it/dmdhmrpfi7ca1.png?width=2048&format=png&auto=webp&v=enabled&s=24102d01745ef3bfa3704e32750b5a9cfa3d216b
https://preview.redd.it/kqypicfvi7ca1.png?width=1657&format=png&auto=webp&v=enabled&s=5eb908593aa8b2a5b93e029bb46bd9756c8fd0d4
Example of distinguishing between being in conversation and not. For this test I made the bot respond with "N/A" if it thought it wasn't included in the conversation ("Friend" is the Discord bots name, "Kiwi" is another users name):
https://preview.redd.it/4sxdyhkuh7ca1.png?width=1116&format=png&auto=webp&v=enabled&s=91ba5271894d387b9d1d0bd941b7133fba562906
/r/Python
https://redd.it/10cjm62
GitHub
GitHub - karkin2002/Chat-GPT-Discord-Bot: This is a simple discord bot that tries to pretend to be a human!
This is a simple discord bot that tries to pretend to be a human! - karkin2002/Chat-GPT-Discord-Bot
Activities to keep in touch with python programming
Hello Everyone, I am a working professional(chip designer), I just finished the python course (Udemy) and gained fair knowledge. I have already used the knowledge gained to automate some of the reports review in the current company and have also started doing few simple projects for university students. Could you guys please suggest me some activities/habits to keep in touch with the python programing and explore much more? . Appreciate the help in advance.
/r/Python
https://redd.it/10chz9y
Hello Everyone, I am a working professional(chip designer), I just finished the python course (Udemy) and gained fair knowledge. I have already used the knowledge gained to automate some of the reports review in the current company and have also started doing few simple projects for university students. Could you guys please suggest me some activities/habits to keep in touch with the python programing and explore much more? . Appreciate the help in advance.
/r/Python
https://redd.it/10chz9y
reddit
Activities to keep in touch with python programming
Hello Everyone, I am a working professional(chip designer), I just finished the python course (Udemy) and gained fair knowledge. I have already...
Yellowpage scraper powered by Python
Hey everyone,
I've been working on a web scraping project using Python to extract data from YellowPage and I wanted to share my experience and some tips for anyone else looking to do the same.
First, I used the popular library BeautifulSoup and Playwright to navigate and automate the website. The script asks user to enter a business name, location and number of pages to scrape and save it into an excel database accordingly. It extracts all the necessary data including emails as well. I feel I used lots of try and except clause, if someone has better approach them please free to share.
Another thing to watch out for is that the website structure can change frequently, so it's important to regularly check and update your code accordingly.
Overall, it was a fun and challenging project that taught me a lot about web scraping and working with dynamic websites.
Let me know if you have any questions or tips of your own to share!
/r/Python
https://redd.it/10cc17r
Hey everyone,
I've been working on a web scraping project using Python to extract data from YellowPage and I wanted to share my experience and some tips for anyone else looking to do the same.
First, I used the popular library BeautifulSoup and Playwright to navigate and automate the website. The script asks user to enter a business name, location and number of pages to scrape and save it into an excel database accordingly. It extracts all the necessary data including emails as well. I feel I used lots of try and except clause, if someone has better approach them please free to share.
Another thing to watch out for is that the website structure can change frequently, so it's important to regularly check and update your code accordingly.
Overall, it was a fun and challenging project that taught me a lot about web scraping and working with dynamic websites.
Let me know if you have any questions or tips of your own to share!
/r/Python
https://redd.it/10cc17r
GitHub
GitHub - sushil-rgb/YellowPage-scraper: A YellowPage scraper is a Python program/script that extracts data from the YellowPages.com…
A YellowPage scraper is a Python program/script that extracts data from the YellowPages.com website using the Python programming language. The scraper can be used to gather information such as busi...
How to Create a Face Recognition Using Python
https://techzpad.com/face-recognition-using-python
/r/Python
https://redd.it/10ccwe2
https://techzpad.com/face-recognition-using-python
/r/Python
https://redd.it/10ccwe2
TechzPad
How to Create a Face Recognition Using Python
Face recognition using python is a technique of identifying or verifying the identity of an individual using their face. There are numerous algorithms that
send a list of ids using ajax
i am trying to send a list of ids which are collected from the selected checkboxes in django template to django views using ajax as below,but doesn't seems to work.what could be wrong.i suspect the url part.
<script>
$(document).ready(function(){
$('.bulk_delete').click(function(){
if(confirm("Sure you want to delete?")){
var id=[];
var csrf=$('input[name=csrfmiddlewaretoken]').val();
$(':checkbox:checked').each(function(i){
id[i]=$(this).val()
})
/r/djangolearning
https://redd.it/10cfl7m
i am trying to send a list of ids which are collected from the selected checkboxes in django template to django views using ajax as below,but doesn't seems to work.what could be wrong.i suspect the url part.
<script>
$(document).ready(function(){
$('.bulk_delete').click(function(){
if(confirm("Sure you want to delete?")){
var id=[];
var csrf=$('input[name=csrfmiddlewaretoken]').val();
$(':checkbox:checked').each(function(i){
id[i]=$(this).val()
})
/r/djangolearning
https://redd.it/10cfl7m
reddit
send a list of ids using ajax
i am trying to send a list of ids which are collected from the selected checkboxes in django template to django views using ajax as below,but...