Gio
🤚
I am going to pm you
Leonardo
How can I change the name of my class for the admin view? Example, I declaired a class named Certificate(model.Models), how can I change Certificate name to Certificado in my admin view?
Leonardo
But this is a manual change, its not a translation
Leonardo
https://docs.djangoproject.com/en/2.1/ref/migration-operations/#renamemodel
Leonardo
I found this but idk how to work with it
Taha
if I wanna learn Django from scratch to be hero, what should I do and what's the best plan to learn ?
Ghorz
if I wanna learn Django from scratch to be hero, what should I do and what's the best plan to learn ?
First learn HTML, CSS. Then python. If above criteria has been satisfied. Move on to django docs or better still duckduckgo.com it
Anders (izzno / gooood) 🇳🇴
if I wanna learn Django from scratch to be hero, what should I do and what's the best plan to learn ?
https://courses.edx.org/courses/course-v1:HarvardX+CS50W+Web/course/ Free, then do a django specific course.
Anders (izzno / gooood) 🇳🇴
If you have "some" basic knowledge of any programming you will be able to follow this.
Leonardo
I'm trying upload 3 pdf files, (1,15mb each), and when I save it's giving 413 Request Entity Too Large
Leonardo
I tried set 100M to client_max_body_size just for test it, but still not working at all
Raghava
Hi I am facing an isuue, this is in a function in my js file and it i'm running again and again: var recipients_dom = '<div id="private-container">'+templates.render('sidebar_private_message_list', {messages: display_messages, zoom_class: zoom_class, want_show_more_messages_links: hiding_messages})+'</div>'; The result is that the div tag is repeating and the template is just staying in the last tag, How can i make it stay in the first tag???
Mirco
gunicorn
No ngnix/apache ?
Leonardo
I tried set client_max_body_size 0M; to remove the limit, but not worked
Leonardo
I saw my request size too, it's just 784B
Jimmies San
where you have http { blabla
Leonardo
where you have http { blabla
yes, it's there, inside http
Jimmies San
yes, it's there, inside http
do you restarted the nginx after change?
Leonardo
do you restarted the nginx after change?
yes, sudo systemctl restart nginx
Leonardo
my nginx conf: https://pastebin.com/EETR7Ck0
Jimmies San
is 0M man
Leonardo
0 removes the limit
Leonardo
i tried 10000M too
Jimmies San
no limit is not good
Leonardo
i just removed the limit for test
Leonardo
i got this problem before, i set 30M, and worked
Leonardo
but i changed the class, and i'm uploading 3x files instead 1x now
Leonardo
but all of them are around 1,15mb
Leonardo
this is the page
Leonardo
just 3x pdfs
Mirco
Why ? 😁
Maz
Inboxed you...
Anonymous
How can i populate database with jason file
Anonymous
Any suggestion please?
cj
How can i populate database with jason file
JSON* where did you get that file at first? from a ./manage.py dump from another DB?
Anonymous
I have records in Jason file so i just want to populate record in database
cj
I have records in Jason file so i just want to populate record in database
JSON* it depends on how is the structure of that JSON file and if it matches your models fields definition too, the handy way is to load using json.load() and insert manually to your DB
cj
or... if you're lucky enough, using django import-export package
Anonymous
JSON* it depends on how is the structure of that JSON file and if it matches your models fields definition too, the handy way is to load using json.load() and insert manually to your DB
There are 5 millions of records so manually it will take too much time , i created model according to Jason file field structure
cj
There are 5 millions of records so manually it will take too much time , i created model according to Jason file field structure
then you can use ./manage.py loaddata your_json_file if it matches your models definition
Anonymous
Thanks
Leonardo
can someone briefly explain what exactly 'include' function does?
Leonardo
😒
Ghorz
There are 5 millions of records so manually it will take too much time , i created model according to Jason file field structure
Read the json file, loop through each row collecting rows as a set. Push to database for every loop
cj
😒
you got a valid answer 🤷🏻‍♂️
Ghorz
can someone briefly explain what exactly 'include' function does?
Include imports data, adds it to your current file
Ghorz
E.g
Ghorz
You can write an HTML form that can be reused for different form data, include can be used to import the form when ever you need to
Ghorz
import != include
It is in template dtl
cj
Include imports data, adds it to your current file
no, include includes a file into another, it doesn't import any data
Ghorz
Okay which ever way you understand the vocabulary
cj
Okay which ever way you understand the vocabulary
of course not... import is a totally different word than include 🙄 with different meaning
cj
In C : #include In Python : import What's the difference
the difference is the programming language and the context, in python, and according to this group, specifically in django, you use include to include other HTML files in your templates
Ghorz
They both add an external function, subroutine, class or file
cj
They both add an external function, subroutine, class or file
now you're out of the focus of the thread, nice 🤷🏻‍♂️
Ghorz
In pure python file import adds x in y, In DTL include adds x to y