Sayidbek
Vaibhav
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
ASKAR
Rebellion
Rebellion
Just copy from here. Most of the things are converted in gitignore
ASKAR
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
Nikhil
Vitalik
2
Thank you!
But may be can you provide some explanation, if possible
Maxim
Luis
In your opinion what is the best structure for a django project?
Jor
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
S
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
Jor
react everywhere, i'm sick
Rebellion
S
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
you can even pass parameters to your FormClass from your views to the init
Jor
with kwargs
S
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')
Mirco
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
Eslam
Anonymous
the sequence of objects in the queryset is random in django?
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
Maxim
S
Well.its not random.its usually last added data first.but you can arrange acording to ur need. by using .order_by(parameter)
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?
Aref
nav
Indeed
Does viewsets/routers automatically add endpoints for create/delete? I only want read-only API.
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 ?
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ℤℐℤℬℰᏦ ☝️
∆$¶u
Vasim
Anonymous