Rajjix
i did read that and tried a lot of stuff, no results so far
Mirco
i did read that and tried a lot of stuff, no results so far
https://stackoverflow.com/questions/39254562/csrf-with-django-reactredux-using-axios have a look here as well
Manish
why this is not working?
Manish
return reverse('blog:article_detail', args=[self.slug,])
Rajjix
return reverse('blog:article_detail', kwargs={'slug':self.slug})
Rajjix
u need to define the keyword and keyvalue accordingly not just throw in a random value
Rajjix
send you get method
Manish
https://del.dog/itafudibez.py
Manish
https://del.dog/owuwiganex.sh urls.py
Rajjix
add one line as following
Rajjix
slug = self.kwargs.get('slug')
Manish
where to add?
Rajjix
def article_detail(request, slug): slug = self.kwargs.get('slug') article = get_object_or_404(Article, slug=slug, status='published',) return render(request, 'blog/article/detail.html', {'article': article})
Rajjix
and change this name as well u have an additional s at the end of you path name name='article_detail')
Manish
django.template.exceptions.TemplateSyntaxError: Could not parse the remainder: ' 'blog:article_detail' article.slug' from 'url 'blog:article_detail' article.slug'
Rajjix
do u have this in your urls.py app_name = 'blog'
Manish
yup
Rajjix
send the template
Rajjix
the html code in your detail.html and the one that has a link to the detail
Manish
https://del.dog/muqafapiqe.htm home.html where link is placed
Rajjix
{{ url 'blog:article_detail' article.slug }}
Manish
https://del.dog/miwewuzilu.json detail.html
Rajjix
{% url 'blog:article_detail' article.slug %} line 76
Manish
{% url 'blog:article_detail' article.slug %} line 76
that i know but i was trying to do same with get_absolute_url
Rajjix
sec
Rajjix
{{ article.get_absolute_url }}
Manish
bro it worked
Rajjix
good 👍
Anonymous
hello. somebody knows how to format the output of this https://dpaste.de/CQdL like in terminal, so that it prints in a clear way, not all mixed up.
Anonymous
there is no more easier way ? like strip() or smth ? I tried but it stays the same...
Anonymous
or rstrip('\n')
George
i don't know but also, you could give a command that we can actually try
Anonymous
ok, found. had to use pre tag in the template
George
pre tag?
Anonymous
<pre>{{ dig }}</pre>
George
i didn't know about that
Anonymous
me neither :)
George
Hi, does anyone know how to query db to know how many instances of certain type exist and inject it into a charfield
George
my idea is to create an object with names "Name 1", "Name 2" etc
George
but when i create second one i need to check how many instances have been created previously
George
Should i use a manager?
entropy
Should i use a manager?
maybe implementing save in your model will help?
the dark
hello friends i need help
the dark
can i add image field in django admin page when i register new user
Gabriel
Sure, study about AbstractUser..
the dark
in personal info i need two more field image and text
the dark
how can i do
Gabriel
You want the code?
Gabriel
Or want to learn?
Anonymous
Yes
the dark
where is the html file of admin page
Rohan
/warn Photo of Screen.
Rohan
Oh right... We don't have guard bot here
Combot
Rohan K has warned Subham Sharma! (1/3) Reason: Photo of Screen.
Rohan
Please use screenshot feature, I see you have windows. There's snipping tool for a reason.
Gabriel
Subham, dont print screens
Gabriel
Try to understand the code, know the direction, and ask
Gabriel
I think you are more lost than Zoro
the dark
i am not able to find this location of html file so how can i add filed
Gabriel
Look: “YourEnv”/Lib/site-packages/django/contrib/admin/templates/admin/
Gabriel
There they are, but.. It will not help you, that’s the bad way to do that
Gabriel
You need to learn how middlewares work in Django first of all
the dark
then how can i do
Gabriel
Humm.. Study about AbstractUser
Gabriel
:)
Gabriel
It’s the better way
the dark
ok thnx
Gabriel
No problem.
Gabriel
If you don’t get it.. Look for “Workflow Django”
Gabriel
Try to learn how it works and try to follow the arcthecture..
Gabriel
MVT
Gabriel
Model -> View -> Template