Firdavs
I am sending the models in the admin panel by django-telegram-bot package. How can I make it more beautiful. For example, model and pk are not required
Firdavs
serialize('json', Products.objects.filter(user=request.user), fields=('name', 'price','image') , cls=LazyEncoder) the result is [{"model": "ecomerce_app.products", "pk": 6, "fields": {"price": "210", "image": "products-images/d91ac612e0775c7453230ea6b46429672020071818331244825vEefbWM37d1.jpg"}}] how can i do it beatiful i need only fields
Firdavs
use a Serializer, a ModelSerializer from DRF
i use it for telegram bot send
Mirco
i use it for telegram bot send
so ? you can use the serializers, it does not matter Telegram bot or not
игорь/igor
still it gives same error
Ubuntu or windows?
Dd
Ubuntu or windows?
I am using it on python anywhere .com works fine for windows
Mirco
still it gives same error
u have something already running automatically on that port
Dd
I am using it on python anywhere .com works fine for windows
Pythonanywhere uses linux bash Iam getting some error for virtualenv there as well
Dd
u have something already running automatically on that port
Yeah I tried to kill it with sudo kill or some similar command
игорь/igor
I am using it on python anywhere .com works fine for windows
Why do you use development server on pythonanywhere?
игорь/igor
You need to configure wsgi, right?
Dd
Wsgi shows mysite not found
Dd
If you can I can share git with you
игорь/igor
It means you misconfigured wsgi, probably the path
Dd
Wsgi shows mysite not found
But mysite is there
Dd
It means you misconfigured wsgi, probably the path
Configuring wsgi means running it with python right or is there other concept
игорь/igor
Configuring wsgi means running it with python right or is there other concept
https://help.pythonanywhere.com/pages/DeployExistingDjangoProject/
Optimus
In CreateView , which method invoke 1st on posting data?
Optimus
post()
what about form_valid()
Optimus
thing is i want to modify request.POST before object create processing
Mirco
what about form_valid()
form_valid will be called before saving the instance So yeah you can use it to manipulate before saving
Optimus
i need to manipulate in some other method
Mirco
i tried in form valid but not working
Share code and we will help u better
Mirco
With pastebin obviously
Optimus
Share code and we will help u better
i can do in get form class method
Mirco
i can do in get form class method
I don't know the context, so I cannot say yes or no
Dd
i didnt quite get the wsji section
# This file contains the WSGI configuration required to serve up your # Django app import os import sys # Add your project directory to the sys.path settings_path = '/home/username/username.pythonanywhere.com' sys.path.insert(0, settings_path) # Set environment variable to tell django where your settings.py is os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' # Set the 'application' variable to the Django wsgi app from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
Anonymous
Can anyone tell me login and registration django rest frame work project
Anonymous
Bckend side
5P34R
i prefer u to google and youtube there's a tons of video and tutorials available
Doragonsureiyā
Can anyone tell me login and registration django rest frame work project
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
#me {display: none;}
guys, hello, could you help me? how can i equate char 'ё' to 'е' and vice versa for searching in varchar fields in db by ORM?
Harish
https://dpaste.com/7CL96SP2S Couldn't find where the issue is coming from. And also it happens occassionally only. Would be helpful atleast to know from where should I start debugging. Edit: It causes user to auto logout from portal giving 401 eventhough user is authorised. And happens only for the first login, doesn't occur at successive logins.
Sreekanth
How to move our django project local host to live ? Pls explain
Joseph
How to move our django project local host to live ? Pls explain
Do you want to host it on cpanel or herouko
Joseph
Herouku or anywhere..
Have you added Procfile
Sherlock
in settings.py file i'm confused with the meaning of STATICFILES_DIRS , STATIC_ROOT, BASE_DIR plz help😊
Alex
in settings.py file i'm confused with the meaning of STATICFILES_DIRS , STATIC_ROOT, BASE_DIR plz help😊
Here you go buddy. https://docs.djangoproject.com/en/3.2/ref/settings/#std:setting-STATIC_ROOT https://docs.djangoproject.com/en/3.2/ref/settings/#std:setting-STATICFILES_DIRS and BASE_DIR is simply your project directory, auto generated by django-admin startproject
Süleyman
Django ninja
Alex
Thank u Alex 😊😊
you can use python manage.py shell and there from django.conf import settings to inspect your project settings
Alex
@euler1 don't dm people without their permission or you will be sent into GULAG
Sherlock
just like BASE_DIR is generated by django itself does STATIC_URL, STATIC_ROOT, MEDIA_ROOT, MEDIA_URL are also auto generated by django itself, or user defined like variables ? 🙏
Alex
they are set by django, but you can override them
Alex
actually you can set any variable in the settings.py and it will be assigned to django.conf.settings. Like FOO = 'bar' and then settings.FOO
Sherlock
actually you can set any variable in the settings.py and it will be assigned to django.conf.settings. Like FOO = 'bar' and then settings.FOO
can u please tell any source from where to read all this, i'm noob learning django django doc is hard to follow as of now
Alex
can u please tell any source from where to read all this, i'm noob learning django django doc is hard to follow as of now
> except django doc I have bad news for you, mate..... There is also "two scoops of django" wich is very recommendable, but it is more like a style guide or a set of recommendations, not documentation or tutorial
_karimoff_1904
Hi guys as i add static changes it is not updating in site
Doragonsureiyā
Hi guys as i add static changes it is not updating in site
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
Вин Король Саксов
ford
https://twitter.com/djangoproject/status/1424724645463302147?s=09
Alex
Try clearing your browser cache
or to turn off/on his computer
Maxim
Somebody please offer help on this.
google that is not a Django-specific problem
Alex
google that is not a Django-specific problem
Not sure File /usr/lib/python3.6/socketserver.py, line 724, in __init__ self.handle() File /usr/local/lib/python3.6/dist-packages/django/core/servers/basehttp.py, line 171, in handle self.handle_one_request() As far as I understand, the client connection is handled by django's dev server. Or I'm interpretating it wrong.
Maxim
Ok
is it possible that Django took a very long time to prepare a response to these requests?