Kalandhar
Page not found
Kalandhar
Anyone tell me what is problem in it...?
amirhosein
Hello friends I want a company when registering on the site to be able to introduce a number of its employees as users with different accesses and these employees can see and edit the sections that are relevant to them. How can I do that in Django?
akamit
Hello everyone, I have a form with select field class NumbersForm(forms.Form): numbers = forms.MultipleChoiceField() Can you help me to populate this form from view, please? I have tried this: form = NumbersForm(initial={'numbers': ( ("1", "11111"), ("2", "222222"),)}) context = {'form': form, 'title': 'Numbers'} return render(request, 'numbers/numbers.html', context) I have tried also many other ways, all with no luck :(
Wizuba
Hey help me plz !! Wanna build a web API so what should use between Flask Rest_API and Django DRF
Mirco
Hey help me plz !! Wanna build a web API so what should use between Flask Rest_API and Django DRF
If you are here, the answer is simple But if you don't need all the stuff Django offers, use FastAPI instead of Flask
Doragonsureiyā
😅 but I don't know how to get started with it 😞
Are you looking for Django REST Framework documentation? Here you have it: https://www.django-rest-framework.org/
Wizuba
!drf
🤞
Paras
Hi, how make any 3 choices mandatory in django.. i know abt required, but its for only 1 field...
Mirco
Hi, how make any 3 choices mandatory in django.. i know abt required, but its for only 1 field...
You can use the clean method and check if all 3 choices are sent by the form
Fan / Ac
i need to send data using PUT method, so what the best way to access the data request.POST wont contain the data i am sending the data using formdata request.body contains the data but its not in a clean format
IDK
request.data is clean
IDK
request.body returns as byte
IDK
String
Fan / Ac
request.data is clean
thanks i will check that
Fan / Ac
request.body returns as byte
i will try to decode it
IDK
No you dont need because this data also stored in request.data
Fan / Ac
i got you, i just need to see how both works
Amin
Why when I chang My static , the changes don't apply
Amin
Collect static is working but changes not done
λ701
Collect static is working but changes not done
You mean the static files doesn’t load in production?
Amin
You mean the static files doesn’t load in production?
They are loaded for once For example when I change a line of my JavaScript My website shows like first
λ701
They are loaded for once For example when I change a line of my JavaScript My website shows like first
For once you mean? You mean your static files only work on first time website loads? And then it doesn’t work again?
Amin
Amin
I changed my CSS and JavaScript files , but my site shows like that i didn't apply any changes
λ701
No the changes are not working When I change them the changes are not applying
If you change a static file in development You need to run collect static again In server side or production again Typically speaking if you use a GitHub repo clone in your server
Amin
Directly changing static files in production won’t work
Yes i know Even i collect static but changes not done Here i can't send pics Can i send you pics in direct please ?
Sergey
Hi guys! I want to know if anyone of you do SP (service provider) for SAML with django? I want to find some guide or anything (better code snippet/repo) according to this. Thanks
Doragonsureiyā
Hi guys! I want to know if anyone of you do SP (service provider) for SAML with django? I want to find some guide or anything (better code snippet/repo) according to this. Thanks
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
Alireza
Hi guys Is there anyone help me in finding a django project?
Charly
Hi guys Is there anyone help me in finding a django project?
go to github you'll find tons of them
Amin
Somebody help me please
Amin
with?
I've changed my CSS and JavaScript files , but my site shows like that i didn't apply any changes
Amir
I changed my CSS and JavaScript files , but my site shows like that i didn't apply any changes
Hi! Maybe it's because of chrome (browser) Cache file, i suggest you to delete browser cache maybe it work!
Amir
In chrome for example you can access by ctrl + shift + delete
Amir
I worked with edge bro
I don't know how to delete edge cache, search it or try a new browser to see and be sure problem is browser cache
λ701
Asame as chrome
hard reload didn't work? ctrl + shift + r
Doragonsureiyā
I've changed my CSS and JavaScript files , but my site shows like that i didn't apply any changes
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain: - what you're doing - what you're expecting - what you're using - where you're running the script - what Python version you're using - what packages and their versions you're using - and the most important thing: show the code YOU wrote (read rule 5️⃣ for that) and more details, that way your chances to get help will increase
prasanth_reddy™
Type Localhost:8000 in any browser,before that in your ide in your app folder you need to run server(python manage.py runserver).
main.c
which error ?
λ701
Is your server running?
λ701
Run python manage.py runserver In the same directory as where your manage.py file is If you see this, you should be able to load the website
Mohammad Hossein
Hello everyone👋 How I can remove slash of end all django urls or redirect slash to no slash? Like mysite .com/blog/ - - - > mysite .com/blog
Mohammad Hossein
settings.py APPEND_SLASH = False
Yes I test it but didn't work😕🙁
𝕁𝕒𝕧𝕠𝕙𝕚𝕣
Hello everyone My project is currently on branch development and I wanna push them to branch main. How can I do that?
𝕁𝕒𝕧𝕠𝕙𝕚𝕣
Chaitanya
Yes I test it but didn't work😕🙁
RewriteCond %{REQUEST_FILENAME} ! -d RewriteRule ^(.*) /$ /$1 [R=301, L] add ☝️ two line to you apache vhost file or to a .htaccess file.
Mohammad Hossein
RewriteCond %{REQUEST_FILENAME} ! -d RewriteRule ^(.*) /$ /$1 [R=301, L] add ☝️ two line to you apache vhost file or to a .htaccess file.
can you help me for this question too? Hello everyone, How I can just use slug for all urls in django without anything before or after? Ex: path('<slug:slug>' , Article.as_View(), name="articledetail"), path('<slug:slug>', Category.as_View(), name="category"),
RK
Hello everyone I have one dout how to create contact form by submitting form data send to mail
𝕁𝕒𝕧𝕠𝕙𝕚𝕣
I have a template called _aside.html and I include it in almost every template like this: {% include '_aside.html' %}. I need to pass context variables to it (tags, popular, recent posts) and I have to pass them through views again and again. Is there any way to pass them only once?
RK
I'm new to Django
RK
By submitting data to form .send to mail id
callmelifo
hi everyone i have a problem with django forms: when i submit a form in django template it uses GET method can you help me? :)
callmelifo
Check the action method of the form
it is post:( i got so confused 🥲
Mirco
it is post:( i got so confused 🥲
You should share view, form and template code via pastebin
callmelifo
You should share view, form and template code via pastebin
https://pastebin.com/z8LpvY9c https://pastebin.com/XSjNEjJw https://pastebin.com/DNVjn1sy 🥲
Не выходи из комнаты.
Hi. Can help me, pls, with django-channels? https://github.com/django/channels/issues/1773
Anonymous
for warranty periods should i use Duration Field or days
Erik
who had this guys??? ERROR: 2 Creating spot_django_run ... done sh -c python manage.py test Creating test database for alias ‘default’... Got an error creating the test database: duplicate key value violates unique constraint “pg_database_datname_index” DETAIL: Key (datname)=(test_postgres) already exists.
Anonymous
i am confused
Mohamad Reza
Hey, I want to do math operations in django default template engine and I want to add a number to another number like this: {% for num in custom_range %} <p>{{ num + 1 }}</p> {% endfor %} But, raising error Could not parse the remainder: ' + 1' from 'num + 1' I searched this issue on google and by stackoverflow users answers used sub filter but seems that this filter is not in current stable version