Muflone
There is no way to fix this problem ?
Imagine you are browsing the web Would you be happy if websites could browse your personal files in your disk?
Muflone
Web applications use data in the server side In some cases they can use a local cache, visible only from the web browser
Kevelino
Ok. And what if I want to retrieve data from a form, save it in the database and then insert it into a template?
Kevelino
This is a NORMAL Django application
Thanks for your help. I just started with django so I don't know much but I try to improve every day. And it's a bit complicated because I don't speak English.
Muflone
Thanks for your help. I just started with django so I don't know much but I try to improve every day. And it's a bit complicated because I don't speak English.
Read the Django tutorial and you'll learn I don't know if it was translated in your language too, just check the Django website
Tԋҽ Gɾҽαƚ
mates, is it possible call in a viewset more than one serializer? DRF
Naggafin
mates, is it possible call in a viewset more than one serializer? DRF
you can override get_serializer() to have custom logic for this
Tԋҽ Gɾҽαƚ
I have tried, but I got an error
Naggafin
have you tried researching the error? what is it? worst comes to worst I would simply look thru the source code of DRF to make sure you're doing things correctly
Naggafin
that's often my approach for doing nitty gritty things with anything django. documentation is great, but browsing source is most informative
Tԋҽ Gɾҽαƚ
And u can help me
Naggafin
And u can help me
I'm afraid I cannot. I'm really busy right now. I can simply give general advice
Doragonsureiyā
Can I send you part of the code so you can see it?
To share code or error tracebacks, use a pasting service, like: - https://linkode.org - https://dpaste.org
Anonymous
How to add a button in Django admin dashboard ?
Muflone
How to add a button in Django admin dashboard ?
https://books.agiliq.com/projects/django-admin-cookbook/en/latest/action_buttons.html
Mr Alireza
I want help for an ai project
Doragonsureiyā
I want help for an ai project
No one can help you until you explain your difficulties.
Mr Alireza
In an ai project, I need help to design a small object recognition sensor for mobile hardware
Samadov Sevinchbek
https://dpaste.org/L8gU3
Samadov Sevinchbek
Muflone
https://dpaste.org/L8gU3
Read the error and show the urls file
Azizbek Xushnazarov
https://dpaste.org/L8gU3
do you have urlpatterns in weekdays/urls.py ?
mahdi
Hello friends, good time I have several heavy files, I want to execute_many in Python I want to open MySQL database But my time is too much when executing That is, it inserts a file with 2 million data in 10 to 12 minutes Is there a solution to reduce this time? About 15 million should be added in 5 minutes
Doragonsureiyā
These single steps will help you a lot: 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
Anonymous
Hi please i need help
Anonymous
I don't success to create a simple model on Django
Azizbek Xushnazarov
Максим
hi, have two apps in my project: finance (no models), employees (model - Employee: email, name, surname, role). I need to add fields 'salary' and 'total_income' to Employee model, but I can't figure out how to implement this, in the 'finance' app - EmployeeFinances: Employee (FC), salary, total_income. Or just add two new fields to the Employee model - Employee: email, name, surname, role, salary, total_income.
Muflone
What's the problem
50% of people here asks invalid questions and never explain the real issue when you ask the problem
Anonymous
What's the problem
After creating my Django project, I created a models.py file in the project directory.Yesuite I created a simple model: from django.db Import Models Person class (Models.model): Last_name = models.charfield (max_length = 30). Then I added the directory or is my models.py script and when I run the command: Python Manage.py MakeMigrations There is no error, here is the message of the console: NO Change Detected. Django does not execute my migrations and yet there is no error message
vijay
Use python.py makemigration yourappname
Anonymous
Anonymous
Use python.py makemigration yourappname
Makemigration without 's' in the end?
vijay
Makemigrations*
Anonymous
vijay
Or send settings.py file
Anonymous
Or send settings.py file
Okay my campsites don't have network Connection
Anonymous
*my computer
Anonymous
Use this
It does not always work, here is the message of the console: NO Change Detected
Muflone
No no
Add a new field to the same model and try again if it detects the changes
Anonymous
when I created my project Django there was no models.py file
🐺WolfFang 🐺
when I created my project Django there was no models.py file
Thats maybe because you need to start an app first
Muflone
when I created my project Django there was no models.py file
The models file can be found in the application directory, not the project's
🐺WolfFang 🐺
Try django-admin startapp app-name
🐺WolfFang 🐺
Try django-admin startapp app-name
That normally came with an models.py
🐺WolfFang 🐺
And use python manage.py migrate
Anonymous
Try django-admin startapp app-name
I have created project with that method
🐺WolfFang 🐺
I have created project with that method
Did you try after startproject?
Anonymous
So weird 😭 I get stuck
Muflone
So weird 😭 I get stuck
You're confusing project with app
🐺WolfFang 🐺
No
You must first start a project and then an app
🐺WolfFang 🐺
The app will be inside of the projects
Anonymous
Please which command I have to use for create an projet and start app
🐺WolfFang 🐺
django-admin startproject mysite cd mysite python manage.py startapp polls
Anonymous
You're confusing project with app
😂😂😂😂😂😂😂 thankful you are right 😁😁😁😁😁, I am one of the most stupid computer scientist in the world 😄
Shaheen
if i wanna to create model and i include many fields then i have to put any one field to be a primary key?
Anonymous
Not really a must be it's good practice
Anonymous
if i wanna to create model and i include many fields then i have to put any one field to be a primary key?
By default if a primary key is not added to a model Django have a default field pk that stands as an Id for each data stored in that model but production wise I don't think that's a great idea it's better to have an id column with uuid values then assign primary key to it
Anonymous
Why is it better? In case of migration or what?
The uuid value is not predictable you can also use other means but I'm just saying its not a good idea using Django default auto field as an id in production
Maxim
moonkin
it has random value
Thanks, and why is it a problem? I'm currently using default pk in my pet project, it seams fine and it actually assign ints indexing from 1... So I'm kinda confused now
Anonymous
UUID Globally unique. e.g. No false positive for finding items using log. Easy for migrating data between systems since collision is only theoratically possible. Stateless, it can be generated on the fly. A sense of secure since malicious user can't guess the ID. Not naturally sortable according to creation time. Not readable. Django default id/auto increment Readable. This is especially valuable if we would expose it externally. Thinking of issue id, obviously, issue-123 is much more readable than issue-b1e92c3b-a44a-4856-9fe3-925444ac4c23. Less space. UUID always occupies 16 bytes. It can't be generated on the fly. Instead, we must consult the database to figure out the next available primary key. Some business data can be exposed, since the latest ID could represent the total number of inventory. Attackers can also scan the integer range to explore leakage (though it shouldn't happen if ACL is implemented correctly). It can't be used in the distributed system since it's quite likely that different hosts could produce exactly the same number.