Anonymous
Do anyone have any idea how to use pydantic to create table structure for mongodb
Ram Kumar Shukla
Is there any way i can access the "name" variable outside that with syntax?
If you want to access variable then do not define your variable name inside templates tags.
Ram Kumar Shukla
Is there any way i can access the "name" variable outside that with syntax?
You can only access the variable within tag limit only where u have defined it.
Intelligence
DM me I can help you out on that
Please I'm interested in this project.
Ariel
Yes I have
Hey. Do you have any experience with selenoid?
Jun
https://stackoverflow.com/questions/63427548/im-working-on-a-django-blog-the-error-is
Jun
Where
Anonymous
path('<slug:category_slug>/
Anonymous
path('detail/<slug:blog_slug>/
SNIR
how can i transfer a list with ajax into django view ? i try request.POST.get('data') but it just return none all the times
Anonymous
Explain
SNIR
Explain
you telling me to explain ?
Anonymous
List your model entries
Jun
means?
Anonymous
Check if there exist any data with that slug
Jun
Yea slug data is there
Anonymous
blogdetail = get_object_or_404(Blog, blog_slug=slug)
Anonymous
Your model field is slug
Anonymous
Not blog_slug
Jun
Wait let me try with this
Jun
Now the error is name 'slug' is not defined
Jun
Any idea?
Tukhtamurod
path('detail/<slug:blog_slug>/
What you got in the url path? You are indicating its type as slug, so it should be an object, what is being displayed in the url?
AP
Hello
AP
How to make drop-down choices for user
Anonymous
What are the Prequisites of learning Django
Anonymous
Nothing
I know python and can use very much this , but beside python are there i need to learn to learn django , like databases or MYSQL or anything like that ?
Tukhtamurod
In the url the slug is displaying but giving error
Slug is an object, you mean slug name is displayed?
Anonymous
Actually you don't need any knowledge of how database work, django orm will take care of it
Anonymous
oh, thanks @awardize1
Anonymous
Now the error is name 'slug' is not defined
Pass slug argument in function, Give slug in template url
Tukhtamurod
yes exactly
Let me check it from your post in stackoverflow
Anonymous
Do You guys create a virtual env when creating a new Django Project
Anonymous
?
Jun
Pass slug argument in function, Give slug in template url
I think i have done that part, you can check in the stackoverflow post
Tukhtamurod
yes please
Your code seems to be alright, you sure that the date with slug python does exist there?
Jun
yes slug python is there but what date?
Tukhtamurod
I think i have done that part, you can check in the stackoverflow post
And one thing here when you are getting data from database, there is no slug type in db, it is stored in another way like images stored, even though when you print the slug it says python, it is like string representation of slug is being displayed and when you filtering you are using the real type slug, maybe you should work on separating the string representation of it and then try to get it by its name not by itself
Tukhtamurod
yes slug python is there but what date?
And let me know if it worked or not please
Jun
You can test it by manually doing get_object_or_404(Blog, slug='python')
It is giving NameError: name 'Blog' is not defined
Shubham
It is giving NameError: name 'Blog' is not defined
Import the Blog model in your current file
Jun
Import the Blog model in your current file
In the views.py file it is already imported
Shubham
Show the code
Shubham
Might be able to help you
マクスイム • グセブ
Hey guys, I need help
マクスイム • グセブ
My Django admin panel has just crashed
マクスイム • グセブ
It's not showing anything despite the fact the admin homepage works
マクスイム • グセブ
And I feel like it's not my code error because I doesn't work in all my projects. Here is the image showing the weird stuff happenning. https://i.stack.imgur.com/Fc2HO.png
マクスイム • グセブ
And the bug image https://i.stack.imgur.com/B1QIa.png
マクスイム • グセブ
So as you see there's no text, instead of models info I get weird main menu with all these buttons...
マクスイム • グセブ
And my runserver log is absolutely Ok and there are no files missing.
マクスイム • グセブ
I've already tried reinstalling Django but nothing works.
マクスイム • グセブ
I will appreciate any help.
Jai
Check your model's str function
Jai
What is it returning
マクスイム • グセブ
It's absolutely ok, all my models are returning strings in str method
マクスイム • グセブ
You see the problem is not in models because even padding of container of Django is broken.
マクスイム • グセブ
One guy from stackoverflow suggested checking migrations and admin.site.register() calls but there are okay too.
Ilsaf
The view blog.views.post_detail didn't return an HttpResponse object. It returned None instead. https://pastebin.com/vfWbphmq
Ilsaf
Help me, pls
Anonymous
Hello developers kindly help 1. What is a route in programming 2. What is an api Examples will help me a lot thank you..🙏
Shubham
urlpatterns = [ path('', views.IndexView.as_view(), name='index'), path('owner', views.owner, name='owner'), path('<int:pk>/', views.DetailView.as_view(), name='detail'), path('<int:pk>/results/', views.ResultsView.as_view(), name='results'), path('<int:question_id>/vote/', views.vote, name='vote'), ] Adding this to my urls.py I am getting the error that polls.views has no attribute indexview can anyone resolve it?
Ilsaf
How can I make sure that html tags are supported when entering text on my admin panel django