How to ignore the get_valid_name to sanitize the space and special characters
Stack Overflow » Django
by Sakthi Panneerselvam
30m ago
When we are uploading the files to azure storage via django, it's adding underscore if space or special characters are there in the filename and it's disturbing the functionality. Is there anyway we can ignore it or change it. I tried multiple suggestions but it's not working like custom storage options. If i'm trying the custom storage options, it's not uploading in blob storage but it's uploading project folder. Refer the code below i tried in custom storage, from django.core.files.storage import FileSystemStorage class CustomStorage(FileSystemStorage): def _save(self, name, content ..read more
Visit website
How to connect htmx with webstocket
Stack Overflow » Django
by Aneeb
30m ago
I am building a real-time chatroom using htmx connect with webstocket in Django, when I try to send a message, the message is not showing and I am getting this error in the terminal "HTTP GET /?csrfmiddlewaretoken=frNekEsvdZ6jdJp7gYMF7pvXpnO11m3J3vOpJ7XCsAKLogIBuUpuKizmufpWRKxN&body=hi+aneeb 200 [0.04, 127.0.0.1:54773]" here my asgi.py file: import os from django.core.asgi import get_asgi_application from channels.routing import ProtocolTypeRouter,URLRouter from channels.security.websocket import AllowedHostsOriginValidator from channels.auth import AuthMiddlewareStack os.environ.setdef ..read more
Visit website
How to implement voice activity detection and stop Twilio voice bot on customer interruption?
Stack Overflow » Django
by PAWAN BISHT
2h ago
I am building a voice bot using Twilio and Django. I have set up an outbound call with media streaming, which is working fine. However, I want to implement voice activity detection so that if the customer interrupts while the voice bot is speaking, the bot stops speaking immediately. I am looking for guidance on how to achieve this using Twilio's Media Streams feature I have set up media streaming for the Twilio outbound call using the verb in the TwiML response. This is my view: '''python class StartOutboundCallingView(APIView): client = Client(sid, token) def post(self, request, format=Non ..read more
Visit website
Django models cannot be queried due to missing id field?
Stack Overflow » Django
by Syllogism
6h ago
I currently am working on a django project for a discord bot. the issue that I am trying to resolve is that I cannot seem to query the data for one of my models. A piece of information that has been unclear to me that I am sure caused this issue was a series of migration issues I had trying to update my Character model with new relationships to the InventoryInstance model in a seperate app. when I boot up a django shell_plus session - I get this error when trying to query the Character Model: located in inventory.models In [1]: Character.objects.all() Out[1]: OperationalError: no such column ..read more
Visit website
How do I ensure my API can't process the same method simultaneously
Stack Overflow » Django
by Akari Oozora
6h ago
I have a method in my API that handles the sync operations with the company's ERP. This method is called once every 30 minutes by a script I made to ensure that everything will be always up date. However, if someone wants, they also can make a request to the endpoint by themselves, but they also need to be informed if the operation is currently processing or not So, my solution is: I keep a flag on the database and set it to true when the transaction ongoing and false when it ends, so my application will check it and proceed/stop based on this condition There's just one problem: as I'm keeping ..read more
Visit website
ChatConsumer() missing 2 required positional arguments: 'receive' and 'send', what's the mistake?
Stack Overflow » Django
by Super DReik
8h ago
I can't understand why I'm getting an error. I've tried different approaches, but I still encounter an issue with consumers.py. What's the problem, and what am I doing wrong? messaging_users/routing.py from django.urls import path from channels.routing import ProtocolTypeRouter, URLRouter from channels.auth import AuthMiddlewareStack from messaging_users import consumers websocket_urlpatterns = [ path('ws/messaging_users/', consumers.ChatConsumer.as_asgi()), ] application = ProtocolTypeRouter({ 'websocket': AuthMiddlewareStack( URLRouter( websocket_urlpatterns ..read more
Visit website
Why is django class-based_view not seeing my uploads?
Stack Overflow » Django
by David LE
11h ago
class MultipleFileInput(forms.ClearableFileInput): """ Work around for `widget=forms.ClearableFileInput(attrs={'multiple': True})` >> `widget=MultipleFileInput(attrs={'multiple': True})` """ input_text = 'Select' clear_checkbox_label = 'Clear' initial_text = 'Current' allow_multiple_selected = True class UserUploadForm(forms.ModelForm): file = forms.FileField( widget=MultipleFileInput(attrs={'multiple': True}), required=True, validators=[FileExtensionValidator(allowed_extensions=['csv'])], ) class Meta: model = UserUpload fields = ['file ..read more
Visit website
Filtering DataFrames in a Django Dashboard
Stack Overflow » Django
by Gustavo Santos de Paula
12h ago
I am trying to build a Dashboard with Django... I wish to filter the dashboard with category, month and Year. The dataFrame is coming from python code than I am adding the charts with JS. I don't know how to proceed to be able to filter it as I want. views.py: def get_expense_api_data(request, *args, **kwargs): sort_order = ['January','February','March','April','May','June','July','August','September','October','November','December'] exp_df = pd.DataFrame(Expenses.objects.filter(user=request.user).all().values('date_created', 'amount')) categories = dict() if exp_df.empty ..read more
Visit website
Raise ImproperlyConfigured("SECRET_KEY setting must not be empty")django.core.exceptions.ImproperlyConfigured:The SECRET_KEY setting must not empty
Stack Overflow » Django
by Fares Nagy
12h ago
I published my Django project into github and I had a lot of variables that stored in .env for secure. And when anyone clone that project and migrate its not reading variables in my .env file that saved in .gitignore. is there any solution without showing these value of the variables, or it's ok and no danger to show this info? ``` import os from pathlib import Path from dotenv import load_dotenv load_dotenv() SECRET_KEY = os.getenv('SECRET_KEY') CURRENT_HOST = os.getenv('CURRENT_HOST') DATABASE_NAME = os.getenv('DATABASE_NAME') DATABASE_USER = os.getenv('DATABASE_USER') DATABASE_PASSWORD ..read more
Visit website
Html button not work on each click - hot to debug it? (chrome)
Stack Overflow » Django
by andrew
12h ago
I've got a (django) app, that displays a page with videojs-record, with ability to record something and send to backend. In general both recording and sending works fine. But - after recording there is a button to send (button with id=submit), and the click there works sometimes immediately, sometimes, I need to click it two or three times, to make it work. After sending, the button is hidden, and another one is showed to move to next question. And the behaviour is similar - it works sometimes, and sometimes needs to be clicked couple of times. I've no idea how to debug it... {{questionText ..read more
Visit website

Follow Stack Overflow » Django on FeedSpot

Continue with Google
Continue with Apple
OR