Sopan
>>> generate_activationcode(size=13, chars=string.ascii_uppercase) 'CGGTOEEWFCFLS'
sarth
how make drop down choices dynamic directly from database table without using foreign key in model form in django... please help me
Sopan
?
Sopan
Exactly - what's your exepcted output?
Anonymous
?
Like I want the digits to have 62 prefix..like start with 62
Anonymous
>>> import string >>> import random >>> def generate_activationcode (size=8, chars=string.digits): ... return ''.join(random.choice(chars) for x in range(size)) ... >>> generate_activationcode(size=13) '622322362793234' >>>
Devo
'62'+str(output)
Sopan
>>> def generate_activationcode (startwith = '62', size=8, chars=string.digits): ... return startwith + ''.join(random.choice(chars) for x in range(size)) ... >>> generate_activationcode(size=13) '624559601622556' >>> >>> generate_activationcode(size=13) '621689269700276' >>>
Anonymous
Ow, thanks
Ganesh
why am i getting error of AttributeError at /admin/main/consultation/ 'NoneType' object has no attribute 'lastname' in my admin page when i click on consultation https://dpaste.org/B5sz
shashikant
i have account models and function here
shashikant
https://del.dog/isitulyvam
shashikant
i am currently getting this error:
shashikant
ValueError: Cannot assign "<Account: Account object (9)>": "Token.user" must be a "User" instance.
shashikant
https://del.dog/ijyneriniv\
shashikant
even this does not work
Inuk
ValueError: Cannot assign "<Account: Account object (9)>": "Token.user" must be a "User" instance.
what is the type of Account.objects.last()? looks like it doesn't return a User, investigate that
shashikant
it will return the last object
shashikant
i have replaced with instance,but still the same error
Mo
Hi if we have a python model and want to request for receiving information from user and sending back the model output into that link based on the inputs and the model, what is the best structure and way for this? (in django rest framwork api)
Saikat
Does anyone have good idea about how to write django test cases with pytest
Saikat
Get PyCharm, Support Django.
I'm using pycharm professional version , but I won't recommend to anyone
cj
I'm using pycharm professional version , but I won't recommend to anyone
What? PyCharm professional is the best IDE to work with Python and Django, I'm using it since 2011 and it's just perfect for a daily work... anyway, if you want to discuss about it, let's move to @PythonOfftopic as it's not related to Django at all
cj
Does anyone have good idea about how to write django test cases with pytest
have you tried googling it first? there are many examples and there's even a plugin pytest-django that you use for it (and it works well in PyCharm testing engine too 😜)
__init__
can install php to my computer and be able to run php script inside a python container ???
__init__
it simple in php
odin
I need to add a ML model in my django project. How can i create endpoints using django rest framework?
Doragonsureiyā
I need to add a ML model in my django project. How can i create endpoints using django rest framework?
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box, write down the same words you asked here Step 4: Read the first results
Есбол
hi how to change UserCreationForm error message (to other language)
Adnan
Any one Setup XMPP in django
Anoop Pratap
Which one would be better to integrate with angular or react?
Doragonsureiyā
Any one Setup XMPP in django
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box, write down the same words you asked here Step 4: Read the first results
Doragonsureiyā
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
Anonymous
why is this not saving cveid ? https://dpaste.org/EVDf#L82,86,87,88
Maz
This is not a reason😊 Azure very powerfull
Ummm...I think budget is a very important reason. This was a list in order of cost. Why deploy your app on a platform you cant afford to pay?
.....
Yes but this data won't be saved anywhere
I want to just show on site. How will do this?
Harish
class TempModel(models.Model): x = models.IntegerField(...) def __init__(self, *args, **kwargs): if self.x < 0: self.y = "Negative" elif self.x == 0: self.y = "Zero" else: self.y = "Positive" I would like to initialise a new variable y for every object of the Django model TempModel without creating a field in the database. Adding a variable y to a normal python class on init is possible, does this extend to Django as well? If it does, how does one go about doing that?
Michael ✨
Hi, sorry for the trouble, does anyone know why I'm getting this error?
Michael ✨
https://pastebin.com/vixjLHWg
Michael ✨
I'm trying to upload my project to GitHub but it gives me that error, I already tried to increase the buffer to 54 ..., but it won't let me upload it
Doragonsureiyā
I'm trying to upload my project to GitHub but it gives me that error, I already tried to increase the buffer to 54 ..., but it won't let me upload it
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.
Michael ✨
I am trying to upload my Django project to github but I get that error
Doragonsureiyā
I am trying to upload my Django project to github but I get that error
Adding the word Django to your Off-Topic question doesn't magically turn it to a Django related question, so move to @PythonOfftopic group and ask there.
Zey
if i am creating my form i html then how i can do form validation?
Anoop Pratap
If u want to show the error to the user then u need to do validation both on client (js) and server side
Anoop Pratap
yes but how to do server side validation?
When u catch the data on server side. Validate. If validation bad respond with some error message
Zey
normally we use is_valid function but I cant use that bcz i am creating my form in html so I am askinh is there any way to use is_valid function
Zey
it is inbuild function for form validation
Anonymous
hello can i filter foreign keyed product status?
Sai
hello can i filter foreign keyed product status?
filter (product__status='DELIVERED')
Anonymous
thanks! it worked
Mayur
https://dpaste.org/p3JP
Mayur
https://dpaste.org/p3JP
I am getting error in djongo nested creation in views
Mayur
could anyone help me..?
Ankit
I need a Web app developer
Ankit
Is there anyone who can develop e-learning web app in 30$ .
Ankit
I really need professional developer
Ankit
Yes cos most of the features are already completed
Ankit
Just need to improve design and learning experience
Ankit
Lool
😱
Anonymous
Does any one have django related work.
Anonymous
For experience I need some work
Anoop Pratap
Is there anyone who can develop e-learning web app in 30$ .
😅😅😅in that I can only give you advice.
DD
How can I implement real time database update in django Right now I am working on a web application which displays live stock market data from api I want to fetch data and store in db every 1 minute so the data should be refreshed in real time manner
.
Hi there. I have a question, why we need Profile model, why we can't put all information in User, I mean custom user .
Abdalwhab
i need add (phone, code-phone, password) to login > how i can do that....
Crack
Hello everyone i need help in django+ajax
Anonymous
Please I can I solve this import problem on window File "C:\Users\HP\Desktop\biblepod\Biblepod\people\urls.py", line 3, in <module> from . import views File "C:\Users\HP\Desktop\biblepod\Biblepod\people\views.py", line 5, in <module> from .serializers import PersonSerializer File "C:\Users\HP\Desktop\biblepod\Biblepod\people\serializers.py", line 4, in <module> class PersonSerializer(serializers.Modelserializer): AttributeError: module 'rest_framework.serializers' has no attribute 'Modelserializer'