JayJo
Image Fields is not working
Charly
Image Fields is not working
And how we are supposed to help with no details at all?
JayJo
Every data is displayed from database on frontend but not images
Muflone
This seems a rebus no one wants to solve
Rana Awais Ahmed
Every data is displayed from database on frontend but not images
When you need to show the image in the template use img tag and display your field like {{model.image.url}} in the src
Rana Awais Ahmed
If you need to upload image using a form the give the attr enc_type to the form tag. Also you should set media files address in your project files and point to it in the settings
Lords
hey,everyone when I am trying to access admin panel through DNS getting error CRSF token verification failed how to resolve these issue Thankyou in advance .
Eki
good morning friends, I want to ask, how do I enter data that is not looped into a Python class, my data is type queryset, if I loop first, only 1 data comes out but I need all the data
Eki
objPD = ProdAllocNewD.objects.values( 'bundle__pk', 'prodalloc__line__divdesc', 'bundle__style', 'bundle__orc', 'bundle__color','bundle__expdate', 'prodalloc__dateAlloc', 'bundle__qtyord', 'prodalloc__targetHour', 'prodalloc__manPower', 'smv', 'prodalloc__pk', 'prodalloc__startTime', 'prodalloc__finishTime').annotate(qtyAlloc=Sum('qtySizeAlloc')).filter(prodalloc=data)
Eki
This is an example of queryset data
Eki
detail.append(SewingDash(ai['bundle__style'], ai['bundle__color'], ai['bundle__orc'], ai['bundle__qtyord'], objSum1['total'], objSum_in['Tot'], objSum_in['Tot']-objSum_out['Tot'], objSum2['total'], objSum_out['Tot'], Efff))
Eki
This is an example of a Python class
Suyash
Can anyone tell how to redirect to another url with POST request. Actually there are two forms on two different page. The second one is a succession of the first one so I want the data filled in first form on page 1 to be post to page 2 also. HttpResponseRedirect(reverse('url')) is redirecting with get request.
Maleficent
How to install django in ubuntu
عبد القيوم
How to install django in ubuntu
just write this command on terminal pip install django. Note it is recommended to install django in seperate env
dvd
I am deploying DJANGO into production with gunicorn and nginx, my web is working but my static files are not showing. I get a 403 forbidden error. In the error.log file I get this error: [error] 1478#1478: *49 open() "path/for/image.png" failed (13: Permission denied). Can someone help?
dvd
sure
Миркамол
are you change static url after change debug to false
dvd
It is a permission thing, my setup is everything done
Lords
okay thankyou
Q
Can form templates be stored in the Db?
Suyash
Move to first form and store data into session then redirect to be 2nd form
actually request.session is also not working for my purpose because I am trying to store password field of a form in request.session. Actually it is a signup form with otp validation so I require two form page one for data username and password and other with otp sms so that when otp is correct I can create a User in django model
Suyash
Session works with redirect
it is giving other data that I stored in session but not the password field
Suyash
Session works with redirect
actually it is storing. It was my mistake. Thank you.
JayJo
I'm getting error as unidecode error while run template
Runserver
worksuite-saas-new Please how to install the worksuite-saas-new sms module and change the name and adapt a default verification code
deficiente ✙
???
maybe this will help: https://stackoverflow.com/questions/14653056/django-saving-form-to-database
ERMIA
How to install django in ubuntu
sudo apt install python3-django NOTE: that is needed if you want it as a command
cj
sudo apt install python3-django NOTE: that is needed if you want it as a command
no please, no... use a proper virtual environment and pip
ERMIA
no please, no... use a proper virtual environment and pip
I though he asked about global package.
Ali
Hi I searched about django channels long time in youtube and.... But all examples are chat project. Is django channels just for chatting applications?? I need to realtime data and django for backend. What is the best choice?
cj
Hi I searched about django channels long time in youtube and.... But all examples are chat project. Is django channels just for chatting applications?? I need to realtime data and django for backend. What is the best choice?
a chat project is the easiest one to show how to use websockets in a Django project using Channels, you can use it to build any project you want where you want to have those capabilities, of sending/receiving data without the need of reloading a page —call it "real time" if you want ¯\_(ツ)_/¯ —
Nazda
How to apply CSS code in my Django administrative page
ERMIA
How to apply CSS code in my Django administrative page
The way I used was like replacing the static file, but I beleive there are many libaries
nyctophile
Hi there! I have question: Can I change images name before saving it into a folder. If it is possible can you show me ways or give me advices ?!. I am using ModelViewSet in rest framework. Can Anyone help with that. Any help appreciated
Mahan
How can I say in this code, if the product is equal to the vase, add the vase? class CartAddView(View): def post(self, request, pk, ): product = get_object_or_404(Product, id=pk) pot = get_object_or_404(Pot, id=pk) quantiy = request.POST.get('ms_qtybtn') cart = Cart(request) cart.add(product, quantiy) cart.add(pot, quantiy) return redirect('cart:cart')
▂▃▄▅▆▇█▓▒░Dube@Tes$Bel░▒▓█▇▆▅▄▃▂
how i install django for python 3.11.4 ??
clouded
how i install django for python 3.11.4 ??
https://docs.djangoproject.com/en/4.2/intro/install/
▂▃▄▅▆▇█▓▒░Dube@Tes$Bel░▒▓█▇▆▅▄▃▂
Maxim
what
virtualenv
▂▃▄▅▆▇█▓▒░Dube@Tes$Bel░▒▓█▇▆▅▄▃▂
virtualenv
how i do that
Maxim
how i do that
https://www.google.com/search?q=python+virtualenv and/or https://www.google.com/search?q=django+virtualenv
Tamerlan
How can i do livestreaming in django
Doragonsureiyā
How can i do livestreaming in django
These single steps will help you a lot: Step 1️⃣: Open a browser Step 2️⃣: Write down https://google.com or https://duck.com and press Enter Step 3️⃣: In the search box, write down the same words you asked here Step 4️⃣: Read the first results
Tamerlan
I wrong explain my maind i want create platform look like udemy. I want upload video to server. I i do not want the user can not see the url of video. That is why i think it is posible with streaming video. How can i do streaming with drf
Doragonsureiyā
I wrong explain my maind i want create platform look like udemy. I want upload video to server. I i do not want the user can not see the url of video. That is why i think it is posible with streaming video. How can i do streaming with drf
These single steps will help you a lot: Step 1️⃣: Open a browser Step 2️⃣: Write down https://google.com or https://duck.com and press Enter Step 3️⃣: In the search box, write down the same words you asked here Step 4️⃣: Read the first results
Daniel
I'm trying to get rid of trailing slash from urls. Currently the web-server successfully removes slashes and APPEND_SLASH = false Everything works fine but I have a problem with the localized homepage: http://example.com/en/ - ok http://example.com/en - Page not found (404) I add this class to Middleware: from django.shortcuts import redirect from django.utils import translation class RemoveTrailingSlashFromMultilingualURLsMiddleware: def init(self, get_response): self.get_response = get_response def call(self, request): response = self.get_response(request) # Check if the URL ends with a language code and a slash language_code = translation.get_language() if request.path.endswith(f'/{language_code}/') and request.path != f'/{language_code}/': new_path = request.path.rstrip('/') return redirect(new_path) and add MIDDLEWARE to setting: MIDDLEWARE = [ # ... other middleware 'blog.middleware.RemoveTrailingSlashFromMultilingualURLsMiddleware', # ... other middleware ] But it doesn't work and keeps giving 404 not found error if possible help me to solve my problem
Doragonsureiyā
Aleksey
Is it possible to write all sql queries to a dedicated log when DEBUG=False? Here's my logging setup (https://gist.github.com/happygrizzly/97efded0289456ad29a3bffa86e7dd2f). There's no output with DEBUG=False. Is it in the end required to have DEBUG=True? Is having custom wrappers/interceptors the only option then (like this: https://stackoverflow.com/a/56281311/532675 or like this: https://github.com/gruuya/django-sql-sniffer) ?
Ingvarr
Hello everyone! I've got an issue recipes = Recipe.objects.filter( ingredient__food__name__in=include_ingredients, ).exclude(ingredient__food__name__in=exclude_ingredients) I want this code to get only that recipes, which include/exclude all the food names in lists. If there is at least 1 ingredient that not in include_ingredients, this recipe should be skipped
Ingvarr
Oh sorry, i figured it out by myself. it was a dumb issue
Mahan
hi i want use multiple products in django and i see this error No Product matches the given query.
DeathLikeSilence
hello everyone. I have 3 different models Customer Seller Owner I wrote AUTH_USER_MODEL=” accounts.Clients” In setting.py Can I use JWT to authenticate them?
حسناء عياش
hi i try to connect mysql to django by writing in terminal : pip install mysqlclient or pipenv install mysqlclient but the error "microsoft visual c++ 14.0 or greater is required" is raised so i intalled the vs tool required from Microsoft visual installer and i tried again: pip install mysqlclient or pipenv install mysqlclient but the error "command ....../cl.exe failed with exit code 2" is raised and in two cases i have the error "Failed building wheel for mysqlclient & could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects" any one know the solution of this problem?
Daniel
https://scrnli.com/files/Kxxw2II73LwN9f
Anton
https://scrnli.com/files/Kxxw2II73LwN9f
Did you use routers or you defined endpoints by yourself? On what endpoint the issue is?
Daniel
Did you use routers or you defined endpoints by yourself? On what endpoint the issue is?
I put this code in the settings file APPEND_SLASH = False and I removed / of end urls, all urls work good, just i18n pattern don't change to without slash, main this en/ ----> en
ROG 💻
Does anyone know if a Django project can be integrated with JasperReports for report design?
cj
Does anyone know if a Django project can be integrated with JasperReports for report design?
for report design? no... you have to have already the report designed in Jasper, and later, yes, you can integrate Django to fill that report with the desired data
Charly
Does anyone know if a Django project can be integrated with JasperReports for report design?
A simple google search: https://code.djangoproject.com/wiki/PDFWithJasperReports