Ilya
I changed because I was getting errors saying something about duplicates of "account"
I have this problem when: I do rename my module (before - class Comments. After - class Comment. Without “s”) Well… only this problem I have 😂 Especially when project have much modules and you do project with your team :)
Ilya
I changed because I was getting errors saying something about duplicates of "account"
I delete DB and writing: python manage.py makemigrations python manage.py migrate It helped me in this situation
🧚‍♂️
Right ?
Ilya
In SQLite I have to delete it manually
Yes. I do it in sqlite. I create project in the beginning and my DB is empty. I delete db and do migrations
Dark
Hii guys, In docker-compose.yml do we need to define sqlite as an service or have an another container like PostgreSQL?
Alexander
Hii guys, In docker-compose.yml do we need to define sqlite as an service or have an another container like PostgreSQL?
sqlite is typically an embedded database, so most of the times you don't even need to add any extra services/containers, it acts as a part of your own code/process.
Kene
Hi guys. Has anyone created an asynchronous task without needing to use a task scheduler like celery? Maybe using Python's async...await?
Charly
What specific thing you need to do, as many things could make slow response times if it needs to wait
Oxytocin
Hi I have two models named task and group Group has a m2m field to Users model Task has a m2m field to group Now I wanna get a username and return all tasks that this user is authot of or in one of its groups How can I get the queryset? (Im working with DRF)
Psami
Task.objects.filter(groupuserusername="username") Try this
Psami
class User: username = models.CharField(max_length=255) pass class Group(BaseModel): user = models.ManyToManyField(User) class Task(BaseModel): group = models.ManyToManyField(Group) user_tasks = Task.objects.filter(group__user__username="username")
👑 Dharmzeey
Please I have issue with django project on cpanel. I added some variables in environment variables of my python app, but I can't retrieve it with the os.environ.get("variable_name")
👑 Dharmzeey
Please I have issue with django project on cpanel. I added some variables in environment variables of my python app, but I can't retrieve it with the os.environ.get("variable_name")
It always return none As a matter of fact, when I check what the os.environ returns, none of the variables I added to the environment variable is found
José Jorge
hi, how i can take backup of DB weekly automatically in Django and how i can restore that with an action button on app control panel
Oxytocin
class User: username = models.CharField(max_length=255) pass class Group(BaseModel): user = models.ManyToManyField(User) class Task(BaseModel): group = models.ManyToManyField(Group) user_tasks = Task.objects.filter(group__user__username="username")
Thank you🙏 I did it in another way in my task view class task_list(generics.ListAPIView): serializer_class = task_serializer def get_queryset(self): username = self.request.parser_context['kwargs']['username'] user = User.objects.get(username=username) user_groups = group_user.objects.filter(members=user) queryset = task.objects.filter(Q(author=user) | Q(task_groups__in = user_groups)).distinct() return queryset
Hadi
Hello everyone How I can be full stack developer in Django? What is the way
Charly
Hello everyone How I can be full stack developer in Django? What is the way
Not only with Django. But the way is learning it along with javascript and other frontend technologies.
cj
Hello everyone How I can be full stack developer in Django? What is the way
you can't, because django is a backend tool, yes you have the templates, but they are rendered at the server side, you should learn frontend tools apart from django
Med M'bareck
Any buddy have using flutter with Django here
Doragonsureiyā
Any buddy have using flutter with Django here
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Noddy
Which library is good wagtail or django-cms for news blog site?
Anonymous
Please I have installed Django and virtual environment but it keeps us saying virtualenv not recognize when I try creating a virtual environment
Anonymous
I'm new here hope I'm welcome 🥺
Anonymous
Virtualenv env
Jaloliddin
try python -m venv env
Jaloliddin
this should work
Anonymous
try python -m venv env
I think I have done that, let me do it again and show u the outcome
Ilya
I think I have done that, let me do it again and show u the outcome
In my windows 10 and VScode I do: Python -m venv venv Or Python3 -m venv venv The last word (venv)- name your environment.
Anonymous
In my windows 10 and VScode I do: Python -m venv venv Or Python3 -m venv venv The last word (venv)- name your environment.
Still throwing up this error Error: command '[c:\\users\\user\\venv\\scripts\\python.exe, '-m' , 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
Anonymous
Linux machine?
No, windows
Jaloliddin
No, windows
u better create a new project and follow along with it: make a directory for ur project enter the directory python -m venv [UrVenvName] enter ur venv source UrVenvName\Scripts\activate pip install django ....
Shamnad
use:- pip install virtualenv
Amit
can someone help me with django login authentication please
...
Hi everyone, I need help with data rendering from ORM to dropdown menu in template😊 I need to show in dropdown menu 13 000 rows with good speed, it possible to make this default Django?
MHJ
hello i have a question about side block who can help me ?
Doragonsureiyā
hello i have a question about side block who can help me ?
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Anonymous
use:- pip install virtualenv
I have installed it, if I do pip list it is there, I have uninstalled and reinstalled it again
Andrew
Hi everyone, I need help with data rendering from ORM to dropdown menu in template😊 I need to show in dropdown menu 13 000 rows with good speed, it possible to make this default Django?
You can use values () method when querying your data this would make it faster because it reduces the queries that Django send to the database & if you want special part of your data you can use data slicing
Anonymous
Now use virtualenv
Yeah, I used python -m virtualenv env and I'm in
Мark
Hello, I'm trying to put a site on django, ubuntu 18.04 and apache on the host, I seem to have set everything up except for statics and migrations, but when I go to the site I see just navigation and source of my project
Andrew
Thanks Andrew, could you show something example with PostgreSQL if possible?
You welcome my friend In django ORM you don't need to write any sql code whether you use mysql, postqresql or any sql database the Django ORM writes it for you you can try YOUR MODEL CLASS.objects.values (specify which fields you need) [0:14] for Data segmentation specify which part you want or you can use Django paginator seqmenting your data because you can't use your whole data because this gonna kill your database that why you need to seqmenting your data
Andrew
You welcome my friend
....
Hi friends
....
Any one know this concepts, Data pusher Django web application to recived data into the app server for an account and send it across different platforms from that particular account using webhook URLs
🧀
Google webhooks
Christian
Сашко
Hi to all. I am new to django and have a question, rather of a "philosophical" nature 😅. It is about authentication and user profiles. If I understand everything correctly, the following separation is considered the best practice: the User model is for auth-related information (username, email, password, etc.), and the Profile model is for non-auth-related information (bio, profile picture, etc.). But then what is the point, for example, of having "first_name" and "last_name" fields in the User model, if they perform a customization function and are not a "login method"?
....
Google webhooks
Yes Google webhook URLs
🧚‍♂️
No module named 'allauth.accounts'
🧚‍♂️
No one knows how to fix it??
Vlad
Hi guys. Has anyone created an asynchronous task without needing to use a task scheduler like celery? Maybe using Python's async...await?
I haven't done much but I saw mostly async tasks stuff in the documentation. For instance, you can find examples of task schedulers in the Django official documentation
Vlad
how did u create virtualenv?
There are plenty of ways to to that. My favorite is via virtualenv. There also is poetry and pipenv and the more standard venv. Virtuaenv makes virtual environments easy because it is easy to create and to workon an environment
🧚‍♂️
NoReverseMatch at /accounts/login/ Reverse for 'dashboard' not found. 'dashboard' is not a valid view function or pattern name.
🧚‍♂️
have you met this error before?
Vlad
By the way, my name is Vlad. I am building Django recruiting app. I learned Django and DRF recently. I went through documentation, some tutorials, and courses for backend. I am looking for like-minded people so feel free to message me. P.S. I am also looking for better myself on terms of data analysis, parsing data, webscraping, making a great search engine. If you have any good resources to learn from - I'd highly appreciate that
David H
I guys, I have a question: What is the most efficient way for obtaining an attribute on each querystet's element based on some column's values?
David H
Values()
I was wondering about something like @property or anotate (I don't know which one is more efficient)
Vlad
Values and values list should work efficiently. What do you mean by efficiency? Time to run the code? If that's the case, you can test the options in terms of time.
🧚‍♂️
urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('allauth.urls')), path('', Index.as_view(), name='index'), path('about/', About.as_view(), name='about'), path('order/', Order.as_view(), name='order'), path('order-confirmation/<int:pk>', OrderConfirmation.as_view(), name='order-confirmation'), path('payment-confirmation/<int:pk>', OrderPayConfirmation.as_view(), name='payment-submitted') ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
🧚‍♂️
yes