Sukuna
Create a base template and add your base content like navbar footer there
Paul
hello everyone one I'm just starting out on Django I've created an external directory for templates so was asking how can I link it with the navbar for custom .html files including drop-down menus
check out Django Templates & Inheritance tutorials it will be much clearer if you see how it implemented rather than someone's brief explanation
....
https://stackoverflow.com/questions/71045869/how-to-show-like-exist-or-not-in-serializer-based-on-request-data-in-django anyone can answer this question ?
Alex
https://stackoverflow.com/questions/71045869/how-to-show-like-exist-or-not-in-serializer-based-on-request-data-in-django anyone can answer this question ?
You define Likes as class PostLike(models.Model): like = models.CharField(max_length=10) And then show that you're actually storing that like as an int post_like id like post_id user_id 1 1 1 1
Mohd Zaid
can anyone tell me how to create local variables inside a model class
Mohd Zaid
can anyone tell me how to create local variables inside a model class
I don't want to store those variables as a database field
Alex
I don't want to store those variables as a database field
Describe what problem you're trying to solve. Spoiler - your "local variables" are not the problem
....
You define Likes as class PostLike(models.Model): like = models.CharField(max_length=10) And then show that you're actually storing that like as an int post_like id like post_id user_id 1 1 1 1
there is no issue with like . because i defined another function for that . if it's the user and post id exist in postLike db. i will delete the row . something like this : if PostLikes.objects.filter(user = user, post = post ).exists(): PostLikes.objects.filter(user = user, post = post ).delete()
Alex
Aliyu
Has any one used pay stack before.
Aliyu
with django
Doragonsureiyā
Has any one used pay stack before.
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Alex
so ??? it's not a solution for my question . is it ?
Your question implies more that you asked. You're risking to make your app into a potato with such attitude.
shiva
Unmigrate the app till migrate file 0142?
shiva
How to unmigrate till file?
shiva
Any one guys please help me
Alex
Unmigrate the app till migrate file 0142?
manage.py migrate --fake <migration-number>
shiva
manage.py migrate --fake <migration-number>
manage.py migrate appname --fake<till i need file>
shiva
Is it right
shiva
I think yes.
Thank you
Брат
Why django-debug-toolbar disappearing, once I do "POST"?
Anonymous
Anonymous
pardon
sorry for that I mean maybe I can show you some pictures and try telling me what to do
Брат
How can I see the queries in django? django-debug-toolbar works only for "GET" method, but not other methods.
Aaush
Hey can anyone help me in an Django project
Aaush
I am a fresher ...
Aaush
I've a project to do.
Aaush
But i cant send img in this group, can anyone please help!
Doragonsureiyā
But i cant send img in this group, can anyone please help!
Read the rules before any activity: @PythonRules
Alex
How can I see the queries in django? django-debug-toolbar works only for "GET" method, but not other methods.
I prefer to setup logging in my DB (postgres). Or you can setup it at django level https://docs.djangoproject.com/en/4.0/ref/logging/#django-db-backends
Hossein
How can I see the queries in django? django-debug-toolbar works only for "GET" method, but not other methods.
(if u want to know how many queries a view has made) an easy "hack" is to use len() on connection.queries before a view's return statement
Hossein
if u just want a quick way of seeing things. it's not a good solution if u want constant info on all views.
RKumar
Anyone can help me how to arrange url path in swagger according to me
Avvi Rapper
I want to remove initial form values while using Updateviews. How can I do that?
Karthik
Hi
Karthik
Can i deploy two versions of django in one Apache server
Karthik
For example one project existing with Python 2 and django 1.9 deployed in Apache
Karthik
But now I am developed project is Python 3.9 and django 3 this project need to deploy same server
Karthik
But facing issue any
Karthik
Yes
Could you please let me know the process
M?
I want to set a certain Reward for the Outlet, but I don’t know how to connect them http://linkode.org/#Ojlzvyjv4pJFboHPjJ8992
pavan
how to add table column values and paste in new column.suppose 5 colums contain 25,75,100,50,0 i have to add values from dictionary and show in new column
pavan
tqq
Ak@960301
Hi iam working on a social media web application where I need to track user activities like his shares,comments,likes and visiting pages. Could you please help me with any packages and documentation for this🙇
VJ
Hi I have doubt in manytomany in django How can we post the data with formdata for many to many field in django
@l!®€z@
https://stackoverflow.com/questions/24330701/django-1-5-when-extending-base-html-my-head-tag-displays-in-my-childs-body
Bazaroph
hi, i have a problem with django. I need to get a file if user submit but i get an empty dict.
Bazaroph
My model:
Bazaroph
http://dpaste.org/RWkH
Bazaroph
My form: http://dpaste.org/71Ue
Bazaroph
My view: http://dpaste.org/ZVUq
Bazaroph
i always get as a result <MultiValueDict: {}>
Naveen
Hello all can you help me with authentication system by using phone otp
Naveen
Hi have to create user by phone number and verify their phone and login by phone
Naveen
Please help me out
Damir
someone plese send me /metrics from your flower i think mine is cursed celery_worker doesn't register in prometheus
Siya
hey i need to build a e learning platform using django,can anyone please suggest a full video tutorial to follow step by step?
kiran..
better u gothrough Geekyshows
Siya
i need to make using python django
kiran..
yes..python django only..
Юлиан🦉
hello men, i have struck o trying to make an endpoint to detailed view of entity, end point seems empty. Also from some srange moment have a trouble that queryset = ..get() returns more than one. I was testing with creating instances from admin panel, and finally in the corner(
Юлиан🦉
Can you help me please?
Юлиан🦉
Should I write more concrete information, like some code snippet 💁🏼‍♂️ don't want to throw the project, iI kinda like it😑
Mohd Zaid
hey can anyone tell me if i have very less static files then do i need to store it in aws server or else i can use heuroku eith static files inside my project ??
Егор
Should I write more concrete information, like some code snippet 💁🏼‍♂️ don't want to throw the project, iI kinda like it😑
We probably need the model(s), view(s) and serializer(s) of yours. Just paste them into pastebin.com and turn on syntax highlithing. Use comment lines to show where those above are placed.
Егор
hey i need to build a e learning platform using django,can anyone please suggest a full video tutorial to follow step by step?
How about using some e-commerce libraries to transform them into what you need? Play with some settings, templates and css and you will get what you want.
Maxim
Can u suggest proper tutorial for that?
not everything has tutorials