Omair
thank you.
No problem 😊
Asif
Suggest best book for Django
Doragonsureiyā
Suggest best book for Django
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
cj
Suggest best book for Django
better follow those tutorials ☝️🏻
Melvin
Can anyone help me to create URLs using slug
Cesar
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Cesar
path('articles/<int:year>/<int:month>/<slug:slug>/', views.article_detail),
Melvin
i tried that but it doesn't work
Melvin
path('events/<slug:slug>/', views.detailview, name='detailview'),
Melvin
def detailview(request, slug): events = get_object_or_404(Event,id=slug) return render(request,'eventsdetail.html',{'events':events})
Melvin
But the url doesn't show the slug It is like this http://localhost:8000/events/5/ '5' changes for each object accordingly as its id
Melvin
Yes
Melvin
{% extends 'base.html' %} {% block title %} {{ events.name }} - {{ block.super }} {% endblock %} {% block breadcrumb %} <div class="post_thumbnail post__item"> <img class="post__thumbnail__image" src="{{ events.image_thumbnail.url }}"> </div> <li class="breadcrumb-item active">{{ events.name }}</li> {% endblock %} {% block content %} <p>{{ events.description }}</p> {% endblock %}
Melvin
this is the template
cj
this is the template
I can't see where you're building the event's URL
Melvin
def get_absolute_url(self): url = reverse('detailview', kwargs={'pk': self.pk, 'slug': self.slug}) return url
Melvin
Okay
Melvin
I can't see where you're building the event's URL
def get_absolute_url(self): url = reverse('detailview', kwargs={'pk': self.pk, 'slug': self.slug}) return url
cj
do you have a repo if your project? I can't see where you're rendering the resulting URL where you want to show the slug
cj
def get_absolute_url(self): url = reverse('detailview', kwargs={'pk': self.pk, 'slug': self.slug}) return url
also here you don't need to pass the ok, because you only have slug field in the URL registry
$iductive
How to add Django admin calendar in my form
Doragonsureiyā
How to add Django admin calendar in my form
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box write down the same words you asked here Step 4: Read the firsts results
$iductive
Please help
cj
Please help
show what you've tried to do at least
$iductive
I have imported from django.contrib.admin.widgets import AdminDateWidget but didn't worked
Melvin
404
just a moment
Melvin
404
https://github.com/Melvin-Thomas-Dev/sanskriti-2020
akshay aka max
what a talented bunch
akshay aka max
can anyone tell me if I should go with php or Django as a beginner?
Day
none
Then find another one that you are attracted to,
akshay aka max
oh
akshay aka max
okay
akshay aka max
I am a beginner I started with django
okay what was your first django project
Sagar
How to connect fronted to backend in django
Sagar
If my backend is django
Dave
wow ok
Melvin
okay what was your first django project
I made the polls app from the official tutorial to an extend
Melvin
After that I followed another tutorial.
Melvin
Simpleisbetterthancomplex
Sagar
I am new to django how to clone or run GitHub django project successfully
akshay aka max
Melvin
what's this
It's a website I got the tutorial from Just google it. You will get the website
Harshit
When creating our own authenticate function by overloading built in authenticate , we need to make some changes in settings.py how to do that and where should i keep my overidden function ?
RENGANATHAN
How to fix SMTP refuse resend problem
RENGANATHAN
Please ! Can anyone help to me??
Harshit
google django custom authentication backend
I searched In settings.py we need to make sme changes. I m nt undstding, how we are giving that path of new authentication class ?
Anonymous
Ssl cert error?
Alex
I searched In settings.py we need to make sme changes. I m nt undstding, how we are giving that path of new authentication class ?
WHAT you dont understand? https://docs.djangoproject.com/en/3.0/topics/auth/customizing/
Nurbek
Guys! I can't set my custom domain(godaddy) with AWS Lambda. I read many docs and followed instructuons. I'm confused can u guys help me out
Abhay
I am fresher in django How can i learn django Can any one tell me and send me resources of django
Doragonsureiyā
I am fresher in django How can i learn django Can any one tell me and send me resources of django
Check out PythonRes, a channel for Python resources (links to help you out).
cj
Any word? @c0x6A ?
I went to sleep because it was night here, nvm, 11 hours has passed since then, have you solved your problem yet?
cj
Nop Still stuck
ok let me check
Melvin
I am a beginner so cant comprehend someone the error messages
cj
Nop Still stuck
☝️ do that, is should work
Melvin
You mean Change that to slug?
Melvin
Instead of events.pk?
cj
You mean Change that to slug?
yes... didn't you said you want to build the URL using the slug (string) instead of the id (number)?
Melvin
Yees
cj
also you have to overwrite the save() method in your Event model, to fill up the slug field, otherwise it will be empty
Melvin
Let me try that I am presently traveling I'll try this and get back asap