أمجد☄
Code: https://pastebin.com/PwaCaHag
أمجد☄
Aadhi
I have a doubt , If we are going for an interview as a back end python developer after learning python and Django. Do we need to master in any front end technologies also like jQuery, JavaScript
Muflone
Still not enough
Muflone
Very often you need to make interact the front end with the backend
Ярик
you can override save() and put the logic there
i've tried to override save a few times but i didn't get how to solve it? can you please help me?
Igor
i've tried to override save a few times but i didn't get how to solve it? can you please help me?
In your class model, you create o def save and put the logic what you need
Ярик
i can't realize how to put the logic
Ярик
that is the problem
Igor
Haaa
Ярик
)
Ярик
i have to give one field a value of other field from fk field
Igor
What field fk?
Ярик
i solved it)
Anonymous
anyone interested to develop an payroll software with django ?
Turtle_In_Hurry
In my django projects there are so many emails message implementation which are making app slow how can i fix it...? without using celery...
Anonymous
Create a different Django project on different server?
Turtle_In_Hurry
no there is any other way to Queue emails apart from celery
Anonymous
If I've a model with lots of computed fields, is there a better way to arrange models and methods ?
Root
I'm using PostgreSql with django, the issue is, when i makemigrations and migrate, no new tables are generated... I need to delet the db then recreate it to get the updated list, else it shows programming error with Exception Type: ProgrammingError Exception Value: relation "fbase_mymodel" does not exist LINE 1: SELECT COUNT(*) AS "__count" FROM "fbase_mymodel"
Scrim
Im using djongo, tried use inspectdb , but erro nonetype. Did anyone knows about It?
أمجد☄
Note that i have added this custom user model into all of my processes that use django's User model
Solved it, but the request.user.username in the views seem to not work after overriding django's User, how can i get the logged in Custom User username ?
Anonymous
If I've a model with lots of computed fields, is there a better way to arrange models and methods ?
Never keep much computed fileds in model , always keep base fileds, user methods to get value as property
Rohan
Hello
Anonymous
Felex
anybody who has used grafana here?i need some help
Isaías
Hello
Mendes
Hi
Isaías
How send email in Django and postfix
Isaías
Settings django
Mendes
EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.example.com' EMAIL_PORT = 587 EMAIL_HOST_USER = 'no-reply@example.com' EMAIL_HOST_PASSWORD = 'password'
Mendes
Resolve teu problema manito?
Isaías
Não resolve.
Isaías
Entendi ?
inchidi
Entendi ?
english only please
Isaías
Ok
Hernan
Greetings to all. I am developing a project with wagtail (I recommend them to everyone who needs a CMS) and I am needing to put a captcha for the administration login. Anyone know any that I can add in a simple way?
Ярик
hey guys, i have 2 models like so: class Model_1(models.Model): field_1 = models.Charfield() field_2 = models.IntegerField() class Model_2(models.Model): field_3 = models.OneToOneField(Model_1) field_4 = models.IntegerField() You need to fiil the first models and than you can fill the 2nd based on the 1st by FK field The question is next: How can i make a field_2 be equal to field_2 - field_4 when i save a new model post?
Anonymous
How can I implement email verification in Django rest api.. I'm using react in front-end
Ярик
Explain more if possible
First you create Model_1 manually Than, to create Model_2 you have to choose field_3 as a fk field I want to connect field_4 with field_2 so when i save field_4 int it would decrement its value from field_2
Ярик
Smth like this
Anonymous
How can you ellaborate
Anonymous
First you create Model_1 manually Than, to create Model_2 you have to choose field_3 as a fk field I want to connect field_4 with field_2 so when i save field_4 int it would decrement its value from field_2
if you create model one first, then in the save() method of model 2 , add a code that gets saved object from model one, get the value and do your decrement and save it in field 4
Mirco
How can you ellaborate
Do you need for ? Registration ?
Anonymous
Yes i already resgistered and send the mail to the user ID with the activation link
Anonymous
But after that user_condfirmed value is not changing
Anonymous
To true
Anonymous
Can you suggest me how to get int value of the field?
Model.objects.get(pk=key) of model 1
Anonymous
Sorry i can't
Anonymous
ok
Anonymous
Or the email otp verification in Django rest api
Anonymous
First you create Model_1 manually Than, to create Model_2 you have to choose field_3 as a fk field I want to connect field_4 with field_2 so when i save field_4 int it would decrement its value from field_2
Maybe write a method in model 1 that fills in the value of field_2 Model methods: https://docs.djangoproject.com/en/2.2/topics/db/models/#model-methods
Anonymous
Can you suggest me how to get int value of the field?
Since there is already a relationship use it like the example in here https://docs.djangoproject.com/en/2.2/topics/db/examples/one_to_one/#one-to-one-relationships
felix
I'm new to django. how does "post" work in django? I want to create a function that receives certain variables and enters them in db. I created in models.py, post class: class Post (models.Model): title = models.CharField (max_length = 200, unique = True) updated_on = models.DateTimeField (auto_now = True) content = models.TextField () I know I can create in admin.py: admin.site.register (Post) and so from admin in site, manually enter the data and post it, but I want to create a function that receives from another function certain variables and once called enter them in db. recommend me some documentation or examples, because I searched all the google and found nothing.
Carlos Eduardo
Hello! Nice to meet you all!
Carlos Eduardo
I'm new here and need some help of you all.
Anonymous
OK 🆗
Mirco
Sorry i can't
So it's hard to help ya
Carlos Eduardo
We are trying to upload a Django Project to Azure but we can't make it work.
Carlos Eduardo
We have the file up already.
Carlos Eduardo
And in console we have already install all dependences
Anonymous
What's the error
Carlos Eduardo
But when we open the url we have this.
Carlos Eduardo
The page cannot be displayed because an internal server error has occurred.
Anonymous
Error in your code
Carlos Eduardo
We have the Project working in localhost.... maybe it can be sql_driver??
Anonymous
Anyone ?
Request.user
Anonymous
Only
Carlos Eduardo
Code pls
Okay we gonna try to upload an "Hello world" Project. Thanks a lot.
Anonymous
Okay
Carlos Eduardo
'ENGINE': 'sql_server.pyodbc',