Looks like, the slug is not configured correctly. Post the screen-shot of
the models.py file of the "App_blog" App.
On Sat, Mar 20, 2021, 4:48 PM Noyon Barman
wrote:
> Please help me what should I do now
>
> On Sat, Mar 20, 2021 at 12:39 PM Omkar Parab
> wrote:
>
>> Post the screen-shot of app/
Your slug is adding extra characters after the main title.
On Sat, Mar 20, 2021, 5:31 PM Omkar Parab wrote:
> Looks like, the slug is not configured correctly. Post the screen-shot of
> the models.py file of the "App_blog" App.
>
> On Sat, Mar 20, 2021, 4:48 PM Noyon Barman
> wrote:
>
>> Please
On 20/03/2021 12.10, Noyon Barman wrote:
> Please help me what should I do now
>
You should learn how to write a proper question. Just posting
screenshots of error messages and not even doing the minimal effort
required to solve the problem yourself or take the time to describe your
problem is ext
First, import slugify π
from django.template.defaultfilters import slugify
then,
Add this π below the "def __str__()" in your Blog model.
def save(self, *args, **kwargs):
if not self.slug:
self.slug = slugify(self.blog_title)
return super().save(*args, **kwargs)
On
Thank you so much for helping me with this
On Sat, 20 Mar, 2021 at 7:22 PM, Omkar Parab wrote:
> First, import slugify π
>
> from django.template.defaultfilters import slugify
>
> then,
>
> Add this π below the "def __str__()" in your Blog model.
>
> def save(self, *args, **kwargs):
> if
*some of my code:*
#urls.py
urlpatterns = [
url(r"^$", views.home_page, name="home"),
url(r"^(?P[0-9]+)/$", views.details, name="details"),
]
#Views.py
def details(request, album_id):
return HttpResponse(f'You looking for album no: {album_id} |')
what i wondering
Mahendra Yadav
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://group
path('' ", include('name_of_your_app.urls')).
Tip - You should learn more about, how to send an email.
On Sat, Mar 20, 2021, 10:41 PM Mahendra wrote:
>
>
> Mahendra Yadav
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe
Just adding to the previous answer, you should always make sure your slug
field is unique when saving, as sometimes two posts can have the same title
and that would result to an error.
def _get_unique_slug(self): slug = slugify(self.blog_title)
unique_slug = slug
num = 1
while Blog.objects.filte
Sorry, the save method isnβt supposed to be inside the _get_unique_slug()
function. Thatβs what happens when u type code on an iPad.
On Sat, Mar 20, 2021 at 14:08 Kelvin Sajere wrote:
> Just adding to the previous answer, you should always make sure your slug
> field is unique when saving,
I'd store the query parameters in the user's session:
https://docs.djangoproject.com/en/3.1/topics/http/sessions/#examples
On March 19, 2021 9:56:54 AM CDT, "sebasti...@gmail.com"
wrote:
>Hello,
>
>i have a addresslistview that also take parameter like pagingsize and
>ordering over url. For ex
11 matches
Mail list logo