أحمد
I use django framework to build e-commerce website , when i use database like mySQL and potgresql ??
Maxim
clouded
Saman
Asterix
Can i make something when my project copied to other place, may not work
Maxim
Doragonsureiyā
Maxim
Asterix
Maxim
Yes
don't give access to other programmers
Asterix
Ok thanks for helping
Asr
Hey I want to ask one thing in api response when we send data. We have to send only primary key of other tables or name of them.
Maxim
ラーフル
django new version?
Maxim
ラーフル
what?
i just saw a post about django 5.2
Mirco
Eddy
"Guys, I need to set up a payment gateway (Pix, credit card, and boleto). Any suggestions?"
Doragonsureiyā
Denis
<span style="color: gray;">{{ post.pub_date|timesince }}</span> why doesn't it work?
Doragonsureiyā
Denis
Everything works , my inattention
mbk
Hi
We are using django 3
And we need a LTS version which would be helpful for our project
Any suggestions to which version shall we upgrade it to ?
clouded
M o h m a d
Sweet
Hello everyone
After the last docker update, I ran into a problem that I can't fix in any way.
I used to use the following command to start an application during development:
uvicorn app.asgi:application --host 0.0.0.0 --port 8000 --reload
And everything worked fine, when making changes to the code, the server rebooted and the changes were applied, but after the last docker update, the command stopped working and django stopped seeing changes in the code. I changed the command to a more precise one, and django seemed to see the changes and restart the server, but the changes were not applied.
uvicorn app.asgi:application --host 0.0.0.0 --port 8000 --reload --reload-dir /app
I checked the code in the container and the changes were visible there, but they still didn't work. I tried to write a separate config for starting the application :
if __name__ == "__main__":
uvicorn.run(
"app.asgi:application",
host="0.0.0.0",
port=8000,
reload=True,
reload_dirs=["/app"],
)
But that didn't give any results either.
It doesn't help even if I restart django in docker containers, only restarting the entire container helps.
I tried specifying volumes in more detail, but that didn't have any effect either.
volumes:
- type: bind
source: .
target: /app
consistency: cached
I check file permissions in container and everything looks fine.
I tried running python inside a container with the -B flag to avoid creating caches, but that didn't work either.
I have updated the wsl.
I tried using runserver and it didn't help either.
All the code that I use to start the container:
django:
build:
context: .
dockerfile: Dockerfile.dev
container_name: django
ports:
- "8000:8000"
command: >
bash -c "
python manage.py makemigrations --noinput &&
python manage.py migrate &&
python manage.py boot_cache &&
uvicorn app.asgi:application --host 0.0.0.0 --port 8000 --reload --reload-dir /app
"
volumes:
- .:/app
environment:
- DJANGO_SETTINGS_MODULE=app.settings_dev
- DEBUG=1
- CELERY_BROKER=redis://redis:6379/0
depends_on:
redis:
condition: service_healthy
Maybe someone has encountered something like this and found a solution?
Using:
Django: 5.1.8
Docker: 4.40
HAJI MASTAN
Hello everyone
After the last docker update, I ran into a problem that I can't fix in any way.
I used to use the following command to start an application during development:
uvicorn app.asgi:application --host 0.0.0.0 --port 8000 --reload
And everything worked fine, when making changes to the code, the server rebooted and the changes were applied, but after the last docker update, the command stopped working and django stopped seeing changes in the code. I changed the command to a more precise one, and django seemed to see the changes and restart the server, but the changes were not applied.
uvicorn app.asgi:application --host 0.0.0.0 --port 8000 --reload --reload-dir /app
I checked the code in the container and the changes were visible there, but they still didn't work. I tried to write a separate config for starting the application :
if __name__ == "__main__":
uvicorn.run(
"app.asgi:application",
host="0.0.0.0",
port=8000,
reload=True,
reload_dirs=["/app"],
)
But that didn't give any results either.
It doesn't help even if I restart django in docker containers, only restarting the entire container helps.
I tried specifying volumes in more detail, but that didn't have any effect either.
volumes:
- type: bind
source: .
target: /app
consistency: cached
I check file permissions in container and everything looks fine.
I tried running python inside a container with the -B flag to avoid creating caches, but that didn't work either.
I have updated the wsl.
I tried using runserver and it didn't help either.
All the code that I use to start the container:
django:
build:
context: .
dockerfile: Dockerfile.dev
container_name: django
ports:
- "8000:8000"
command: >
bash -c "
python manage.py makemigrations --noinput &&
python manage.py migrate &&
python manage.py boot_cache &&
uvicorn app.asgi:application --host 0.0.0.0 --port 8000 --reload --reload-dir /app
"
volumes:
- .:/app
environment:
- DJANGO_SETTINGS_MODULE=app.settings_dev
- DEBUG=1
- CELERY_BROKER=redis://redis:6379/0
depends_on:
redis:
condition: service_healthy
Maybe someone has encountered something like this and found a solution?
Using:
Django: 5.1.8
Docker: 4.40
This issue is reminiscent of problems reported with Docker on WSL2, especially after updates. Common fixes include forcing polling, adjusting volume consistency, or moving to the WSL filesystem. If you’re still stuck, sharing your Dockerfile.dev or checking Docker’s GitHub issues for 4.40 might reveal specific bugs.
HAJI MASTAN
HAJI MASTAN
Or use delegated consistency to reduce overhead as you are running multiple services (django, celery, celery-beat, flower) mount .:/app, which could strain WSL2’s filesystem sync, so for this i think delegated is good as delegated prioritizes container performance, reducing sync latency that might confuse Uvicorn’s watcher
K A R T I K
Django book
Doragonsureiyā
Django book
This is not a search engine. If you use this group like a search engine, unlike a search engine, you will not get any answers. Please take the the time to formulate your request clearly and remember that you're talking to humans.
Lucky
zmod
hello django people
i have a project which calculate a employee attendance record, the raw data from.biometric contains empid, deviceid, date, time. thats it. Then raw data is in csv form when i upload to a django immediately process the data for bulk insertion in my database table using posgresql. my question is what is the best approach in calculating pay rules like number of working hours, under time, over time, double pay on holiday. other question is better to implement it in database level for calculation or in the django application level. may i know your best approach to this. or if you a sample for this.
im thinking for storing the pay rules for example the rate percentage calculation base on employees rate per hour and so on. these configuration of pay rules is stored in jsonb field, so every roster schedule a pay rules attached to it. for now thats my plan.
Eric
zmod
i already setup a container for redis, celery and celery beat. but not yet implemented since its new to can you add me to a private convo, if u dont mind.
zmod
im purely using the django admin panel this time to complete this task, no views, and urls
zmod
just models, forms and admin
zmod
Bekzhan
Hello to everyone who connected mssql on the odbc 17 driver, via wsl , I get an error, how to fix it File "/mnt/c/Users/ /Desktop/nistrz/venv/lib/python3.12/site-packages/django/utils/connection.py", line 62, in getitem
conn = self.create_connection(alias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users//Desktop/nistrz/venv/lib/python3.12/site-packages/django/db/utils.py", line 193, in create_connection
backend = load_backend(db["ENGINE"])
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users//Desktop/nistrz/venv/lib/python3.12/site-packages/django/db/utils.py", line 126, in load_backend
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: 'mssql' isn't an available database backend or couldn't be imported. Check the above exception. To use one of the built-in backends, use 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql', 'sqlite3'
clouded
Hello to everyone who connected mssql on the odbc 17 driver, via wsl , I get an error, how to fix it File "/mnt/c/Users/ /Desktop/nistrz/venv/lib/python3.12/site-packages/django/utils/connection.py", line 62, in getitem
conn = self.create_connection(alias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users//Desktop/nistrz/venv/lib/python3.12/site-packages/django/db/utils.py", line 193, in create_connection
backend = load_backend(db["ENGINE"])
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/c/Users//Desktop/nistrz/venv/lib/python3.12/site-packages/django/db/utils.py", line 126, in load_backend
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: 'mssql' isn't an available database backend or couldn't be imported. Check the above exception. To use one of the built-in backends, use 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql', 'sqlite3'
Have you googled django mssql?
E
Hi guys! In DRF browsable api for HTML form Group ids i need to list all user groups for selecting by user. But got "No items to select"
https://dpaste.org/dGB7e
Output:
https://dpaste.org/Fxvvt
Bekzhan
Have you googled django mssql?
yes, of course, but I couldn't solve the problem. When connecting, he writes : (venv) mukhtarbekov@trz-fm-ws-07595:/mnt/c/Users/mukhtarbekov_b/Desktop/nistrz/nisservice$ python test_db.py
Ошибка подключения: ('08001', '[08001] [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000102:SSL routines::unsupported protocol] (-1) (SQLDriverConnect)')
The Inspired
cj
cj
cj
all logic should be done in views
E
I first want to understand why are you doing that
So, by http://localhost:8000/api/v1/organization/users/100/ i got this response (1). It's right but also i should have possibility to select several groups in DRF browsable api and update it.
Answer your question: Because the user is not present on the serializer but in init it is and i need to filter it by user.organization.
1. https://dpaste.org/1GBq0
cj
E
E
The Inspired
E
E
this one?
code with output
https://dpaste.org/wjQnN
The Inspired
hmm...
The Inspired
definitely something is wrong... just can't put my finger around it... if you say data is coming, then something else might be wrong.
The Inspired
The Inspired
this could be the solution
E
The Inspired
that's because you have given OrganizationGroup.objects none in your viewset, which is what I told you initially
E
hamid
Hi everyone
I'm locking for a good way to store site statics
by statics i mean for example there is about us page and in about us there are title picture and a text.
the question of mine is how to store these statics
it's not that good to create a table
and it's not store able by a key value settings table
i also want it to be editable in admin panel
any solution or suggestion.\
Pablo
Charly
hamid
Charly
Pablo
Charly
You want to be editable in the admin, if not just make them static tempaltes
hamid
And?
It's not that good to create an database table , It is?
Charly
Charly