Anton
Thanks
₩almer
when using save() to update the data they are inserted with parentheses and apostrophes in the table. anybody?
Hasan
Hi I installed Django and created a project, but when I select path from the command palette and paste the address, nothing happens and Json settings are not created. (in vs code) Where is the problem?
₩almer
What are you talking about?
so recover the data in the form
Doragonsureiyā
so recover the data in the form
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
₩almer
view.py
Doragonsureiyā
view.py
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://linkode.org, https://nekobin.com (or your favorite one)
₩almer
ok
₩almer
form = ClienteForm(request.POST or None, instance=cliente_antigo) if form.is_valid(): cpf_cnpj = form.cleaned_data['cpf_cnpj'] ...... liente_novo = cliente.Cliente( cpf_cnpj=cpf_cnpj, nome=nome, sobrenome=sobrenome, .......
₩almer
e_service.editar_cliente(cliente_antigo, cliente_novo) return redirect('listar_clientes')
Somesh
Guy's, Can we deploy django on apache using mod_wsgi on local machine ?
Somesh
Reference link would be helpful..
Ali
Is it possible to use folder instead of db to store file?
ㅤ
Is it possible to use folder instead of db to store file?
Depends on your project Sometimes you need to insert data to db and sometimes a folder is enough
Ali
Depends on your project Sometimes you need to insert data to db and sometimes a folder is enough
How to do that ? Any tutorial for create and store data in folder ?
.
How to do that ? Any tutorial for create and store data in folder ?
1. Create a model with a FileField field 2. In that field, set ‘upload_to’ to your desired folder location 3. To upload a file easily, go to admin page and upload it there 4. To access the file in template, get the object’s field’s url like {{ object.fieldname.url }} For further details, search for how to use FileField
Михаил
Hello. I write application with Django channels. How i can send authentication token to consumer? In headers or in url.
Rakesh
How to get the celery task live status and the errors if task fails into the Frontend(html page) in Django?
Ibrahim
hello , i am searching for 3 days and didn't work , i am working with celery beat to schedule task of sending mails , but the beat send the message to worker(redis) and the worker recieve the message and then nothing happen !! anyone can help ?
P
Hi guys, Happy Sunday Everyone.... Could you please help me for connecting image in Django??? I have created the image folder and attached it to the code but can't get the output.
Pooya
Hi Guys, Please help me with my problem: My views.py produces mp3 file. I want to save it in data base and user can download it after that. How can I save mp3 to my database and user download it?
Pooya
Hi. I think, you shoud use media folder and media field in your model
Thanks. Can you help me how I write my models.py? How user download it?
Kirill
Thanks. Can you help me how I write my models.py? How user download it?
mp3file = models.FileField(upload_to='mp3files')
Kirill
Thanks. Can you help me how I write my models.py? How user download it?
https://docs.djangoproject.com/en/4.1/topics/files/
Pooya
mp3file = models.FileField(upload_to='mp3files')
But doesn't this mean user first should upload the file?
Kirill
But doesn't this mean user first should upload the file?
But you can upload file your self using json, sql, etc.
Natalia 😎
Hi, could anybody help me with ORM please: annotation with expression. I'd like to know if any company with the similar taxnumber already exists. RegEx is a business requirement. Company.objects.annotate(c_taxnumber=re.sub(r"[^a-zA-Z0-9]+", "", F('taxnumber'))).\ filter(c_taxnumber=new_taxnumber) I get error from re.sub: expected string or bytes-like object Note: model-field taxnumber is CharField and all taxnumber-values are strings. thx!
Pooya
Hi guys, Please help me with this. I have ajax in html then in views it makes mp3 file. How can I return the path of mp3 file to success of ajax? I want user to download the created mp3 file
Sakthivel
Hello everyone, It's possible to 3D the STL viewer on the browser using Django?
Sakthivel
Hello everyone, It's possible to 3D the STL viewer on the browser using Django?
The idea is to upload an STL file and view it on the browser. To be able to zoom pan rotate
Михаил
Hello. In my project i use redis. I need to store tokens(key:user_id, value: token), chats(key:chat_id, value: list_with_users_id), password_reset_token(user_id, token) and channels library need in redis. How can i distribute redis data base? I need in 1 database or 4 databases?
SUSHANT
Is there is no need to import models in login and registration.. If we use forms.py?
JUGO
I think no need
Nityananda
https://linkode.org/#SYg2nj04MIBt6WUMWxRKB5
Nityananda
https://linkode.org/#SYg2nj04MIBt6WUMWxRKB5
how to use model.py file in chart js
Nityananda
Hey help me plz...
Nityananda
Maxim
What do u mean
this is the Django group, not a JavaScript group
Nityananda
this is the Django group, not a JavaScript group
No I mean I just use chart.js with django but getting this error
Maxim
No I mean I just use chart.js with django but getting this error
at the link is a template for JS code, not the error text
Deise Freire
Please could some kind soul tell me where is the error in my code https://replit.com/@DeiseF/experiencein#manage.py
No
Is there any way to combine django and scrapy
No
I need to run scraper in a time based through django
Dipanshu Vora
Can anyone help me with ObjectMultipleModelAPIView i have gone through the documentation of it but i am not the able to include in thr urls as well as how to include class name of serialzer in Object one view.... So i need help in this can someone help me??
Akash
PS C:\Users\91708\Documents\DJANGONEO> django-admin startproject hello CommandError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\91708\\Documents\\DJANGONEO\\hello' PS C:\Users\91708\Documents\DJANGONEO> django-admin startproject hello CommandError: [WinError 2] The system can
Alex
check if you can call django
Akash
how to set environmental variable
Sarvar
create a .env
Akash
i have already install virtual env in terminal but again this happen
Anonymous
i have already install virtual env in terminal but again this happen
Did you pip install Django in your virtual environment??
Software Engineer
create a .env
Storing password as .env variable is not a good practice, use encription method from a file, or if using external service AWS secret manager is a good option.for local projects you can use .env
Software Engineer
how to set environmental variable
You need to load environmental value , install dotenv module and use its imports to get the environment variables
Deise Freire
What error are you facing, and what triggers it?
I can't run 'python manage.py migrate'. And the system keeps giving me this information: "You have 1 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): perfis. Run 'python manage.py migrate' to apply them."
Deise Freire
Run this python manage.py makemigrations first and then python manage.py migrate
When I do the 'makemigrations' everything goes well, but the 'migrate' shows me a lot of problems that I don't know how to solve.
() { :;}; echo Nickolas
Deise Freire
what does the following command output? python manage.py showmigrations --list
The link to my 'replit' is this https://replit.com/@DeiseF/experiencein#README.md The errors pointed out by the console are these: sqlite3.IntegrityError: UNIQUE constraint failed: new__perfis_perfil.usuario_id
Deise Freire
what does the following command output? python manage.py showmigrations --list
The command you sent me shows me this: admin [X] 0001_initial [X] 0002_logentry_remove_auto_add [X] 0003_logentry_add_action_flag_choices auth [X] 0001_initial [X] 0002_alter_permission_name_max_length [X] 0003_alter_user_email_max_length [X] 0004_alter_user_username_opts [X] 0005_alter_user_last_login_null [X] 0006_require_contenttypes_0002 [X] 0007_alter_validators_add_error_messages [X] 0008_alter_user_username_max_length [X] 0009_alter_user_last_name_max_length [X] 0010_alter_group_name_max_length [X] 0011_update_proxy_permissions [X] 0012_alter_user_first_name_max_length authtoken [X] 0001_initial [X] 0002_auto_20160226_1747 [X] 0003_tokenproxy contenttypes [X] 0001_initial [X] 0002_remove_content_type_name perfis [X] 0001_initial [X] 0002_convite [X] 0003_perfil_contatos [ ] 0004_auto_20221031_1759 sessions [X] 0001_initial usuarios (no migrations
H.G.
The link to my 'replit' is this https://replit.com/@DeiseF/experiencein#README.md The errors pointed out by the console are these: sqlite3.IntegrityError: UNIQUE constraint failed: new__perfis_perfil.usuario_id
You can't have duplicate value for a unique field usuario_id You can do one of the following 1. Delete the data in your database and migrate again 2. Delete the last migration file in migrations folder and rerun the migrations 3. Run the following commands python3 manage.py migrate --fake python3 manage.py makemigrations python3 manage.py migrate
H.G.
Could you kindly send me the command I have to use to delete the database?
just delete db.sqlite3 and then migration files except __init__.py inside perfis app
Deise Freire
just delete db.sqlite3 and then migration files except __init__.py inside perfis app
Could you kindly send me the command I have to use to delete the database? I did what you asked I removed the sqlite3 and the migrations: https://replit.com/@DeiseF/experiencein-v1#README.md
Deise Freire
now run: python3 manage.py makemigrations python3 manage.py migrate
Yes it worked, and now I'm going to put the data I had in the database again.