Charly
Why would you use ngrok if it's localhost?
Karthik
So what URL are you using with postman?
http://localhost:1337/api/debates-informations Something like this, and it is working fine on postman and chrome ...
Karthik
Why would you use ngrok if it's localhost?
Just figuring out a way to make it run .... https://d65e-2401-4900-8662-acfe-54e2-1f95-11ba-ae7c.ngrok-free.app -> http://localhost:1337 This link forwarding all the request on this url to localhost:1337 .... using this link it is working in django .... but is not a permanent solution ... don't know what's happening
Karthik
https://stackoverflow.com/questions/74168873/nuxt-strapi-connection-refused Apparently it is a common issue, I also found a thread on strapi's forum but couldn't found any proper solution till now...
Sam
Guys i have a file field in my model and i have a file full_path too! (sth like this: 'C://Desktop/picture-1' now my problem is, In the default django`s instance creation you can`t pass the file path, You must pass the FILE itself. Due to my frontend problems i can`t send the file itself, is there any way to fix this ?
Bekzod Juraev
If i have second database in my Django project and in second database has tables in order to fetch i should define these tables in my models or i can interact without that?
Good
How
Can we have chat dm me yrrr
Вова
Hi, how can I resolve a bad caching problem? e.g suppose that I have a link for my js script in the html page, aka <script src="{% static 'path?v=1' %}"></script> but '?v=1' transforms into something not readable, and script can't be reached
Mohammad Hossein
Hi I have a "chatroom website" project that has 3 models for the membership: 1. User 2. Room 3. Member The Member model has these 2 primary fields: user and room 🤷‍♂. So it connects the user and the room he/she's joined as membership. Do you think there is a better way to do that? The idea just came up to my mind and i don't know that's principle or not
主教
OK
Doragonsureiyā
OK
What are you talking about?
乇PIPHANY❦▧▧❄️
so I have a model charfield called truth and in truth there's about 80 objects how can I retrieve a random object from truth to my template with the click of a button?
乇PIPHANY❦▧▧❄️
I would make a random function and make the button run that function
the random.choice doesn't work with the modelfield I'm guessing because it's in the database or smt
Bekzod Juraev
How i can migrate second database?
Disami
Hey guys i was trying to create customUser that have will add additional attribute than that of default which it's value will be computed from.the method of the class but i am confusing where to define this method 1 at the model class itself 2 at customusermanger class 3 at drf serializer class
Nerd
I think you can override the default save method and add your logic
Nerd
class CustomUser(BaseUserManager): computed_field = models.IntegerField(default=0) # computed field def compute_value(self): return value def save(self, *args, **kwargs): self.computed_field = self.compute_value() # Call the original save method super().save(*args, **kwargs)
Disami
Thanks buddy
Bayram
Hello Everyone, i try to do task with redis and celery in Django REST. I try to remove with task verification codes from db, every 5 minutes
Bayram
Tasks received but not done
Abhi
Abhi
Is it possible add second database to Django then extend existing model in second database??
Yaa sure you have to create if conditions i also used sqlite and MySQL both in one project
شادمهر
I have a model called userpost in models.py, now inside userpost I have a method like this def get_absolute_url(self): return reverse ('profile',args=[self.id]) And in the navabar.html I write href="{{userpost.get_absolute_url}} In the urls.py path('profile/<int:id>/',userprofile.as_view(),name='profile') But idk doesn't work for me what's the problem
Angel
What library do you recommend for making graphs, some of them with a logarithmic scale?
Bayram
settings.py CELERY_BROKER_URL = 'redis://localhost:6379/0' CELERY_RESULT_BACKEND = 'redis://localhost:6379/0' CELERY_ACCEPT_CONTENT = ['json'] CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json' CELERY_TIMEZONE = 'UTC' CELERYD_CONCURRENCY = 1
Bayram
celery.py from future import absolute_import, unicode_literals import os from celery import Celery from celery.schedules import crontab os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'e_commerce.settings') app = Celery('e_commerce') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks() app.conf.beat_schedule = { 'delete-expired-verification-codes': { 'task': 'core.tasks.test_task', 'schedule': 60.0, }, }
Bayram
__init__.py from future import absolute_import, unicode_literals from .celery import app as celery_app all = ('celery_app',)
Bayram
please help me, i try to do tasks via celery and redis but it is not execute
greenspectactles
Hi could someone help me with the best way to do fuzzy search in a select2 dropdown? I tried fuzzywuzzy and rapidfuzz But they are not that fast. Anything else I could do, Any pointers would be immensely helpful
Siddharth
hello frends please help me for ocr project
Minilik_muluneh
Should I use all the installed app functionality in my app developed by django. I use admin app for crud and Auth app for authentication?.what if I didn't explicitly use them in the web app or web site? Thanks
Siddharth
ok dear let me create and response to you
Doragonsureiyā
hello frends please help me for ocr project
No one can help you until you explain your difficulties.
Meenzu🔥
Static is not working
ANIRUDH
Iam building a application like Salesforce CRM. But i couldn't make better user model for this application. I try to make custom user model with AbstractBaseUser. What is the best way to create auth account model and profile for this sass model.
Doragonsureiyā
Григорий
Hello everyone! Please tell me if there is any way to connect a static image to the site from css using the background-image. I know there is one way to connect using the style description in the tag, but it seems to me that you can get confused and this is not a best practice
Григорий
That's how it doesn't connect either background: url("{% static 'main_imgs/bg.jpg' %}");
Григорий
And it works when I write directly in the tag, like this <body id="main_body" style="background: url('{% static 'main_imgs/bg.jpg' %}')">
Григорий
It seems to me that it is possible to write it more correctly. Suddenly there is a way to better support the code
Achiever’s
I want help in connecting elasticache with django
Doragonsureiyā
I want help in connecting elasticache with django
No one can help you until you explain your difficulties.
乇PIPHANY❦▧▧❄️
I've set up a registration page that check if the password are matching buh I realized when a user wants to register the account will be created along as one box like either username or email or password is specified so how can I make it mandatory to fill up each of them
乇PIPHANY❦▧▧❄️
buh it doesn't change
Mohammad Hossein
buh it doesn't change
Well there should be a problem in your code. otherwise it shouldn't register users without all of the fields provided
Mohammad Hossein
only username seems to be the required code
I haven't seen your code so I don't know what exactly the problem is, but your view code should have something like this: if 'username' not in request.POST or 'email' not in request.POST or ...: return HttpResponse('error') # your main code
park seo joon
Please I need help in. django rest framework can I ask here
park seo joon
Okay here is my code
park seo joon
https://hastebin.com/share/sumecogawe.less
park seo joon
At the last part where a book is deleted I want to use a url to redirect the person back but it's gives an error instead
Charly
At the last part where a book is deleted I want to use a url to redirect the person back but it's gives an error instead
In a rest API you don't do redirects you manage that in the frontend or the client code
Charly
Sorry but do you understand the API should return JSON always?
park seo joon
Sorry but do you understand the API should return JSON always?
Yes I mean I should just pass a string with message
Charly
Yes I mean I should just pass a string with message
No, no messages just a 200 status code
park seo joon
Angel
I'm asking for some library that is easy to integrate with Django (of course)
Maxim
I'm asking for some library that is easy to integrate with Django (of course)
first of all, you're confusing graphs with charts second, you're clearly talking about frontend, while Django is a backend framework (with frontend support at a basic level) moreover, you are almost certainly interested in JS libraries, which Django has nothing to do with
Ssergi0o
How to use react with django, when u utilize authorization, as far as i know i need to use JWT can anyone help?
Doragonsureiyā
What library do you recommend for making graphs, some of them with a logarithmic scale?
This is not a Django specific question, please delete your offtopic message. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.