ZeroCool
request.user
Thanks 🙌🏼
Rashmi
How to deploy our project cpane and python anywhere because my project run on local host but create error in live server
DoT
My models are not created when I run makemigrations command.... Anyone help me...
Arshiya
Hi guys I have a sign in form created by django-tweaks in html When the page loded the username and password fields were filled automaticly I want the form to be clear at first What should i do? I added autocomlete=‘off’ But dident work
Marcus
just rly wana say shout out to the django community on github and stackoverflow couldnt have done it without you cheers
Alexander
My models are not created when I run makemigrations command.... Anyone help me...
you are sure? How did you understand that the model is not being created? What errors?
DoT
My models are not created when I run makemigrations command.... Anyone help me...
I forget to add my app on installed apps.. Now issue solved
Mohammad.H
Hello everyone I have a question about models in django can anyone help me?
Doragonsureiyā
Hello everyone I have a question about models in django can anyone help me?
Read this please: http://catb.org/~esr/faqs/smart-questions.html#intro
Naggafin
also can I get anyone to help me on a very complex query? here is the background information to the problem: I have two models, CryptoWallet and CryptoTransaction. both models have a field called 'coin' which specifies what blockchain its respective data belongs to, and CryptoTransaction has two fields 'inputs' and 'outputs' that are models by themselves (they are reverse links via ForeignKey) which contain 'amount' and 'address' fields. put together: CryptoWallet can describe wallet data for a particular blockchain, and CryptoTransaction can describe tx data for a particular blockchain, as well as the tx's constitutent inputs and outputs. because it is not feasible to have every conceivable crypto wallet stored in the database, CryptoTransaction's 'address' field is a CharField and not ForeignKey, so links back to CryptoWallet objects can only be done by CryptoTransaction.objects.filter(Q(inputs__address=crypto_wallet.address) | Q(outputs__address=crypto_wallet.address)) for example. here is the problem: I want to get a queryset with the total amount spent or received for any particular transaction for a given user as an annotated field. for example, let's say user A and user B have a CryptoTransaction in common, i.e. A's CryptoWallet address is in the CryptoTransactions's 'inputsaddress', and B's CryptoWallet address is in the CryptoTransaction's 'outputsaddress'. let's say the amount sent was 5 of whatever unit. for user A, the total should be -5, because he sent money, and for user B, the total should be +5, because he gained money. because we are dealing with multiple coins, which means each user will have several crypto wallets, one for each coin, and because there is no solid ForeignKey link from CryptoTransaction to CryptoWallet, I do not know how to do this without having it check the address against all of a user's crypto wallets. let me give a demonstration of the problem below: https://dpaste.org/jHFhy (10+ lines, so see link) do you see how, for every CryptoTransaction, it must search through all of a user's CryptoWallets? how do I get it only search for the CryptoWallet with a matching coin for the given CryptoTransaction while maintaining this as just a queryset construction?
Naggafin
I thought about F() usage, i.e. inputs__address=crypto_wallets.filter(coin=F('coin')), but it wouldn't work (I think?) since the context F() is run with is CryptoWallet and not CryptoTransaction
Abdulrasheed
Good day my co developers I am having this issue on my Django web app 502 Bad Gateway ngix/1.20.0 This error occurs whenever I am trying to view any of the task_submitted models or if I want to add another one. Some times it won't display this error, it will work perfectly and some time it will display this error. The app is hosted on elastic beanstalk. I have checked my Django app terminal for any error log but I can't find any logs there. Please help me out 🙏 Thanks in advance If you need any other information about this just let me know I will provide
Berkan
How do I update the cart with htmx without refreshing the page in Django, if someone reaches me privately, I will post the necessary codes.
Berkan
use out-of-band swap. check htmx docs
I checked the documentation a lot I need help
Mohammad.H
OK but how
I'm a back end developer but I think you should use "eventlistener" function of Java script and then update the DOM with it then the data updates on page without reloading
Savage
Hello my fellow pro devs🤝
Naggafin
wait, exactly when are you wanting cart to update? I'm assuming you have some kind of select thing? I've done a table with check boxes, which is wrapped in a form, and users choose an action, which sends a POST request, then receives HTMX response. I had to use OOB swap to update cart for my app
Naggafin
server will not know client has added items to cart unless you implement a REST API endpoint, but in HTMX, we avoid this
Mohammad.H
but then you lose sync between client and server states
No in addition to that u have to add functions to keep server update!! Actually when u are using "eventlistener" u should get the data for new DOM from the server
Naggafin
also can I get anyone to help me on a very complex query? here is the background information to the problem: I have two models, CryptoWallet and CryptoTransaction. both models have a field called 'coin' which specifies what blockchain its respective data belongs to, and CryptoTransaction has two fields 'inputs' and 'outputs' that are models by themselves (they are reverse links via ForeignKey) which contain 'amount' and 'address' fields. put together: CryptoWallet can describe wallet data for a particular blockchain, and CryptoTransaction can describe tx data for a particular blockchain, as well as the tx's constitutent inputs and outputs. because it is not feasible to have every conceivable crypto wallet stored in the database, CryptoTransaction's 'address' field is a CharField and not ForeignKey, so links back to CryptoWallet objects can only be done by CryptoTransaction.objects.filter(Q(inputs__address=crypto_wallet.address) | Q(outputs__address=crypto_wallet.address)) for example. here is the problem: I want to get a queryset with the total amount spent or received for any particular transaction for a given user as an annotated field. for example, let's say user A and user B have a CryptoTransaction in common, i.e. A's CryptoWallet address is in the CryptoTransactions's 'inputsaddress', and B's CryptoWallet address is in the CryptoTransaction's 'outputsaddress'. let's say the amount sent was 5 of whatever unit. for user A, the total should be -5, because he sent money, and for user B, the total should be +5, because he gained money. because we are dealing with multiple coins, which means each user will have several crypto wallets, one for each coin, and because there is no solid ForeignKey link from CryptoTransaction to CryptoWallet, I do not know how to do this without having it check the address against all of a user's crypto wallets. let me give a demonstration of the problem below: https://dpaste.org/jHFhy (10+ lines, so see link) do you see how, for every CryptoTransaction, it must search through all of a user's CryptoWallets? how do I get it only search for the CryptoWallet with a matching coin for the given CryptoTransaction while maintaining this as just a queryset construction?
bump. can anyone help me with this?
👑 Dharmzeey
Hello Please I am stucked with django on cpanel I have done all the necessary configurations to setup python app on cpanel But my website still does not work
Charly
Logs error, as the browser error doesnt help us to help you
👑 Dharmzeey
I could not see any log error or any log error file
👑 Dharmzeey
Let me check through
👑 Dharmzeey
The log folder on cpanel homepage is empty 😥😥
👑 Dharmzeey
Is there any way I can track the log files manually
Charly
Is there any way I can track the log files manually
I dont know youll probably need to contact support
Yogaraja
when i command makemigrations i faced this errorin the STATICFILES_DIRS setting does not exist.
Yogaraja
( in the STATICFILES_DIRS setting does not exist.)
Yogaraja
what the problem anyone pls explain?
.
when i command makemigrations i faced this errorin the STATICFILES_DIRS setting does not exist.
The problem is STATICFILES_DIRS is not specified in your settings.py Do you understand?
Prakhar
Ok I am getting attribute error Module collections has no attribute mutable mapping
Doragonsureiyā
Ok I am getting attribute error Module collections has no attribute mutable mapping
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
Zidni Zainul
Good day developers, i have issue django production can't handle media files without webserver, right? how if i use object storage like aws s3/cloudinary to handle media files, is that possible?. I just want to production company profile page in sharedhost which has no nginx/apache. thanks
Zidni Zainul
sharedhost has apache runing for you or other webserver
in mycpanel has Apache Handlers , can i do production with it?
Mohammed
how to start from basic
Savage
Is it just react, angular (JS)we can use for frontend? Some python tools can't be used for frontend?
handgull
Is it just react, angular (JS)we can use for frontend? Some python tools can't be used for frontend?
Python its impossible, but you can serve static files with py and use ssr
.
how to start from basic
Read django documentation.
Alex
Hello everyone! Could someone help me out please? i encountered a "Invalid block tag on line 8: 'include', expected 'endblock'. Did you forget to register or load this tag" problem. When i use "include" function. Without it everything works nice. {% extends "horoscope/base.html" %} {% block title %} {{key|title}} {% endblock %} {% block content %} {% include "includes/navbar.html" %} <ol> {% for key, value in signs.items %} <li><a href="{% url 'horoscope_info_signs' info_signs=key %}">{{key|title}}</a></li> {% endfor %} </ol> {% endblock %} Folder "includes" is located in templates folder Also in terminal i see this problem \Django\lib\site-packages\django\template\base.py", line 505, in parse compile_func = self.tags[command] KeyError: 'include'
anrays
hello i need deploy wsgi can help me ,?
Doragonsureiyā
hello i need deploy wsgi can help me ,?
No one can help you until you explain your difficulties.
Nabil
Hi! I'm new to django... Do I need to learn sql? Do I need to know html? My purpose is to be a backend developer aside my major in artificial intelligence...
Savage
Do I need to import Django to start coding?
Shivani
Hello how to update creditor data
Doragonsureiyā
Hello how to update creditor data
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
Juliana
Hi! I'm new here too! Its aways good to know HTML, if you will work someday with web development, and a little bit of all stacks to understand better your future co-workers. You you need it at front end Its really easy to understand. There is a lot of places for free to learn. If you are interest, come chat with me at private! I can help you!
Shivani
How to update Ckeditor content when I saved data then I update it but it save and get new id but I want to do that they update the data without taking new id
Shivam
Does anybody know how to handle json file in DRF
Shivam
With serializer
DRF documentation makes me confuse
Shivam
Can I extract data from json file and dum into databse , is there any serializers.field to handel this
Shivam
Or I should make my own function
Mohammad Hassan
You must create a class that's Extends Serilizer And set model
Mohammad Hassan
I refer you see a course about thos
Shivam
I refer you see a course about thos
Please don't promot ur course here buddy 😂
Nikita
I need help to create django ecommerce application using postgresql
.
I need help to create django ecommerce application using postgresql
No one can help you until you explain your difficulties.
Berkan
How to update cart without page refresh with django json
Nikita
Requirements are Models- Customers Orders Products Users Modelsinfo -users(use oauth,users model) Customers (address,mobile, which we can't store in default users table .it should contain relation with user table) Product(product name, description,image(image should store in s3) Orders(customer _id, product _id, quantity) Requirements Customers and users login and signup use custom form for signup and login Admin user after login he should be able to view data create products, Customer after login he should be able to view products,add products to cart and he can be able to check products