Ageev
You must collect all static files in some directory ( python manage.py collectstatic) and serve with files with nginx.
vaseem cholakkan
i want to fillText a string in the shape of heart to a html canvas
Doragonsureiyā
i want to fillText a string in the shape of heart to a html canvas
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
ROG 💻
Do you know how the user who added the data and who modified it could be saved in the model using the django-simple-history library? Although I have it added and it generates an audit of my model, the user who entered the data or modified it does not register.
ROG 💻
In my model named Orders I have it added to the end of the definition of the fields of my model like this: history = HistoricalRecords()
ROG 💻
Try digging through the internals of the library or documentation
I already did it but I didn't find anything directly related to what I need.
Lokesh
Okay then fork the repo and implement by yourself
Roqeeb
I'm currently developing a webapp using Django as backend vanilla for all frontend work but when run my frontend work without backend it looks great but if I try to run it inside back end environment everything is messed up
Roqeeb
Hey everyone i have small doubt when I run my application on local host application is working on chrome but when I run in edge it not working is there any settings problem
Exactly the same problem I'm currently facing when I run it on Firefox and chrome it's working perfectly fine but when I use chrome all the front end work is disarranged as if it's using css partially
Anonymous
heyy can someone help me figure out a django and s3 related code logic please
Doragonsureiyā
heyy can someone help me figure out a django and s3 related code logic please
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Anonymous
I am using elevenlabs api for tts. the api is sending me an audio file in return. i want to save that audio file in my s3 bucket and get back an url stuck with the logic part https://pastebin.run/-gwhb7pgw6m5
Adarsh
I am using elevenlabs api for tts. the api is sending me an audio file in return. i want to save that audio file in my s3 bucket and get back an url stuck with the logic part https://pastebin.run/-gwhb7pgw6m5
PFB code for the file upload # create the s3 object with your credentials s3.upload_fileobj( fileobj, settings.BUCKET_NAME, file_path, ExtraArgs={'ACL': 'public-read'} )
F
I failed 3 times to deploy my Django app on AWS, following 3 different tutorials, each time for a different reason. Any solid tutorial to recommend for that?
KingFx
try to deloy on pythonanywhere
F
Will give a look, thanks
Walter
hey guys can you tell me how to deploy my Django web application live and use postgres sql for free.its a E-commerce website for small scale home business.
Leonardo
install your dependences and see if have psycopg2...
Leonardo
to install dependencies: python install -r requirements.txt
Leonardo
See this example: https://github.com/LBarros77/egi-api
Rishav
I'm getting this warning please help. " You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions. Run 'python manage.py migrate' to apply them. "
Есбол
RuntimeWarning: Pickled model instance's Django version 3.2.18 does not match the current version 4.2.5. who faced with this
Maxim
RuntimeWarning: Pickled model instance's Django version 3.2.18 does not match the current version 4.2.5. who faced with this
you just can't use pickle to save model instance form Django 3.2 and restore it to Django 4.2
Jimmies San
You haven't done basic migrations. Just write "python manage.py migrate" in your console
This is not going to help him: if he cannot sort that problem out it means he didn't read any doc or googled the issue. Worst way to learn something
Eternity
It's not very good idea to change the database during the project
Saman
Hello have you every faced this issue ? : TypeError: Direct assignment to the forward side of a many-to-many set is prohibited. Use category.set() instead.
Saman
Hello have you every faced this issue ? : TypeError: Direct assignment to the forward side of a many-to-many set is prohibited. Use category.set() instead.
i'm trying to build a costume admin panel(using DRF) but i get this error while using post/put method to update or create a new product
Saman
yes, use category.set()
def update(self, instance, validated_data): instance.title = validated_data.get('title', instance.title) categories = validated_data.get('category', instance.category.all()) print(categories) instance.category.set(categories) instance.save() return instance i did but it gets the same error
Saman
i'm trying to build a costume admin panel(using DRF) but i get this error while using post/put method to update or create a new product
this is my code again : def update(self, instance, validated_data): instance.title = validated_data.get('title', instance.title) categories = validated_data.get('category', instance.category.all()) instance.category.set(categories) instance.save() return instance If I'm going through the wrong way to build this costume admin panel(DRF) and anyone has done it before, I would be so happy if he shares his experience with me
Haya
Developing a distributed application in the Django language using microservices technology that provides school management services. It includes three microservices: 1-Student admission service. 2-Student attendance service. 3- Registration service for one of a number of subjects (of your choice). •You must use API Gateway. this is my Assigment in University.I need to help me, to know what mean the microservices technology in Django and what mean the API Gateway in Django and what should make I'll make many app for each services in same project or make many project to each services that content one app ?
Jimmies San
and you are at university, you want to learn. so you should find out how to do it
Jimmies San
and btw people can help you with chores or tips or suggestions
Jimmies San
not making a project like that from scratch
Jimmies San
or do you pay for it?
Elilooli
hi I've started my first project in django and I can't get access to the "first project" localhost server, I use manage. py runserver it successfully runs it and give a link but the link gives "timedout" error. here's what I did to try and fix it but it did not: turned off firewall and proxy tried some different ports changed IPv addresses flushed DNS cashe deleted security policy for that server in my browser pinged the IP (it was working) I have no idea what else to do
User
How can I use multiple databases in django? Without configuring them in settings.py
SH
Is it possible to put data from one model to separate tables in admin page? For example, I have a class: class Book(BaseModel): name = CharField(max_length=255) genre = CharField(max_length=255, null=True, choices=("classic", "modern", "poetry")) In admin panel, for book model I want to see 3 tables for each ganre (it can be more than 3 ganre, it does not matter): An admin panel, in Book change_list I want to see: Classic books ===================== id | name | ganre | --------------------- 3 |b3 | classic| 4 |b4 | classic| 10 |b10 | classic| --------------------- Moder books ===================== id | name | ganre | --------------------- Poetry ===================== id | name | ganre | --------------------- 1 |b1 | poetry | 2 |b2 | poetry | 5 |b5 | poetry | 6 |b6 | poetry | ---------------------- All tables should be on the same page in admin panel, and be active for updating.
SH
Did i understand you correctly, you want to see more than one model at the same page in admin panel, do you?
No, I want to spread grouped data into different tables, all data are books. The columns are same, just grouped by 'ganre'
George
Hi, why i get this exception? i write it in Installed_app, but still get error ModuleNotFoundError: No module named 'django.contrib.registration'
Hamzat
Please I need help I am trying to send automated welcome email after user registration but I get the below error after my page loads for a while WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
𝒜𝔞𝔣𝔞𝔨𝔥
Truff booking details online payment method and delete method?
cj
How can I use multiple databases in django? Without configuring them in settings.py
without configuring in settings.py is not possible, settings file is mean exactly for that, to configure what you want Django to do did you read the documentation? https://docs.djangoproject.com/en/dev/topics/db/multi-db/
cj
Is that possible in any other framework?
you want to connect to a database dynamically, well you have to manually set the connection string on the driver you're using, it's not hard... but that's not how you should work... but ¯\_(ツ)_/¯
cj
But i need to configure one DB model to all the 100+ Database clients
you'd probably want to stop doing what you're doing and re-analyze your architecture
User
Apart from isolation
Muflone
It's a client requirement. Is there any downside?
It's not how django works, you have to repeat the migrations on every database which is not set
Gabriel
How can I use multiple databases in django? Without configuring them in settings.py
Using Database Routers is a good way. My Django/API access database credentials from AWS Secret Manager, and the password changes every week. So i need to get these ones on The fly. I use DatabaseRouters to do this. You can use to get which db u want too. Use the middleware to route the database based of client id. The problem is this happens each request, so u need a good perfomance algorithm and solution to not affect the request time so much
D
Hello guys I want to change image but it didn't change how to change please help me
Junior
Hello guys, i am doing a autentication using allauth, but i need custom views, and i dont find resources, anyone can help me?
Stanislav
Junior
Yes i want change code of views
Junior
Change redirect and show message diferent
Stanislav
Change it in the lib then if it doesn’t have a base auth that you could reimplement
Junior
Its alternative, what do you use to create authentication?
Jimmies San
But i need to configure one DB model to all the 100+ Database clients
no, usually multi db means: a cluster with writer and readers instances. usually.
Jimmies San
so, the replication happens at cluster level, not application level
Jimmies San
but via application you can query the writer or the reader, based on the logic of that bit of the application. and of course it means you have to configure them in the settings file, like someone else already said
Jimmies San
it assumes you know if you are going to write or just read
Jimmies San
however, you need to explain a bit more your specific use case because without that we can talk for years ending no where :)
Jimmies San
Using Database Routers is a good way. My Django/API access database credentials from AWS Secret Manager, and the password changes every week. So i need to get these ones on The fly. I use DatabaseRouters to do this. You can use to get which db u want too. Use the middleware to route the database based of client id. The problem is this happens each request, so u need a good perfomance algorithm and solution to not affect the request time so much
if you do that for every request you are going to hit two limits: secrets manager api rate limits, and db conns limits. you will need some kind of caching for the secrets [boto already has it], so you no need to fetch every time [it's crazy and expensive] and some connection pool for the db [like rds proxy or pg bouncer]
Jimmies San
if it didn't happen it's only because your app doesn't have a heavy load yet. be careful. i would fix this logic asap if I were you :)
Stanislav