Luis
Hey bros, you know example JWT 😊
Charly
Hey bros, you know example JWT 😊
There are tons on google
Luis
can u help me😳
Charly
can u help me😳
To search on google? Write django jwt example
Luis
Okay gracias Charly lo reviso rápido 😃🤠
Doragonsureiyā
The Inspired
I want to use something like to get the duration between two timestamps in Django's ORM
you can directly use total_seconds inside ORM too... just import it as you normally would, write the expression for the calculation and store it in the DB in the field you have created for it.
The Inspired
Conflict occurs is there any way without drop db
I suppose you would have to get A GUI then, of you don't want to use the terminal to drop your DB
The Inspired
I think the transaction is not being committed
have you synced your database? makemigrations and migrate?
kiash
Thanks I'll try this and get back to you
Sorry on urls.py not setting.py
Pranav
In my project I have created a template and static files In static file one file name javacsript and another one img file In java script file one menu.js how I can give the path of image from img file.
Anonymous
Hi everyone, I have trouble with uploading big files (more 1gb about), so when i upload big file my request is lagging, takes too long to jump to another line of code. So what can you advise? DB: sqlite3 This is my code models: https://dpaste.org/En0WS , https://dpaste.org/uuUhO#L10,11,16 ; view: https://dpaste.org/xJXV0 ; upload_func: https://dpaste.org/04fw9#L
Sayidbek
views http://linkode.org/#QqBVEw7QgGALGziHqhcm64 blog html code http://linkode.org/#aKV8FWBMEVi7mPuoxyUKd5
you are importing models from views 'from .views import bpost, blog, BlogPost, Blog'
Anonymous
Elhem
I created an abstractuser method in the models and I created three roles (admin, employee, customer) I will create a list that displays all users with permission how can help me
kmk
Hi all. Tell me, please, is it possible to somehow prevent two sets of queries when the same sum_time field is annotated in them, and when they are attached, they are summed up?
study
I need a small help from you guys...
study
I wanted to load bootstrap in django... Using python manage.py collect static
study
But the website is not getting css..... Can anyone help me what to do...
kiash
But the website is not getting css..... Can anyone help me what to do...
Static files in settings.py STATICFILES_DIRS=[ os.path.join(BASE_DIRS/ 'STATIC' ]
kiash
For Bootstrap add it to static files then load static and make sure also you add the link to locate the path of your Bootstrap files or directly load bootstrap cdn
yusof
Hi here's a question for those who has many experience in project structure. i have many models that they use File Field in their model. is it better that i create new model named FileField for exam and connect my models to that model or just put file field in each of them. thanks
Serhii
Hello. Guys please help me. I have been trying to solve problem for two days. How I can do search bar on my blog. I created form with works through post request. I created method dispatch. And this actually works def dispatch(self, request, *args, **kwargs): if self.request.method == 'POST': search_data = self.request.POST.get('story', None) self.object_list = super().get_queryset().filter(full_story__icontains=search_data, status=1) return self.render_to_response(super().get_context_data(object_list=self.object_list)) But when I want to follow to another page on my pagination list I see error blog.views.view didn't return an HttpResponse object I know method get does not return anything But how get post request and return get request to template, and on other page show result from paginator
Jay
Can anyone share me reference for update form using ajax
Vladyslav
Hi to all Why I got this error? SELECT DISTINCT ON expressions must match initial ORDER BY expressions self.failuresensor_set.select_related("sensor", "sensor__sub_system").filter( sensor__sub_system=sub_system, sensor__display_name__in=sensor_failures_components, critically__in=sensor_failures_criticality).order_by( '-sensor__update_date', 'sensor__name').distinct('sensor__name')
Vladyslav
The same field in order by must be in distinct
Hm, I saw this example: https://docs.djangoproject.com/en/4.1/ref/models/querysets/#distinct >>> Entry.objects.order_by('author', 'pub_date').distinct('author') Or I can use only distinct('sensor__update_date') in my case?
Anonymous
I'm new to django, refer any proper book
Tanner
I'm new to django, refer any proper book
2 scoops of Django is a good one. Really the docs are probably the best place for when you're starting out though
Tanner
They're highly readable and just overall excellent
Anonymous
Thanks
..
I'm new to django, refer any proper book
Don't pick any book. Mostly outdated versions. Read the documentation. Complete this simple application first. Best for beginners https://docs.djangoproject.com/en/4.1/intro/tutorial01/
..
Btw i learned Django from this guy. Now it's outdated https://youtu.be/qgGIqRFvFFk
Gipss
How to collectstatic only for admin app? Or exclude drf from collectstatic?
Gipss
How to collectstatic only for admin app? Or exclude drf from collectstatic?
Or how to fix this error: whitenoise.storage.MissingFileError: The file 'rest_framework/css/bootstrap.min.css.map' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7fd68aece050>. The CSS file 'rest_framework/css/bootstrap.min.css' references a file which could not be found: rest_framework/css/bootstrap.min.css.map I tried to google it but I didn't find anything helpful
Bhokali Topa
Anyone having knowledge about the library django-chutad ? I found it in my requirements.txt but cant find a reference
Альбина
Hi guys, when I’m trying to run my local server it keeps giving me ModuleNotFoundError: No module named 'django_heroku'. I did literally everything they say on stackoverflow and it didn’t help. It works perfectly on the heroku server though. Could you recommend something? Im confused
𝙰𝚜𝚑𝚠𝚒𝚗
Done that :/
Maybe django_heroku is missing from requirements.txt, did you checked it?
Альбина
Yep: asgiref==3.5.2 dj-database-url==1.0.0 Django==4.0.6 django-heroku==0.3.1 gunicorn==20.1.0 psycopg2==2.9.3 pytz==2021.3 sqlparse==0.4.2
Anonymous
So there is one input field and one label Now whenever i input in input field it send ajax post request and then it save object Now i wan to show that changes in label!! How i can do it?? Without refreshing page
Gipss
Have u added {{ % load static %}} in ur template file ? Have u added the css file dir to STATICFILES_DIRS in settings.py ?
I don't use templates. I just wanted to add admin panel's files. I fixed with python manage.py collectstatic --ignore rest_framework
Anonymous
Basically i am doing cart And in cart, whenever i change qty it get saved to model And now i want to recalculate and show my totalAmmount with new qth which is saved on model
Maksim
All hi! How to solve this problem: "ModelForm has no attribute cleaned_data"?
Альбина
Yep: asgiref==3.5.2 dj-database-url==1.0.0 Django==4.0.6 django-heroku==0.3.1 gunicorn==20.1.0 psycopg2==2.9.3 pytz==2021.3 sqlparse==0.4.2
I realized that for some reason the Django-heroku was not installed into the venv, idk how to install it there, it only installs automatically to some other direction
S
All hi! How to solve this problem: "ModelForm has no attribute cleaned_data"?
How hav u defined ur forms.py and how hav u used that class in views.py ?
Maksim
I am sorry, i almost understand my problem in code. Need to write is_valid() and after cleaned_data()
S
I am sorry, i almost understand my problem in code. Need to write is_valid() and after cleaned_data()
When u create an object of ur defined form class, then is_valid() & cleaned_data() would be accessible through that object.
S
form object to be specific
Of course
Hi, who saw mosh django tutorial part 3 completely? İ have a question ❓
Maxim
Hi, who saw mosh django tutorial part 3 completely? İ have a question ❓
ask your specific question, don't ask meta-questions
Of course
ask your specific question, don't ask meta-questions
İn part 3 section Running background tasks İ can't run 3 localhost for celery , docker and Django in the same time. Please help me
Maxim
İn part 3 section Running background tasks İ can't run 3 localhost for celery , docker and Django in the same time. Please help me
don't ask me, ask the group what you said won't help you in any way describe exactly what is not working in detail don't refer to that tutorial, i don't think it describes anything unique
Of course
İ use Message broker(redis) in my project, and so İ must Eun three localhost for this. One for redis in docker, one for django manage.py and one for celery. But i can't do this Please some one help me
Anonymous
Hi everyone, I have trouble with uploading big files (more 1gb about), so when i upload big file my request is lagging, takes too long to jump to another line of code. So what can you advise? DB: sqlite3 This is my code models: https://dpaste.org/En0WS , https://dpaste.org/uuUhO#L10,11,16 ; view: https://dpaste.org/xJXV0 ; upload_func: https://dpaste.org/04fw9#L
Maksim
Say me reasons is_valid() = False
Maksim
please
Ajay
-----base..html ----
Ajay
https://nekobin.com/lehakehofe
Dave
For example if the user tries to access '.../5/edit' without being logged in, i want them to be redirected to '.../5'
Have you tried to override the get_login_url method? From there compose your redirect url and get the pk thru self.kwargs.get(self.slug_url_kwarg)
Neeraj
Extract all the fields data in list and create csv.. You can also use for loop for this if data which export into csv is less.
Krishna
I'm experiencing a ValueError at return an HttpResponse object. It returned None instead.
Krishna
Anyone can help here...in update view its throwing error
David
You code please~
Maksim
Why dont' validation USERNAME_FIELD