Eugene
*group
Go ahead
Doragonsureiyā
Can i PM you ? cuz i cant share media in this folder
To share code or error tracebacks, use a pasting service, like: - https://linkode.org - https://dpaste.org
user
RKMMFT8cQwNzZxZfmRLEfWcifZjARDVudkV9lKTg Is it any type of hashing???
Fan / Ac
which generic class based view can be used to convert this function view https://nekobin.com/daxalefumi
Fan / Ac
Yes
i mean can you suggest a generic class based view to do this other than buy using LoginView in auth
cj
i mean can you suggest a generic class based view to do this other than buy using LoginView in auth
https://docs.djangoproject.com/en/3.2/ref/class-based-views/base/#redirectview
Dominik
Hi everyone, I have created a script that I want to run with cron. It needs to uptade Data in the DB so I importent from models.py. The issue is whenever I run the script I get an exception as I read it is because modely.py is not supposed to be run. But since I import from it, the import will run it. I can create a testcase without problem but I was wondering when I schedule that script with cron it will surely fail. Do you have suggestions or thoughts on this hitting a brick wall right now.
Alireza
Hi. I need to implement a system as follows: The first user submits a request, Then this request is sent to the second user's panel, this person can approve or reject the request. Is there a special library or pattern design for implementing this system? Or is there a specific keyword for this system at all?
Roman
Please tell me a free hosting on which l can deploy the Django project.
CanDo
Heroku
CanDo
AWS EC2 has also free trial for 1 year
ZRoman
Tell me, is it possible to somehow manage celery tasks through your interface, or through django? As I understand it, if you take app = Celery ('myproject'), then this app will not give nodes, will not have a connection with celery nodes, and you need to run celery separately to get data. So ? I have an api, by calling the api, a task is created and celery is immediately executed if there is no other one that is executed. and I need to kill, sometimes, the task that is currently being performed through the interface. I found this in the dock, but I can't apply it yet :( >>> from celery.task.control import revoke >>> revoke (task_id, terminate = True)
Anonymous
I guess am on my own🚶
Whats stopping you
Anonymous
I would write a custom authentication backend.
Breeze
you mean for the otp?
That would be stressfull, i already have my register and login authentication set and working perfectly, i just want add the otp for security purpose
H
Hi everyone! I’m struggling with database in django.. I have models.py with lat, long attributes. I want to input these attributes in admin web. Save them. And so they add the marker on web frontend Google maps. At the moment I can login to admin and add coordinates(long,lat) and my frontend shows the map. What command should I write to get the inputs from admin page and send them to my html or perhaps js is more appropriate to show the markers. Otherwise I have to just hardcore the coordinates in my js file.
Rutherford
I'm trying to get the name of the items in a manytomany relationship from a model. I'm using list comprehensions but it doesn't work. [x.name for x in n.tests_to_carry.all() for n in Patient.objects.all()] It says n is not defined. But after looping over the normal way and then using the list comprehension, it works. Any reason for that? Expected output ['malaria', 'fever', 'malaria']
Mohammad
Hello, when I have several objects in a page, how can I specify which one is selected now?
Jerome
Hello friends. Can you introduce a source on how to use CDN for static files ??
Check this one. it's very accessible & you can upload up to 500mo for free. You'll get an idea then https://sirv.com
αмiʀ⁦⁦⁦⁦
Hi I have 2 view function And I want to send some argument from first view to the other view How can i do that? Is that possible?
kv
Can anyone tell me how to begin with Python Django? Which resources should I refer to?
Doragonsureiyā
Can anyone tell me how to begin with Python Django? Which resources should I refer to?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Fan / Ac
so i have a user login system, when the user logouts it redirects to the url logout/ which renders the same template which login/ renders with an additional context {"message": "logout successfully"} which displays the login page with an additional message logout successfully, what will be a good way to do the same but redirect to the url login/ instead of the url logout/ with the logout successfully message the url config is like this https://nekobin.com/wejugiraka
Richard
transient ?? i was thinking of storing it on the session
Same thing as long as you can retrieve after
Fan / Ac
Same thing as long as you can retrieve after
is there any issue that might happen if i store it in session ??
Rutherford
Hi I have 2 view function And I want to send some argument from first view to the other view How can i do that? Is that possible?
If you are redirecting to the view then you can do something like return redirect(viewname, argument)
Anonymous
Hello👋🏾 Please can anyone recommend resources for learning unit testing in Python/Django and also any other advanced concepts in Django one can learn
Anonymous
Docs are superb. Try it out.
I did but it's not really clicking yet so I wanyto try out other stuff
Anonymous
Try "obeythetestingoat.com"
Thank you! I'll check it out
Sarthak
*https://www.obeythetestinggoat.com/
αмiʀ⁦⁦⁦⁦
If you are redirecting to the view then you can do something like return redirect(viewname, argument)
My argument is a form I want to send a form from a view to another view
αмiʀ⁦⁦⁦⁦
Pass it as the argument.
I have to define it in my url? You mean def first view(request): ... form = request.POST Return redirect ('account:myform' , form) def secondView(request, form): ... If you mean that, i try it but doesn't work
Manish
Why do we need to call def get_object(self,pk) function to get queryset? I have searched on Google but didn't found a satisfied answer
Manish
Ok thank you.😃
Mirco
Ok thank you.😃
otherwise you should everytime query and filtering by pk
Mirco
Got it
👍🏻
Ferruccio
I'm sorry, I'm a sysadmin and I've to install a django app developed from someone else. I got following errors: http://paste.scsys.co.uk/596180
Ferruccio
How can I fix it?
Ferruccio
http://paste.scsys.co.uk/596179
...
Hello everyone, How to overwrite an ID when saving a model in dajngo. It is necessary to always end with 01
...
Such a task
Mirco
Because you will have issues Use another field different from PK
...
can i implement this in def save()?
Ferruccio
I'm a sysadmin and I've to install a django app developed from someone else. I've got following errors: http://paste.scsys.co.uk/596180 How can I fix it? more info: http://paste.scsys.co.uk/596179 Or what may I read to understand the problem?
Mirco
can i implement this in def save()?
don't change that pk use a new field and if u want , make it primary key but don't try to change the default one to add 0 padding
ﹺ ﹺ
I need help guys.... How can one code an artime or data top-up app using Django??
JINSHAD
Hey guys!
Igor'
<form action="{% url 'detailed_current_financial_results' %}" method="get"> <label for="start_date">Start date<em>*</em></label><br> <input id="start_date" value="2021-11-01" name="start_date" type="date" min="2010-01-01" max="2041-01-01"><br> <label for="end_date">End date<em>*</em></label><br> <input id="end_date" value="2021-11-19" name="end_date" type="date" min="2010-01-01" max="2041-01-01"><br> <button class="btn btn-info btn-sm" type="submit"> Get a statement for the period </button> </form> Hi! How can I send my values to my view? It is necessary to do this at the level html.
Igor'
Paste the code in pastebin. It's hard to read
https://pastebin.com/jqyMM2ar This is my view. It is necessary to send values there
Igor'
Paste the code in pastebin. It's hard to read
https://pastebin.com/ciTMD6Ah This is my form. I need the client to select the values for displaying data in the range.
Олег
how to make an api with /?search=<value> and sort by key
Luxmi
Hello can someone please help me resolve an error
Doragonsureiyā
Hello can someone please help me resolve an error
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
Luxmi
class Wishlist(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) product = models.ForeignKey(Ad, on_delete=models.CASCADE) prod = models.ForeignKey(RentAd, on_delete=models.CASCADE) status = models.BooleanField(default=False) def __str__(self): return self.user.name class Notifications(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE)
Luxmi
models.py
atkisai
hello my english friends, i have quastion about django can I add my variable in url without template and views, from my mixsin on example?
atkisai
only urls.py
Luxmi
<form action="{% url 'wishlist' %}" method="post"> {% csrf_token %} <input type="hidden" value="{{rent.r_id}}" name="rid"> <button type="submit" class="btn"> <i class="fas fa-grin-hearts"></i> </button> </form>