Mirco
Why staticfiles and user uploads do not work when Debug is set to False.
because you need to serve them using a webserver or something like WhiteNoise middleware
Anonymous
in Entry.objects.all(): print(e.headline) How could I do this code, in a single line? I need to show a many_to_many objects name in admin panel.
Rohan
in Entry.objects.all(): print(e.headline) How could I do this code, in a single line? I need to show a many_to_many objects name in admin panel.
It returns a query set, you can play with it and yes you can do it in single line with list comprehension
Rohan
But what I don't understand is using print to for admin panel
Rohan
My response can be inaccurate cuz I don't know what your query is returning and what you're expecting to see on your panel and how a print() is useful to you
Anonymous
Hello i am making api with django which apiview class is more prefferable for registering users?
Mirco
post ( ? )
Anonymous
Mirco
yeah
Explain better what u wanna know
Pankaj
Hello i am making api with django which apiview class is more prefferable for registering users?
mixins.CreateModelMixin, BaseRetrieveUpdateView inherit these two classes
ashish
anyone needing digital ocean referral link for deploying their applications worth 50$ can ping me personally..
Cat
Thanks, everyone, it finally started to work! That was one hell of a drag...
Turtle_In_Hurry
class Person(models.Model): name = models.CharField(max_length=50) birthday = models.DateField() class Address(models.Model): person = models.ForeignKey(Person) address = models.CharField(max_length=150) # reverse model relationship hey i want to filter out all person with specific address: 1. there are more than one Address objects associated with a person 2. i want to filter out Person on the basis of latest created Address object
Sheshadri
1. Use count in your query 2. You have to add created_date and optionally update_date fields address and query based on those fields
Sheshadri
In address Model *
Shiva
Guys is it possible to pass the value passed by user to a html page , and capture the image of the div , then save the I want to save the image to particular After that in response I want to give them a url of image
Anonymous
Hi guys
Anonymous
Is there any good tutorial to write a backend for android program
Anonymous
I mean API
Mirco
Read Django rest Framework docs
Turtle_In_Hurry
1. Use count in your query 2. You have to add created_date and optionally update_date fields address and query based on those fields
I've done this by hardcoded filtering on the basis of order_by('-id').first()
Turtle_In_Hurry
Its getting slow
Turtle_In_Hurry
Is there any inbuilt django function for complex filtering
tom
Address.objects.orderby("-id").first().person
tom
oh.. it is order_by😂
El
Can I include a DetailView in a ListView?
Juris
Guys, a very broad django-related question, *if I may*: I want to build django app, integrated with mobile clients and web front-end, that I want to base in the AWS cloud (sql/nosql DB, virtual machine(s), video storage (on AWS or elsewhere). Any advice on choosing optimal aws services stack?
Shekhar
Hi I am trying to compress an audio file at the time of upload. please suggest some ways. I have tried overriding model save method but getting multiple file of same file.
iNcAeLuM
Hello!! I don't know how to proceed to do this; How can I call a function in the server in order to update my database with no request from the user?
iNcAeLuM
You use cronjobs
Is that a Django class?
Dev4vin
Is that a Django class?
Not necessarily, there are just a methodology to invoke some functionality in the back end after let's say a particular time interval, I believe theirs implementation for the framework you are using. I've seen a sample done on laravel, not sure for Django, maybe there's a Python lib you'll add in your project to achieve that
iNcAeLuM
Thanks
Dev4vin
Thanks
👍
iNcAeLuM
Writing your first cron job in Django - horaon - Medium https://medium.com/@harishoraon/writing-your-first-cron-job-in-django-ed62b805d822
iNcAeLuM
Seems I found this
Dev4vin
Ooh, just follow through try the sample
iNcAeLuM
Thanks for the help!!
Papa
Hello friends 👋😊
Papa
How to purchase pycharm professional edition....???
tom
Hi I am trying to compress an audio file at the time of upload. please suggest some ways. I have tried overriding model save method but getting multiple file of same file.
I don't suggest save files in the database. i think you can create a model with file_path and file_hash fields. when upload files, you can save file to the upload path, and get hash of the file(eg. md5),then save path and hash to db if hash is not exist in db .
tom
How to purchase pycharm professional edition....???
you need this https://www.jetbrains.com/pycharm/buy/#commercial?billing=yearly
cj
you need this https://www.jetbrains.com/pycharm/buy/#commercial?billing=yearly
better the #personal one, #commercial is much more expensive
El
why do you want to do that?
I need extract of two models data but only could with one model help me please bro
Turtle_In_Hurry
hey guys is there any way to use distinct('field') for MySQL DATA BASE
El
Someone to used font awesome offline un Django because I have errors share a tutorial thanks
Shubham
Anyone who has used paraview over here??
Anonymous
Hello I have a query regarding testing in django How am i supposed to test a functionality that requires the project to be in a specific state Like before testing this functionality there are a lot of forms to go through and fill up, so how do i test that ?
Prince
please suggest me Best Book to learn Django
Prince
@pythonres
Thank you
Mirco
One good book that misses there is Practical Django and Django Channels 2 Recommended 😊
Artyom
Hi! I can to skip part of migration if relation already exists? How?
Artyom
cause I have a model wich has to create table in DB (this table was deleted in the past using pg4, so django doesn't know about this delete action...
Artyom
and now i have a bad situation. I deleted all migration and django_migrations table in DB.. i think I more deeper and deeper falling in the dead end. I don't want to create a new DB
Artyom
Ok, I found a decition
Juris
What was it?
Eldaniz
hi everyone! do you know course about django beginner to advanced?(coursera, edX, youtube, udemy etc.)
Juris
djangogirls
Shiva
Stect.net/staticpage/25/?format=html Above is my response to user for their request , I have mentioned template render in setting page also in views , also mentioned template name in views. The HTML page contains a data posted by user Will it show a html page to my user if they open it ?
Juris
This site can’t be reached stect.net’s server IP address could not be found.
Am I
im sure this is something silly: Reverse for 'event' with arguments '()' and keyword arguments '{'slug': u'skills-for-life-live-by-choice-not-by-chance-durban-south-africa'}' not found. 1 pattern(s) tried: [u'$(?P<slug>[-_\\w\\d]+)/$']
Am I
why does this not match? it's the exact match. the only change i made to this project was to remove all other urls, and leave this include: url(r'^$', # noqa include('visa.events.urls', namespace='events'), ), the reverse that's failing is: return reverse('events:event', kwargs={'slug': self.slug})
Am I
this is the main url that it is indicating it tries and should match: url( r'^(?P<slug>[-_\w\d]+)/$', show_event, name='event', ),
Arun
Guys a question about bootstrap or front end . https://gfycat.com/SimpleViciousBelugawhale can anyone search this for me ? I need t odo it in boostrap.
Arun
https://gfycat.com/SimpleViciousBelugawhale
Avinash
Can we get logged in username in urls.py ?
Artyom
How I can to set csrf token to view function