inchidi
Trying to develop a login system that Can use either email or phone number to authenticate user
https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#customizing-authentication-in-django
inchidi
In companies for real projects what they are used for implementation of crud operations ? I mean just django or django with rest framework
it depends on your requirement, do you want to use your backend in multiple frontend platforms (ex: browser, mobile, etc) then you can start with rest (json api) but you need to create the frontend app for browser and mobile or if you simply want to access your web app in the browser only then html+css+django should be enough, no need to add an extra headache. note that you can always add json api with DRF anytime later
Bilal
please any one have soluations to this problem ?
Bilal
error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [1 lines of output] error in anyjson setup command: use_2to3 is invalid. [end of output]
Charly
please any one have soluations to this problem ?
If you give some context of what are you even doing...
Charly
Second google result: https://bobbyhadz.com/blog/python-error-in-package-setup-command-use-2to3-is-invalid
TonFutures 💎
I have a question If user login too many does it cause a problem?
TonFutures 💎
It means user click the button Login too many
TonFutures 💎
And make more than one session
Charly
And make more than one session
usually login makes the previous sessions invalid
Hridya
I have a doubt please anyone help me, how to connect django rest apo with front end? How to write the views and urls for the API?
Anubhav
I have a doubt please anyone help me, how to connect django rest apo with front end? How to write the views and urls for the API?
Let's suppose you are using react for frontend then u can use fetch(in js), axios, RTK (redux) to connect to backend
Paul
How to implement store procedure in django?
S
What is best way to use admin panel of django i want learn use of that
S
How to create date picker where according date range i get that monthly dataa from sqlite
_//cleph💵🍕🇺🇸🔥
Hello how can i use simple jwt token generation and validation without using user class abstraction i want to make something like rapidapi to generate api and have limitation for time and token requests im gonna be happy if you help me
Dori
is there someone here who knows django? can you please help with homework🥹🥹
Eternity
is there someone here who knows django? can you please help with homework🥹🥹
What homework do you have? What issues did you have when you were doing it
Doragonsureiyā
is there someone here who knows django? can you please help with homework🥹🥹
We're not here to do your job for you. This group is to help you on specific issues you have in YOUR code, so you have to show the code you wrote by yourself and explain where and why you are stuck... as simple as that. 🤷🏻‍♂️
Paul
So can anyone help me to use store procedure in django?
Doragonsureiyā
So can anyone help me to use store procedure in django?
No one can help you until you explain your difficulties.
Paul
Ok. I want to use the store procedure in django. In the scenario we need raw sql and access the external store procedure by django.
Wolfred
Hi guys, good afternoon. Im trying to group the result of a query by an annotated field like this: servers1 = Server.objects.annotate(domain=Substr('hostname',StrIndex('hostname', Value('.')))).value('domain') I am calculating the "domain" of a list of servers, and i whant to group all the servers by their "domain", but it is not grouping them This is the output: [ {'domain': '.gdl.mex.ibm.com'} {'domain': '.gdl.mex.ibm.com'} {'domain': '.gdl.mex.ibm.com'} {'domain': '.tuc.stglabs.ibm.com'} {'domain': '.gdl.mex.ibm.com'} {'domain': '.gdl.mex.ibm.com'} {'domain': '.gdl.mex.ibm.com'} {'domain': '.gdl.mex.ibm.com'} {'domain': '.gdl.mex.ibm.com'} ] Do u know how can i group by an annotated field? What i expect is something like this: [ {'.gdl.mex.ibm.com', {'hostname': '.sdfasdfsa'}, {'hostname': '.yyttrrr'}, {'hostname': '.oppoik'}, }, {'.tuc.stglabs.ibm.com', {'hostname': '.sdfasdfsa'}, {'hostname': '.yyttrrr'}, {'hostname': '.oppoik'}, }, ]
Wolfred
I am executing the following test to see why the group by function is not working, and the group by clause is missing: print(Server.objects.values('created_by_id').annotate(domain=Substr('hostname',StrIndex('hostname', Value('.'))))) Query: SELECT "server_server"."created_by_id", SUBSTR("server_server"."hostname", INSTR("server_server"."hostname", .)) AS "domain" FROM "server_server" ORDER BY "server_server"."name" ASC
Charly
Can i send you a task?
No, explain what you need to do, what have you tried and where are you stuck. No one will do your homework here
Hirbod;
I have a Django project and I want to upload the admin panel of this project on another domain and the main project on another domain Like this: Admin-django.com Django-project.com What is the best solution here? I don't know how to have the same project admin panel on another domain Thanks for any help!
Maxim
Yeah
the wrong answer
Doragonsureiyā
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
vijay
return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1204, in _gcd_import File "<frozen importlib._bootstrap>", line 1176, in _find_and_load File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "C:\Users\vijay\Desktop\code\demo\morningpro\morningpro\urls.py", line 19, in <module> from testingapp.views import frist ImportError: cannot import name 'frist' from 'testingapp.views' (C:\Users\vijay\Desktop\code\demo\morningpro\testingapp\views.py)
vijay
that problem solution
Ali
Maybe you want to write first
Charly
that problem solution
Do you have a view called frist?
vijay
How to write please
Charly
How to write please
How to write what?
Maxim
That error
we cannot help you until you respond adequately to our messages
TonFutures 💎
Hi When user login too many make more than one session It means user click the button Login too many
TonFutures 💎
How can i prevent it?
TonFutures 💎
I already told you that's not an issue
You said pre session is invaild It's true but in database created row
TonFutures 💎
no
I test it When i click 50 times In database 50 row created
Charly
I test it When i click 50 times In database 50 row created
https://docs.djangoproject.com/en/4.2/topics/http/sessions/#clearing-the-session-store
TonFutures 💎
https://docs.djangoproject.com/en/4.2/topics/http/sessions/#clearing-the-session-store
I read it later I have another question When hackers attak me, how can i prevent them? For example they're send multi request, so my server is dump
Charly
Bandar
I read it later I have another question When hackers attak me, how can i prevent them? For example they're send multi request, so my server is dump
If we look into preventing attacks we would waste time preventing something may never happen pre optimisation is the source of evil Prevent sensitive data others prevent as they accuse
⟨ Simon |
yes premature optimization isn't always a good idea, but for security it's not premature optimization
Bandar
Have been doing it for a while 🤣too
Bandar
Some ppl I work with they one hour work takes 5 days
Bandar
Because I’m afraid someone will find a gap my main focus is to push project to the market
Azizbek Xushnazarov
How can i prevent it?
You should setup throttling.
TonFutures 💎
You should setup throttling.
Have you ever work with it? If i have a question, can i ask you?
Junior
Guys anyone use htmx, i need use this in all website or part specific?
inchidi
Guys anyone use htmx, i need use this in all website or part specific?
doesn't matter, client (browser) will only load it once then cache it anyway
Doragonsureiyā
Have you ever work with it? If i have a question, can i ask you?
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
inchidi
So do you recommend use htmx?
personally i love htmx but it depend on your requirement of course
Junior
Understand
Junior
Before i was using in POST and GET, i was doing authentication, but have some problem because cache
Doragonsureiyā
Guys anyone use htmx, i need use this in all website or part specific?
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Владимир
Tell me how to combine the select2 filter and crispy forms https://hastebin.com/share/eludutavuk.kotlin Judging by the inspector, the widget has disappeared and there is nothing in filter.form.media
Toni
Hi everyone I'm struggling with something in my project. I want to add a Choicefield in a modelForm on my template. Can anyone give me an idea please?
Jitxs
how to use two database in django, and is it recommended to use generally i want to use mongodb and mysql ?
Doragonsureiyā
how to use two database in django, and is it recommended to use generally i want to use mongodb and mysql ?
Do you want to use Django with MongoDB? Then you shouldn't Please read this article: https://daniel.feldroy.com/when-to-use-mongodb-with-django.html
Jitxs
Do you want to use Django with MongoDB? Then you shouldn't Please read this article: https://daniel.feldroy.com/when-to-use-mongodb-with-django.html
then any good database for large binary files ? i want to store a audiobook. and i search on stack overflow and found that the simple file system is good for long time performance (store in dir), ik little about it we just specify the media url in settings.py and then model... correct me if wrong.
Jitxs
then the media url.. right ?
⇆ㅤ◁ㅤ ❚❚ㅤ ▷ㅤ↻
Can anybody assist me in implementing reCAPTCHA in my login form? I'm encountering an 'ERROR for site owner: Invalid key type' message in the captcha box, despite verifying that all keys have been correctly configured in my settings.py with the associated domain 127.0.0.1.
Mihir
Can anyone help me with django I have used relationships in django model file , like foreginkey and onetoonefield etc But i am unable to save form by using relationships in model
Ali
Hi I passed Django courses. Now I want to test what I have learned in a project, but I have no idea. What project should I do, I don't want it to be just a test, I want it to be practical. Can anybody help me?
Никита
Hi everyone! I have simpe model customer (name, phone, addres). When client in the process of filling the form. I want use find on field "phone" and run "for example" js script with window: 'Customer with such a phone already exists. Select a Customer' How i can do that? Please help) <form action="{% url 'new_customer' %}" method='post'> {% csrf_token %} {{ customer.as_p}} <button type="submit">Add</button> </form>