Dmitrij
Hello everybody Does somebody have good tutorial how to deploy exist django project?
عبد القيوم
Guys can you tell me what should be passed to gitignore in Django. Thanks in advance
Rebellion
Guys can you tell me what should be passed to gitignore in Django. Thanks in advance
https://djangowaves.com/tips-tricks/gitignore-for-a-django-project/
Rebellion
Just copy from here. Most of the things are converted in gitignore
Rebellion
it's just not working just showing me the tag I wrote. It should get data from the backend. {{ product.profit }} needs to display integer but its just not working. No errors
Just check if you are passing 'product' object through context data from backend. If yes, then check if 'product' object having 'profit' attribute. If both conditions are satisfied then it will print {{product.profit}} value in template.
Vitalik
Hey everyone! I have an working sqlite db, and want to make web-based app to fill that web with forms, reports etc. Also i want to change db to postgresql. Which option is more right: 1) create pg db with pgadmin or something and after that include it in django project 2) create django project and create new db right in project First option is simpler for me, because I’m not familiar with django, but may be second one more correct, idk Sorry, if this question may be stupid, i’ve never worked with django Thank you P.s also links to right django-developing patterns and best practicies will be really appreciated:)
Mihail
How to use url parrams in class-base-views? Like year here? https://docs.djangoproject.com/en/4.1/intro/overview/#write-your-views
Vitalik
2
Thank you! But may be can you provide some explanation, if possible
Luis
In your opinion what is the best structure for a django project?
Jor
once completed, and fully functional, run dumpdata into a json, then, create a clean postgresdb, and change the django settings to point into that db, and then import your json follow this: https://medium.com/djangotube/django-sqlite-to-postgresql-database-migration-e3c1f76711e1
Jor
it will be frustrating for sure
Jor
Hi guys, I'm know the basics of python. To day I finished studying OOP. Is it time to learn Django???
learn django while you learn python, we use lot of stuff we don't even understand, but it works, everyday you will be like "ooooohhh, thats why", it's like maths, you don't understand why b2 +- ,|4ab / 2a works, but you use it a lot... and then with years you find the demonstration and it's a big wow
S
keep with React, i'm full python and noone cares, React everywhere
Where you from? Just curious where python is not useful.
Jor
Kindly can someone explain to me the concept of signals and decorators in Django please 🥺🥺
decorators are functions wrappers, it's add functionality to your existing functions without changing them. Signals are like triggers, when some instance calls a save method or a delete, then it triggers your signal function. per example: everytime a user change his data, a mail will be sent. (this is not async), if your mail last forever your user may not be able to finally change the data)
Jor
for async use Celery
Jor
Where you from? Just curious where python is not useful.
Argentina, can't find a good salary
Jor
react everywhere, i'm sick
S
Argentina, can't find a good salary
So you worked in React also?
Jor
nope
Jor
i work with python, but not in the industry, i work at the Prosecutor's office
Jor
Good point...👍🏾
also, signals can be triggered before or after the method you are calling
Jor
pre-delete pre-save
Jor
How to make a drop-down dynamic form field.or how to connect a form choice to a database coloumn.
you can do a lot of stuff with the Form Class, I use CrispyForm which comes with Select2 integrated. For dynamic options you should change your def init and change your myfield.queryset = Model.objects.filter(blabla)
Jor
you can even pass parameters to your FormClass from your views to the init
Jor
with kwargs
SnipThinK
What are the best Book to Learn Django I completed all execution with hands on from Javatpoint
slivachuu
Hello! I want to create a category page where the URL "/category" displays the parent categories and the URL "/category/<slug>" displays the subcategories of the selected subcategory. Anyone experienced in this and can help to do this, I will be extremely grateful! Please write to me in private messages. I will say in advance that there are already developments, it remains to bring everything to mind.
Amr Elwekeel
Server error 500
Amr Elwekeel
How can solve this problem ?
Mirco
Amr Elwekeel
code 400, message Bad request version ('ZZ\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00 \x9d\x00/\x005\x01\x00\x01\x93\x1a\x1a\x00\x00\x00\x17\x00\x00ÿ\x01\x00\x01\x00\x00') [07/Aug/2022 13:34:36] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x02\x00\x01\x00\x01ü\x03\x03\x8d/\x9380\x 0f\x87Ï=\x9f\x07ö\x13\x13P0\x9d2e\x9d7`wz½\x0f|¤5IÈ\x16')
Amr Elwekeel
You're accessing the development server over HTTPS, but it only supports HTTP.
Amr Elwekeel
When I added this code SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True SECURE_HSTS_SECONDS = 31536000 SECURE_HSTS_INCLUDE_SUBDOMAINS = True SECURE_HSTS_PRELOAD = True SECURE_SSL_REDIRECT = True SECURE_REFERRER_POLICY = 'strict-origin' SECURE_BROWSER_XSS_FILTER = True
Eslam
guys why i should use that db_index=True
Azizbek Xushnazarov
guys why i should use that db_index=True
https://stackoverflow.com/questions/59596176/when-we-should-use-db-index-true-in-django
Anonymous
the sequence of objects in the queryset is random in django?
Maxim
the sequence of objects in the queryset is random in django?
what does the documentation say? what do the search engines say?
Luis
Hi. What permissions should I give to files and directories when deploying a django project?
Anonymous
I searched but did not find the solution
Luis
I'm sorry but I don't answer to PMs
S
Well.its not random.its usually last added data first.but you can arrange acording to ur need. by using .order_by(parameter)
S
I searched but did not find the solution
https://stackoverflow.com/questions/9834038/django-order-by-query-set-ascending-and-descending
Vaibhav
I searched but did not find the solution
Google about how to print sql from orms and study the SQL it prints
Vaibhav
How would you do it as an sql
S
Though i could not fully understand ur need..u can take len() of queryset to count.
rtg
Hi! http://localhost:8000/i18n/setlang/ 404 Page not found Error. Any idea? thanks!
Doragonsureiyā
Hi! http://localhost:8000/i18n/setlang/ 404 Page not found Error. Any idea? thanks!
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
rtg
I am implementing the internationalization system with django. After configuring 3 languages ​​and placing a language selector, everything seems fine, but selecting a language returns a 404 Page not foud error. With the path:
rtg
http://localhost:8000/i18n/setlang/
rtg
Thanks!
Holla
trying to learn django in many ways after struggling with videos now am into learning from websites i just created this list to cover the basic of django theory and practical if i missed something please recommend this will be my last time trying to learn django will these list give me enough knowledge to master django this 100/60 of django i know alot is missing but am focusing on the basic now here is the link https://pastebin.com/w942nwmc
APY
How to use list of one function in other function in views.py
nav
For creating API through rest-framework, Is it a good practice to start off using viewsets and routers as shortcuts to create API instead of writing views and URLs for customized API?
nav
Indeed
Does viewsets/routers automatically add endpoints for create/delete? I only want read-only API.
Aref
Does viewsets/routers automatically add endpoints for create/delete? I only want read-only API.
Default/simple Router only generates endpoint of viewList and ViewDetail And viewset automatically handle the valid methods like get,delete, etc
Sinan
Hi friends how to make new apis appear in dashboard for management permission on it by group and user
Gregory
1. I made python manage.py dumpdata > filename.json 2. Create new bd in postgres and connect 3. i made python manage.py loaddata > filename.json i have: raise DeserializationError() from exc django.core.serializers.base.DeserializationError: Problem installing fixture '/home/gregory/PycharmProjects/RadionC_doska_vakansiy/backend/filename.json': why?
AℤℐℤℬℰᏦ ☝️
405Method Not Allowed how can i fix it ?
Doragonsureiyā
405Method Not Allowed how can i fix it ?
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://linkode.org, https://nekobin.com (or your favorite one)
Vasim
i am facing some problems in django project and problem is:—
Vasim
django.core.exceptions.ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form StudentRegistration needs updating.
Vasim
please tell me how to remove it
AℤℐℤℬℰᏦ ☝️
Anonymous