B120034_Mohammad Asim Khan
Sumit
newuser.name = yourname remove this
Sumit
default user model doesn''t have anyy field like name
Sumit
there is first_name and last_name
Sumit
use that
B120034_Mohammad Asim Khan
Ohhh
B120034_Mohammad Asim Khan
Learn django first
I am learning Django through codewithharry and got this through his video only
B120034_Mohammad Asim Khan
Okay let's not be unprofessional here
John
Heyy guys can anyone help me how to do a dependent drop down in admin panel
𝕯aniel
𝕯aniel
Category > sub category > sub category
John
Yaaa in my case just category and sub category
John
But I need it in the admin panel
𝕯aniel
After in this folder u can see base index and so on html files
𝕯aniel
Pandit
Pandit
https://dpaste.org/q9UD
in the last section there is all the module for loader
𝕯aniel
Why u use loader? You can render ur html page
𝕯aniel
And via context send data to page
Pandit
𝕯aniel
urls
path('', views.index, name='index')
Pandit
𝕯aniel
𝕯aniel
When you join to 127.0.0.1:8000
Pandit
No this ur routing
any video where it is explained!!
i get confused when i see errors
𝕯aniel
𝕯aniel
And show me ur urls.py
Pandit
𝕯aniel
Dont forget import a views
𝕯aniel
from . import views
Pandit
Dont forget import a views
from django.urls.conf import path
from . import views
urlpatterns = [
path('',views.index, name='index' ),
path('item/',views.item ,name='item'),
path('', views.index, name='index')
]
𝕯aniel
𝕯aniel
Yes if files in same folder
Pandit
𝕯aniel
Now check
Pandit
okey
Anonymous
Pandit
Pandit
Muhammadamin
hello guys i have some problem, can you help me???
Muhammadamin
SMTPServerDisconnected at /contact/
Connection unexpectedly closed: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Muhammadamin
class ContactView(generic.FormView):
template_name = 'pages/contact.html'
form_class = ContactForm
def post(self, request, *args, **kwargs):
first_name = request.POST.get('first_name')
last_name = request.POST.get('last_name')
email = request.POST.get('email')
phone = request.POST.get('phone')
subject = request.POST.get('subject')
message = request.POST.get('message')
message = f"From: {first_name} {last_name} email: {email} phone: {phone} \n theme: {subject} message: {message}"
email_sent = send_mail('Sarlavha', message, settings.EMAIL_HOST_USER, [settings.DEFAULT_TO_EMAIL],
fail_silently=False)
if email_sent:
messages.success(self.request, "Your feedback is accepted!")
else:
messages.error(self.request, "At this time we cannot receive your request")
return redirect(request.path)
this my views
𝕯aniel
Muhammadamin
settings.py goster
# Django Mptt
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'mirmux5@gmail.com'
EMAIL_HOST_PASSWORD = '*******'
# DEFAULT_FROM_EMAIL = 'abduraximdeveloper@gmail.com'
DEFAULT_TO_EMAIL = 'mirmux5@gmail.com'
𝕯aniel
𝕯aniel
Muhammadamin
# del
thank you bro worked
𝕯aniel
Muhammadamin
Anand
I tried by creating a app password in my google account and it also worked
mukul
https://dpaste.org/qp9b/slim
is this is way of doing ???
or their are other ways for this
Muhammadamin
# del
bro again it doesn`t work, why... I don`t know
Tridip
Is it possible to upload a 10GB file using Django???
If not, what should be the approach??
John
How do we store the console values and store them in db
John
I'm using Ajax
John
In Django and I'm confused
Deleted
Hey guys, how could I get CONCAT data of the table in Django? Say I have col A and B in the model, I want to get all the AB value in this table
venkatesh
Can anyone help to CSV data to json with multilevel format
Rudra
Which is best django or flask
Axror
hi guys. Pls explain me django-dajax. And may give me example about it pls
John
Is it possible to override the django default authentication with firebase authentication so it's never give any type of problem in future.
Firebase authentication means i planning to build a mobile application so for authentication part I user firebase because It's super easy or free and there give some extra features but the rest of the database I planned for postgres and the backend for django
So it's ok if I directly use django and store user information in seperate model ( not in django user model ) or I perform some overriding operation on default django user model and use that.
Shreehari
Hi
How can i conditionally use {% include %} in a django html file?
{% include "base/notification.html" %}
I want to use this tag inside everywhere in my website except on the homepage.
Can someone please share the proper tag to use?
i tried something like this below, but it did not work
{%ifnotequal request.resolver_match.url_name '' %}
{% include "base/notification.html" %}
{%endifnotequal%}
UPDATE: Fixed it
McLean
help , im creating something like a video conferencing site for students so im not able to have a join function
Bhashkar
Hi Guys, Could you please tell me why the bellow code not working properly
For mobile when the user submit empty then it save Null on database.
mobile = models.CharField(max_length=20, unique=True, null=True, default=None, blank=True)
But for email same thing not working, it save empty string in data base but i want to save Null
email = models.EmailField(unique=True, null=True, default=None, blank=True)
Bhashkar
Can any one help ?
Gordrick
𝐄𝐫𝐟𝐚𝐧
Which is best django or flask
Each has its own use.
I use Flask for smaller projects because it's very simple and I use Django for bigger projects because it's very powerful and clean.
Gordrick
Bhashkar
But for email storing empty string rather then Null.
Morteza