These are chat archives for django/django

17th
Sep 2018
Himanshu Shankar
@iamhssingh
Sep 17 2018 07:52
I want to set up object level permission in django admin site for staffs. But it is dynamic.
For instance, a user having assigned many PIN Code. He can only access vendors who are working in those PIN Code. In future, user can be assigned more PIN Codes.
What is the best way to achieve this?
Phong Bui
@loveunCG
Sep 17 2018 10:35
hello
how are you everybody.
I gonna deploy django project to apache2 server on ubuntu 16.04
I have set config for wsgi in apache2 server
Shashank Parekh
@sp1rs
Sep 17 2018 10:37
@iamhssingh What is your approach?
Phong Bui
@loveunCG
Sep 17 2018 10:37
this is content of config file
image.png
but currently i cannot load page
Himanshu Shankar
@iamhssingh
Sep 17 2018 11:11
@sp1rs Thought of overriding has_permission. But how do use that in admin section? I can use it inAPIVIew.
Shashank Parekh
@sp1rs
Sep 17 2018 11:15
@iamhssingh Can’t you override get_queryset?
@loveunCG Run this httpd -t. And check if your config syntax is correct.
Phong Bui
@loveunCG
Sep 17 2018 11:18
i have checked apache log but there is no problem
what is best of web server for deploy django production on ubuntu
Shashank Parekh
@sp1rs
Sep 17 2018 11:30
@loveunCG Didn’t understood your question.
Phong Bui
@loveunCG
Sep 17 2018 13:04
I mean I have failed to deploy django to apache
so I gonna change my choice of web server for deploy this project
Karmenzind
@Karmenzind
Sep 17 2018 13:29
Help. Three models here. C is inherited from B. And B is inherited from A. All of them are material tables. Then I wrote a simple API with only one line to create a new C object based on coming request data. And then I use JMeter to test it, 100 threads in 2 secs. More than fifty failed because of MySQL deadlock. Anyway to solve it? Atomic request is turned on.
Harry Moreno
@morenoh149
Sep 17 2018 16:31
@loveunCG the webserver doesn't matter for django. Do what you know best. Here is a good tut https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-16-04
@Karmenzind what were the threads of? why are you using materialized views to back your django models?
Lebzanwa
@Lebzanwa
Sep 17 2018 17:25
Hi guys.. 'How do I Set Environment Variables?'
^ intro to env vars in linux
Lebzanwa
@Lebzanwa
Sep 17 2018 17:34
@morenoh149 I'm using Windows 10.
How to set 'ALLOWED_HOSTS' in environment variable..?
Harry Moreno
@morenoh149
Sep 17 2018 20:39
@Lebzanwa link?
maybe https://www.youtube.com/watch?v=0ZIh8jif8Es for windows env vars