RKumar
Kudakwashe
can anyone help on deploying django project
Uday
Ya I have but am confused how to align flow like function,api
Bunty chhatri wala..
Bestin
Hi, Can anyone help me with something.
I want to add a button in a form ( in django admin page ) which redirect the user to another page loaded from static template, and after user select something from that page it should redirect back to the original django admin form to complete the rest of the form.
Is there any way to do this ?
Anonymous
Bestin
use urls
Is there any other way.. because the url changes to situation like 'add' or 'change'. So....
Mirco
study a bit of database theory before Django
Dev
hi fellas, i have a wallet field which uses a DecimalField for storing
btc value
wallet = models.DecimalField(decimal_places=8, max_digits=8, blank=True, null=True, default=0)
I just realized that when the wallet's value becomes 1.xxxxxx it throws an error
Devo
Devo
Here
Dev
since its for financial stuff that's why i decided to use DecimalField
Dev
```Traceback (most recent call last):
File "/usr/lib/python3.6/code.py", line 91, in runcode
exec(code, self.locals)
File "<console>", line 1, in <module>
File "/home/mcroni/mybitstoreenv/lib/python3.6/site-packages/django/db/models/query.py", line 752, in update
rows = query.get_compiler(self.db).execute_sql(CURSOR)
File "/home/mcroni/mybitstoreenv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1492, in execute_sql
cursor = super().execute_sql(result_type)
File "/home/mcroni/mybitstoreenv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1131, in execute_sql
sql, params = self.as_sql()
File "/home/mcroni/mybitstoreenv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1458, in as_sql
val = field.get_db_prep_save(val, connection=self.connection)
File "/home/mcroni/mybitstoreenv/lib/python3.6/site-packages/django/db/models/fields/__init__.py", line 1510, in get_db_prep_save
return connection.ops.adapt_decimalfield_value(self.to_python(value), self.max_digits, self.decimal_places)
File "/home/mcroni/mybitstoreenv/lib/python3.6/site-packages/django/db/backends/base/operations.py", line 517, in adapt_decimalfield_value
return utils.format_number(value, max_digits, decimal_places)
File "/home/mcroni/mybitstoreenv/lib/python3.6/site-packages/django/db/backends/utils.py", line 238, in format_number
value = value.quantize(decimal.Decimal(1).scaleb(-decimal_places), context=context)
decimal.InvalidOperation: [<class 'decimal.InvalidOperation'>]
```
Devo
So here you are trying to post a char value in decimal field
Dev
even if i post a DecimalField it throws the same error
Dev
Profile.objects.filter(username="don").update(wallet=Decimal(1.00000000))
Dev
even making it a 7 digits causes the same issues
Devo
try to give only Decimal(1)
Dev
once the figure starts with 1 it will throw the error
Dev
Mirco
Devo
Devo
Here
Dev
Mirco
Dev
Devo
Devo
wallet = models.DecimalField(decimal_places=8, blank=True, null=True, default=0)
Devo
wallet = models.DecimalField(decimal_places=8, max_digits=25, blank=True, null=True, default=0)
Devo
Or try this
Dev
btw when i try to update using the admin i get this error Ensure that there are no more than 0 digits before the decimal point.
Mirco
Dev
anything that begins with 1
Mirco
Dev
lol yeah please
Mirco
lol yeah please
The mantissa must fit in the max_digits;
The decimal places should be less than decimal_places;
And according to the DecimalValidator : the number of whole digits should not be greater than max_digits - decimal_places;
the 3 rules are these ones
Dev
so if i what to have something like 1.xxxxxxxx to 8 decimal places and also support 0.xxxxxxxx to 8 decimal places can u suggest what i should use
Dev
eg. models.DecimalField(decimal_places=x,max_digits=x) ?
Dev
ok
Dev
and maintain the max_digits at 8?
Sid
Please help
I deployed my website in a shared hosting but :
1) Site is rendering only two or three static images in the webpage rest of the images aren't rendered (all static images are in same directory)
2) To solve the problem I destroy the python app and redeployed with same steps but now the even the css and js files aren't rendering
3) Not only that django's inbuilt admin panel is also not rendering with default css
Mirco
~:$
Good to use CharField in case of DecimalField
What is the reason behind it? You have to call decimal conversion before any calculations and for storing back to database you have to convert to string. Please share your knowledge. Thank you.
Dev
models.DecimalField(max_digits=16, decimal_places=8, default=Decimal(0))
Dev
solved thanks
~:$
Dev
i honestly didnt see the reason to use a Char
*( (*
Sunny
Anyone have django project
Sunny
Web application
Sunny
Related project
Sunny
I mean college software management system likes as
Sunny
Sunny
Source code and documentation
Sunny
With abstract
Sunny
Any one send me pls
NoOne
template
<img style="float:right; max-width:50%;" src="{% url 'ads:ad_picture' ad.id %}" >
Browser
<img style="float:right; max-width:50%;" src="/ads/ad_picture/12" alt="img" ee5qd8vi6>
extra text is added to the img tag and image is not rendering
sam
hello my friends. i want to implement a microservice with django but don't know how to authenticate users from another service. can you help me?
sam
Maxim
sam
Doragonsureiyā
no
Why?
Seriously... Why? 🤔
sam
i'm reading that right now
Piyush
Can anyone tell me how to override the django allauth template.?
Rakesh
Hello, I need some help guys, I want to connect multiple database with single application dynamically, Meaning If I provide the details of DB like user password db name port etc, from front end it it will connect and I execute the sql query to display the data from that db
Rakesh
Please help me 🙏🙏🙏
Doragonsureiyā
Please help me 🙏🙏🙏
Maybe anyone is here, yes, but they are not obliged to read everyone's message here neither to reply to everyone's message, if someone wants to reply to your message, they will do that, just don't try to draw attention to your message writing "anyone?" every 5 minutes, that will lead you to be warned for SPAM/Flood, just be patient or use Google/DuckDuckGo to research about your question instead of wasting time here waiting for people to do your work.
Have a nice day 😊
sam
sam
Maxim
it just simply says override authenticate()
first you need to decide how to act - there are many options
your main problem is that no one except you can do it right
so you will have to at least superficially familiarize yourself with all the possibilities, then decide what is supposedly more suitable - but do not rush - this will not necessarily be the final decision - perhaps in trying to implement it you will understand that it is actually not very suitable
it's a hard path, but most likely you will have to go through it