Andrew
Hi guys a general question, for image uploads, what is the purpose of using a service like AWS S3 or Cloudinary? Why not just store everything along with the deployment stuff on the digital ocean/linode droplet? Are there any advantages of using S3 or Cloudinary? Because I see the droplets aren’t too expensive, but Cloudinary and S3 charge quite abit for storage costs. Is there any advantage? Thank you!
Ashish
1. S3 is much cheaper than a droplet. $0.023 per GB. You could probably use the free tier too. 2. You want your droplet to not be file heavy with static files and slow down. 3. Static files need to be publicly accessible. So, from a security perspective too, it's better to have static files elsewhere, ideally on a storage volume like S3. It will depend on how many static files your application is going to generate.
Andrew
Thank you Ashish, understood on point 1 and 3. 🙏 However for point 2, does having many user media files slow down the app? I wonder if there is a way to index them.. 🤔
Andrew
I do believe this was the much older way to do it.. before S3 and GCP came into the picture.. many of the websites worked well even then… I have been thinking for the longest time what’s the real benefit S3/GCP blob storage brings. Unless maybe serverless or without any server disk space..
Illiyas
Google Analytics API returning only 10 rows
Doragonsureiyā
Google Analytics API returning only 10 rows
Read the rules before any activity: @PythonRules
Andrey
You should read the django documentation.
hello!I Ireaded documentation about migration оperations. I understand now
Ashish
If you are serving a lot of static files from the same server and the server is also handling django processes at the same time, it can cause extra load and slow down the server response
Andrew
So, a lot depends on how big your server is and how much storage you have. How many files you will be serving and what kind of processes you'll be running.
Thanks so much Ashish, yeah for a mid level app it should be sufficient. Also if it’s too slow can always migrate to S3 or other blob storage provider..
Владислав
Hello Everyone, me need Help, make Monitoring for Asic Miners on Django (this web-app), and ran into trouble. Need make Chart in my Dashboard (Time Series).
NightE
In the control page I want to show customers' orders and their address details here is the view def customers_orders(request): order= Order.objects.all() checkout_detail= CheckoutDetails.objects.all() return render(request, 'core/customers_orders.html', { 'order':order, 'checkout_detail':checkout_detail, }) the problem is I can't access the checkout details for a user based on their id I did this in the html page {% for detail in checkout_detail %} <p>{{detail.phone}}</p> <p>{{detail.city}}</p> <p>{{detail.country}}</p> <p>{{detail.address}}</p> <p>{{detail.specific_address}}</p> {%endfor%} but this repeats same info many times I want to display the address of the user only in its section
NightE
and here is the model class CheckoutDetails(models.Model): user= models.ForeignKey(User,on_delete=models.CASCADE, null=True) phone= models.CharField(max_length= 12) country= models.CharField(max_length=30) city= models.CharField(max_length=30) address= models.CharField(max_length=200) specific_address= models.CharField(max_length=200) def __str__(self): return self.user.username
Rohit
try passing the data in body as json format
NightE
you can filter out the CheckoutDetails for current logged in user using CheckoutDetails.objects.filter(user=request.user).
But I want to show all users not only requested user This page should be the admin panel And I have already tried this code but it wasn't working properly
Luis
On settings, allowed hosts if I'm serving from a local network computer, should I put my public ip address?
Bhaghi
TypeError: Field.init() got an unexpected keyword argument 'attrs'
Kian
hi Guys in my django project, my HTML file avatar converted to to django avatar and my html snippet dosn't work ! do U know what is my problem and what should i do ?
S
On settings, allowed hosts if I'm serving from a local network computer, should I put my public ip address?
In a private lan network.put ur pcs ip..... And cmd. runserver. 0.0.0.0:8000/or any port of ur choice
S
runsever 0.0.0.0:8000
S
Okey...was telling about development mode.
Nαψαภ
Hi All, I am trying to create a chat room(named TEAM) having 4 members and when I broadcast a message it should be received by all the 4, using django channels My question here is if any 1 of 4 is not connected through websocket (not active on that TEAM group) and someone sent a message which is supposed to receive by all in TEAM group , how the left one get that message as soon as he connects the TEAM group.
Thealy
Hello everyone, I am trying to conduct a function in the django that we can add point in the leaflet map and it shows the pop-up as administrative locations of commune, district, and province. However, I am struggle on how to show the outputs result into the map. Please assist me on this. Thank You!
Thealy
Use Google maps
Thank you but they don’t require paid service as Google api
—-
Good day everyone . I’m having issues generating token.I’m using obtain_auth_token but when I use postman to test, it keeps saying username and pass required. Even though I’m entering the correct details
Elhem
hello i need help how can i create a permission role in rest framework django ? I create 3 role admin(add,view,put,delete) customer(view) employe(put,view)
Anonymous
How do I convert a django project to an exe
Of course
Hi, İ download a template and i created a view and form class for that but when İ try to send message İ give a error in template.👇👇👇 Sorry undefined, it seems that our mail server not responding. Please try again later.
S
Hello, does anyone here know how to insert html and css with the Django template?
ASKAR
Hello, does anyone here know how to insert html and css with the Django template?
html itself will be the template, and you can link css files using static keyword
ShuvamTheBeast
Can anybody tell me what would Restricted outbound internet access would mean? I created a small project for my university syllabus, and i want to host it somewhere so i thought of pythonanywhere they say for free accounts there is restricted outbound internet access, but idk what that means
Zunair
Hi everyone! I will create a dashboard in which I want to add payment methods but I stuck there because I don't working on payment API'S before anyone can give me any reference?
Prog Hisham
Hey guys, What is the best tutorial or website to fully understand the secret and public key and RSA Encryption and decryption in Django Because I have a use case where I want to create a secret and public key to encrypt the user data and then decrypt it by a specific user when the main user grant it But I don't know how to do that even though I searched a lot in this topic, but I didn't find good resources
Suren
Hi guys, please help me to figure out how to display images which are related only to specific tour page. ### Models class Picture(models.Model): tour = models.ForeignKey(Tours, on_delete=models.CASCADE, related_name='pictures') picture = models.ImageField(upload_to="pictures/%Y/%m/%d/") ### Views tours = Tours.objects.all() for tour in tours: pictures = Picture.objects.filter(tour=tour.pk) context['pictures'] = pictures ### HTML {% for p in pictures %} <div class="gallery-syncing-item__nav__item"> <img src="{{ p.picture.url }}" alt="gall-syn1"> </div> {% endfor %} I have three tours published and everywhere I have different picture, but on each tour page it shows me the same last 6 pictures
Rupesh
How to join two (table)models in django?
Charly
How to join two (table)models in django?
You dont join them, you add relationships in your models (foreign keys, manytomany, etc)
ShuvamTheBeast
How to join two (table)models in django?
Using foreign key or many to many fiels
Charly
Please share example
You sould go to the official tutorial before trying to do apps like that, everything is on the documentation
Charly
https://docs.djangoproject.com/en/4.0/topics/db/examples/
ShuvamTheBeast
Please share example
See example app on official site.
Jay
Can anyone help me with overriding allauth signupview.I want to add group to the user
Doragonsureiyā
Can anyone help me with overriding allauth signupview.I want to add group to the user
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Vikas
Django.core.exceptions. import configured the secretkey settings must not be empty???
Vikas
Please help
Vikas
Already generate key and paste it but not resolve ???
Vikas
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
Jay
def get(self,request): group = Group.objects.get(name="Customer") usr = request.user print(usr.groups) if usr.groups is None: usr.groups.add(group) usr.save() return render(request,self.template_name)
Jay
program is not going in if condition
Dave
program is not going in if condition
Have you checked of what does usr.groups returns?
Dave
Have you checked of what does usr.groups returns?
Also if you are mutate or adding data. Its much better if you use post method.
Hell
hello guys, there is a function that takes all the lines that are described in the form.py and checks if there have been changes in them, after which it displays the old and new value. but the problem is that I don't need to take all the lines, because if I send only 3 lines and there are 15 of them in the form, then I get a keyerror. please tell me how to correctly transfer exactly those lines that the user edited, that is, which he sent (post) the call in this line happens: diff = diff_with_form(form, Contract.objects.get(pk=contract_id)) check function: diff_with_form code - https://linkode.org/#wUJbdJWa9XVIqvkYtkCUh5
Nivas
How to convert django project to exe file
Mirco
@
Hi y'all I just finished my first Django Application.. Kindly check out🤲 http://chatllify.herokuapp.com https://github.com/shurlz/chatllify
Ogunbo
Please how do I enable https in the development server?
Sayidbek
Hi y'all I just finished my first Django Application.. Kindly check out🤲 http://chatllify.herokuapp.com https://github.com/shurlz/chatllify
Great, but not working, ProgrammingError at /signup/ permission denied for table auth_user Request Method:POSTRequest URL:http://chatllify.herokuapp.com/signup/
Ivan
Does anyone know how to add a class to CKEditorUploadingWidget?
The Inspired
Already generate key and paste it but not resolve ???
Is the key supposed to be a String? Have you put it inside quotes?
The Inspired
Does anyone know how to add a class to CKEditorUploadingWidget?
use the 'attrs' dictionary. search the docs for it
The Inspired
hi Guys in my django project, my HTML file avatar converted to to django avatar and my html snippet dosn't work ! do U know what is my problem and what should i do ?
search for 'file associations' in vscode settings and add the following line: key = django-html value = html
The Inspired
import datetime from django.db import models from django.utils import timezone class Question(models.Model): # ... def was_published_recently(self): return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
this is from the 'testing' part of the docs.. Basically, the 'was_published_recently' function returns true if a question was published, say 2 days ago... but it also returns true if a question was published 2 days in the future (day after tomorrow). We don't want that. so, to fix that, we take the difference of the day when the question was published and the no. of days passed since it was published.
Sayidbek
I've worked on it thanks boss❤️
welcome, I see it's working now.