Ilsaf
?
SNIR
there is a way of using multi models in a form. and build how it save everything when i click submit?
SNIR
on submit form, can we pass value of each field with the request.POST ?
Дауран
Guys I have such issue in my Django admin , so I can't delete any users from Django admin , how can I solve such issue
Дауран
There are 4 users , I can't delete them
Anonymous
And why don't you store all contexts in a variable and pass to return
Дауран
What Django tells u ?
I think I will show it tomorrow because I have already switched off my pc )
Anonymous
In this if we call get_queryset it creates instance of the class ...wt will exactly return.....and how we will get data as...no method we r calling???
Anonymous
class PersonQuerySet(models.QuerySet): def authors(self): return self.filter(role='A') def editors(self): return self.filter(role='E') class PersonManager(models.Manager): def get_queryset(self): return PersonQuerySet(self.model, using=self._db) def authors(self): return self.get_queryset().authors() def editors(self): return self.get_queryset().editors()
Sweetie
I had a perfectly running django project. But today it started getting stuck at collectstatic On the production env it does not get ahead of collectstatic command and remain freezed forever. While the collectstatic command runs fine when I run it locally. My static dir and all are correct as the project was working fine with static files since last few months.
Dan
Hey men I created a project on Django, pushed it on github on Ubuntu 20. I made pipenv also. Now, when downloading it on to my Windows computer, I try executing 'pipenv shell' but it says 'Failed to create virtual environment'. It causes Filenotfounderror - can't find python way. Can you please help me with it? Thanks
Dan
О, thanks, im dummy)
Isaías
Hello. What do you use to document api?
Mirco
Hello. What do you use to document api?
https://github.com/tfranzel/drf-spectacular
Chandan
Does anyone know how to rectify 'Class has no objects member error' because of pylint in Django ,I am using vscode on windows
If I fetchall in Postgresql, there is only one result, but there are 2 records in the database. What could be the reason? def topadders(self,chat_id): cur = DB().connect() cur.execute("SELECT * FROM table WHERE group_id = '"+str(chat_id)+"' ORDER BY soni DESC LIMIT 20;") curr = cur.fetchall() for row in curr: return row #psycopg2 #py
Anonymous
Can we deploy or host our dajango project on GoDaddy or C panel?
Anonymous
Heroku and pythonanywhere
How can use I am using own domain
Nagadeep Sharma
How can use I am using own domain
We can buy in it or bye domain at ho daddy and host in above platforms
imacat
Hi. Is the async support in Django 3.1 deals the same thing as the ASGI capability in Daphne? I mean, if I turn from ASGI/Daphne to Apache mod_wsgi, will the async support in Django 3.1 be turned off?
imacat
Yes
Well, thanks. I shall turn from Daphne to mod_wsgi, since the 3.1 async support breaks my code and I cannot find a simple way to fix it.
Anonymous
Can i build django rest api with windows 7?
Anonymous
Yes
Thank you so much 😁
S
How To Resolve This Error from django.core.urlresolvers import reverse ModuleNotFoundError: No module named 'django.core.urlresolvers'
Anonymous
Which version of django ur using
imacat
Yes
I shall try to turn to mod_wsgi tonight first, and then study how to adapt async in Django 3.1. It does not make sense if I have to adapt codes that I can only test and verify on the production server.
Kusuma
Hi, how can I use fontawesome pro in django-fontawesome-5 in models? I have follow https://pypi.org/project/django-fontawesome-5/ but my pro icon is not detected in django admin, only detected on the templates.. please help
Kusuma
my setting FONTAWESOME_5_CSS = '/static/fontawesome/css/fontawesomepro.css' FONTAWESOME_5_CSS_ADMIN = '/static/fontawesome/css/fontawesomepro.css'
S
Django 3.1
Anonymous
Is there a way to block django superuser from doing things that a normal(non-staff/non-SU) can do?
Anonymous
Is there a way to block django superuser from doing things that a normal(non-staff/non-SU) can do?
I think 'groups' and permissions is a way to achieve this but can anyone guide me and give me some specifics on the permission that I'll need to set to do so
Mirco
Is there a way to block django superuser from doing things that a normal(non-staff/non-SU) can do?
It doesn't make sense imho, a superuser is a superuser so it's aim is to handle everything
Anonymous
It doesn't make sense imho, a superuser is a superuser so it's aim is to handle everything
didn't make sense to me too, but my seniors think that allowing superuser to do normal stuff sometimes messes up things on the long run when the project scales
Anonymous
They're from java(spring hibernate) background, maybe there's such problem in java frameworks but not in django?
Mirco
didn't make sense to me too, but my seniors think that allowing superuser to do normal stuff sometimes messes up things on the long run when the project scales
It doesn't mess up anything if the superuser privileges are assigned to smart people Tell your seniors there's a reason why we call it superuser, if they don't wanna give all of this privileges , create a user with proper permissions
Mirco
Obviously 😛
Anonymous
Do anyone have knowledge of mongodb?
Mr. D @
hey, what do prefer to use with django? Nginx with Gunicorn OR openlitespeed (or apache..)? with openlitespeed there is not need for gunicorn and some benchmarks shows its faster. what do your think?
Sh
Assalamu alaikum. I read this article Task Queues: Another example is when a database query would take too long during the HTTP request-response cycle. The query could be performed in the background on a fixed interval with the results stored in the database. When an HTTP request comes in that needs those results a query would simply fetch the precalculated result instead of re-executing the longer query. This precalculation scenario is a form of caching enabled by task queues. Any examples for that?
Mr. D @
I'm using Django with uWsgi in a Docker container.
nice. did you setup/configured yourself? used a docker image or script? uWsgi seems hard to configure.
Mirco
buy it
Mirco
piracy is not supported here
Daniele
there's plenty of free resources to learn django. personally I've bought a course on udemy for a few sheckels - ended up following a course on youtube (by "the net ninja", if admin allows me to link it, I'll pass it on).
ozxx
You can find it on lib genesis if available
Mehmet
Assalamu alaikum. I read this article Task Queues: Another example is when a database query would take too long during the HTTP request-response cycle. The query could be performed in the background on a fixed interval with the results stored in the database. When an HTTP request comes in that needs those results a query would simply fetch the precalculated result instead of re-executing the longer query. This precalculation scenario is a form of caching enabled by task queues. Any examples for that?
Celery is the most used solution for this kind of scenario in python infrastructures. It is a general approach that is used ETL, ELT, and ESB scenarios that will feed an enterprise Business Intelligence platform too. Some of the SQL level calculations or Big data (Hive, Spark etc.) calculations take much time. A task queue mechanism -such as celery- runs a long-running task in its workers -in background-. You can schedule these jobs in order to cache possible outputs on an interval.
Mehmet
It is up to your needs actually. If your result set is high dimensional, you may use OLAP cubes or relational backend. If it is pointer-based data such as the calculated rank of every single user, you may use NoSql solution or cache backend such as Redis.
Andrej
nice. did you setup/configured yourself? used a docker image or script? uWsgi seems hard to configure.
The book "High Performance Django" helped me a lot to configure uWsgi and speed up my application.
Biagio
Just one question: is there a django framework that allows me to have a backend just like WordPress? Or simply let me skip some development phases?
Enes
Im from turkey we are siblings :)
Mehmet
Mehmet how did you learn Django? I want to learn but i cant find any source extremely
I have learned Django after professional development experience in Java Spring MVC/Spring Boot on some enterprise projects for insurance companies in Turkey. I have only used https://www.tutorialspoint.com/django/index.htm in order to get used to Django's design patterns. Following that all I did was re-implementing some of my personal projects in Django and using stackoverflow to solve my basic problems, reading up Medium articles to learn pythonic ways of handling advanced webapp issues such as task queueing, authentication authorization pipelines, Db performance tweaking, caching strategies. I love reading articles on metrobusses in Istanbul and all I did was reading. I personally cannot integrate myself into a tech stack without using it in a real project with time/cost/scope constraints 😂
Mehmet
It is against the rules of the group to promote a page I guess. I write a blog in Turkish about python.
Enes
Wow that's good mehmet. I am also in Istanbul. But i wasn't thought you are in Turkey
Enes
You have a history of programming. This is an advantage for you. You are luck
Anonymous
can anybody send examples of lazyload, infinity scroll or endless pagination?
Anonymous
every example that i try to find on the internet doesn't work
Дауран
guys i have serious errors such as (TypeError at /admin/auth/user/ ) when i wanted to delete some users from django Admin even I have attempt to remove with shell but it didnt help me
Anonymous
Anyone idea about how to remove duplicate in django sample history. I didn't update any thing,but i click on send button, everytime same data come.
Anonymous
Anyone tell me answer
Firdaus
Anyone idea about how to remove duplicate in django sample history. I didn't update any thing,but i click on send button, everytime same data come.
Have you tried https://django-simple-history.readthedocs.io/en/latest/utils.html?highlight=clean#clean-duplicate-history ?
Anonymous
But it's not working.