Qwerty
It's a bad practice.
Suryo Adhy Chandra
charly is it possible to put an image in the database from the backend in django
maybe better to store the image link, and save the image into image bucket.
Dj - 505
I think you can use only one db in render free plan
Yes , so i am using 2 projects on one database, is there any one doing like me and all his projects worked well on one database ?!
Mr. Developer
Hello Developers, I need one help please Page not found (404) Request Method: GET Request URL: http://localhost:8000/ Using the URLconf defined in crudproject1.urls, Django tried these URL patterns, in this order: admin/ [name='addandshow'] The empty path didn’t match any of these. my code `` from enroll import views urlpatterns = [ path('admin/', admin.site.urls), path(' ', views.add_show, name="addandshow"), ] def add_show(request): return render(request, 'enroll/addandshow.html') I'm new in django
dosya
Hey! On my windows computer, i open windows shell, and after 4 seconds it is automatically disappearing. Could you please assist?
Nushh
Hello everyone! If anybody could help me , pls do. My css and js files are not reflecting on my django project even after linking it correctly.
Nushh
Show the code
Code where I've attached my files?
Nushh
<link rel="stylesheet" type="text/css" href="{% static '../../firstpage/static/sayanaocr.css' %}">
Maxim
Hello, I am working on a small app, where anonymous users will be booking appointments to the office365 calendar of the app subscriber. The front end uses rest_framework_simplejwt authentication.JWTAuthentication for Authentication for Subscribers, but what is the best approach to store tokens for anonymous users? I do need to store OAuth token to pass it to the end point, should it be done via custom payload ?
Azhan
Have you added {% load static %}
Nushh
Have you added {% load static %}
Where should I add this?
Azhan
At the top of html file
Azhan
Above doctype
Nushh
Okay
Azhan
If still not working show me your file structure
Nushh
Okay
Nushh
If still not working show me your file structure
I'll get back to you in some time
Azhan
Okay
Dj - 505
If i did web application django project and deployed it on free hos , how can get vistors to check and evaluate our work? The programmer need real users to discover his project and evaluate it ..?
Rose
User Benso has 1/3 warnings; be careful! Reason: useless "hello"
..
When can I learn video tutorials on django channels step by step.
Estomihi
I have installed Tailwind CSS on my Django project. However, after the installation, I observed that the admin page does not have the proper CSS and JavaScript settings as default. Does anyone have a similar experience or know a solution to this problem?
Rose
May I help you?
Please don't send useless messages (Rule #3).
Rose
User Rajat has 1/3 warnings; be careful! Reason: totally offtopic
Haleem
I couldn't able to send email from godaddy professional email.. BUt its working fine with gmail smtp connection.. can you check if the below is ok please BASE_URL = 'http://localhost:8000' EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtpout.secureserver.net' EMAIL_PORT = 465 # GoDaddy SMTP port EMAIL_USE_SSL = True # Use SSL for secure connection EMAIL_HOST_USER = 'support@website.com' # Your GoDaddy email address EMAIL_HOST_PASSWORD = 'mypassword' # Your GoDaddy email account password
Anonymous
Can you share the error
Haleem
I am not getting any error.. but mail not going.. its working fine if i use gmail authentication
Anonymous
Is that email configuration in GoDaddy is working fine... ? Is there any way to send test mails through GoDaddy... ?
Haleem
Is that email configuration in GoDaddy is working fine... ? Is there any way to send test mails through GoDaddy... ?
i can send emali from my godaddy account directly.. when I am using the configuation in django,it cannot be send..
Haleem
its working now if i use DEFAULT_FROM_EMAIL... is it compulsery ?
Rose
User PEMIDI has 1/3 warnings; be careful! Reason: contextless link
Mirco
Move to @python
Rose
User Arrav has 1/3 warnings; be careful! Reason: totally offtopic to DJANGO
Shawna
anyone can explain to me the danger of setting null=True why they don't recommend it and if so why it exist i have set one field in model null=true because this field is optional is there a security issue i should be aware of ?
Shawna
null = True isn't a problem but it introduces an edge case of handling the null field, all your future queries should consider null cases.
what does this means "all your future queries should consider null cases" and than you for your answer
Shawna
meaning in serializer i should be able to assign allow_null=true
Shawna
and if i don't then the field must be passed
Shawna
all your future queries should consider null cases, literally
im kinda new to django plz don't mind my question if seems stupid
Alex
what does this means "all your future queries should consider null cases" and than you for your answer
alright, here is an example imagine you made email null=True, and now you want to implement a forgot password option that sends a password reset email to the user email, while implementing this you have to query the user email and here you have to write a case handler for users who haven't provided email.
Maxim
im kinda new to django plz don't mind my question if seems stupid
for example, if this field is a reference field, a filter that selects non-null values will have to be added to queries that access the reference
Alex
i kinda start understanding like if user can create account with email or phone number as one input then both must be null=true
see you introduced an edge case here, if you make both null for your email "or" phone number case, the user might give neither the email nor number resulting in locking themself out if he/she forget the password.
Ibnu
ImportError: cannot import name 'ContentType' from 'uniclass.models' how to solve this?
Ibnu
its in admin.py and eventhough its in installed app, its showing me this when i make migrations
Amir
Can I learn django best site !
Maxim
move means delete here
Rose
User Murodulla has 1/3 warnings; be careful! Reason: contextless offtopic link
Husen
Hello everyone, I need to make a model that does soft delete user register but can't login, please guide me.
M R. WICK
I want to add courier api with my django e commerce website please help me out
Ammar
Hello everyone, I need to make a model that does soft delete user register but can't login, please guide me.
If you are using the base user that come with django you can set is_active attribute to false so the user will remain in the db but won't be able to login
Tushar
In anchor tag how I get the name of anchor tag in django view
Tushar
When I hit the anchor tag then how can I know which anchor button clicked in view
Charly
When I hit the anchor tag then how can I know which anchor button clicked in view
Anchor tags clicks do not send requests to backend, you can't do that
Rose
Can I learn django best site !
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial (https://docs.djangoproject.com/en/dev/intro/tutorial01/) * Tutorial from MDN (https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django) * Tutorial from django-girls (https://tutorial.djangogirls.org/en/)
Maxim
the test says something's wrong it doesn't tell you how to fix it, that's for the programmer to know
салли
class Delivery(models.Model): order_id = models.ForeignKey(Order, on_delete=models.PROTECT, related_name='delivery') address = models.CharField(max_length=120) latitude = models.FloatField(blank=False, null=False) longitude = models.FloatField(blank=False, null=False) status = models.CharField(max_length=10, blank=False, null=False, choices=( ('searching', 'Searching'), ('in-process', 'In-process'), ('delivering', 'Delivering'), ('delivered', 'Delivered'), ('canceled', 'Canceled') ), default='searching') amount = models.FloatField(max_length=6) courier = models.ForeignKey(Courier, on_delete=models.SET_NULL, null=True) started_at = models.DateTimeField(auto_now_add=True) completed_at = models.DateTimeField(null=True, blank=True) def __str__(self): return f'{self.order_id} - {self.status}' def save(self, *args, **kwargs): from .kafka.sender import send_delivery_to_tg super().save(*args, **kwargs) send_delivery_to_tg(self) Can some1 explain me why edit page of this model in django admin panel loading for 10 secs??
TonFutures 💎
Hi everyone I have a question What is diffrent between RestFramework and Views? I think they same Example : return JsonResponse({'status' :200}) So i think this is a API 😐
Victor
https://docs.djangoproject.com/en/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.autocomplete_fields
Alex
i have this try catch block but valueError is giving me -- ContentNotRenderedError at /api/edda/status/ The response content must be rendered before it can be iterated over.
Alex
try: date = parse_date(date_param) if date: return queryset.filter(created_at__gte=date) except ValueError: return Response( {'error': _( 'Invalid date format. Please provide the date in YYYY-MM-DD format.')}, status=status.HTTP_400_BAD_REQUEST )
Alex
I am getting ContentNotRenderedError
Alex
the issue is at except ValueError is there another way of printing it? I have tried JsonResponse it's still giving an error , i want it when it reaches this stage give a response that says invalid date format