ZeroCool
Hello, I'm starting and I see that Django has an admin, do you always use that? Do you have a tutorial that explains how to implement an html, css template? ie change all the login and administrator?
Koen de
Hello, I'm starting and I see that Django has an admin, do you always use that? Do you have a tutorial that explains how to implement an html, css template? ie change all the login and administrator?
Most of your questions are answered in the official docs https://docs.djangoproject.com/en/4.1/ref/contrib/admin/ I do use the admin, but only for those actions/analysis that only I as as admin am supposed to do. (I’ve created some code to be able to execute specific management commands via Django Admin)
Ôscar
Because heroku does not offer persistence you need to use an external database
Note your information is not complete because Heroku has storage space postgresql Free subscription gives you 1 GB space
Ôscar
Your data will remain there and wont be erased or modified until you do so
Charly
Note your information is not complete because Heroku has storage space postgresql Free subscription gives you 1 GB space
No, that's a database service, but your application can't have persistence
Ôscar
No, that's a database service, but your application can't have persistence
Yes you can simply switch to Heroku database and keep your database in files
Ôscar
But you didn't tell me that
Charly
Yes you can simply switch to Heroku database and keep your database in files
No, you can't keep on files you need to use the database service or any other external database
Ôscar
No, you can't keep on files you need to use the database service or any other external database
Yes u can , It will be a useless file because you will simply change and direct the database in the sittings.py file
Charly
The context where your app runs is not persistent.
Ôscar
The storage system is different I know
Ôscar
Charly
yes but that's not my point
Then what's your point?
Sofia
Anyone can suggest good and some complex project for resume in Django?
Andrej
Anyone can suggest good and some complex project for resume in Django?
Simplified version of Amazon or any other platform
Sofia
Simplified version of Amazon or any other platform
So i want just write with rest API? It's good?
CRINIT
I am looking for repository to track nearest lat long from my list of hotels which includes longitude latitude in api form DRF?
vsn
hey, I am trying to build a dynamic seat allocation for like bus according to the layout can you guys help me building logic for it like build seat according to the layout and provide dynamic number for the seat.
~Ronnie
How can I customize dj-rest-auth password reset email and change the {{ site_name }} to point to another link i.e https://thepivotclubku.co.ke
Arslan
Hello guys, who knows how to exclude a field from the output in ORM, that is, I write models.Car.objects.all(), all fields are displayed, but I need to exclude one, please help thanks in advance
~Ronnie
Through the object query manager there's an exclude method.
Arslan
Through exclude, I can find a field with a specific value, and I need to remove a field with any value
~Ronnie
Yeah check docs
~Ronnie
https://docs.djangoproject.com/en/4.1/topics/db/queries/
Rojitech
How can I customize dj-rest-auth password reset email and change the {{ site_name }} to point to another link i.e https://thepivotclubku.co.ke
SITE_NAME = "MY SITE" You can also set domain name DOMAIN_NAME = "my Domain"
Maks
Hi! Please help:- I created a django project and it worked good, but after reinstallation Python it stops works. I have made VENV and install all packages from requirements.txt but project still does not work. What is the problem? I did not touch any line of code and before Python reinstallation all works good but after nothing works. (((
D
Yes
I need a tutorial
D
I hAVE searched but i didn't find Anything
...
Field defines a relation with model username
...
How to solve this error
Avina
Hey guys. How can I connect frontend pages to backend? In tutorials they first write the django code & then create templates. But how can I do the opposite?
Avina
it's the same 😅 you just have to specify the template in backend and context vars
Actually just 'cause our frontend team is ahead of us , I wanted to know if It's okay or not 😬
Avina
Tnx for your reply 👍🏻
Mirco
Actually just 'cause our frontend team is ahead of us , I wanted to know if It's okay or not 😬
consider most of nowadays projects use to split frontend and backend as separate repos, so frontend can be whatever the team is skilled on, backend serves stuff as APIs ( graphql or REST ) so it's normal frontend can be ahead, obvs, it cannot be used without data backend will provide later
navid
hello everyone I'm learning how the ajax response works in django and as i understood ajax works with json data my question is do i have to write serializers to create json data or working with built in django JsonResponse does the job? also what would a more experienced programmer do for such projects?writing a serializer or just using the JsonResponse?
Viren
Can anyone tell me how to deploy Django rest app with react on aws ec2?
Sumit
Anyone know how do I use ccextractor with python or django
Mirco
Can anyone tell me how to deploy Django rest app with react on aws ec2?
React in S3 and served via Cloudfront Django as a docker container in ECS -> Fargate
Doragonsureiyā
Anyone know how do I use ccextractor with python or django
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
Jordane9999
hello Django Community please i need the help in django
Jordane9999
i should like create ecormerce web site in django but i began but i have small probleme
Jordane9999
my problemme is : i want to create for admin this functionnality who you permite to create multple product in one clic
Jacob
How to fix strptime() argument 1 must be str,not none....
Mirco
Any blog or tutorial link please
Don't have one, Google it There will be looots of results
Viren
Okk, bro thank you🙏
Doragonsureiyā
Okk, bro thank you🙏
You're welcome! 😊
Abdusalimov
Why need learn DRF ? pls help me
Abdusalimov
Why need DRF ?
Mirco
Why need DRF ?
when you need to create REST APIs with Django
Abdusalimov
Doragonsureiyā
Example do you have
Are you looking for Django REST Framework documentation? Here you have it: https://www.django-rest-framework.org/
Sumit
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
I need to create a website on which video(s) can be uploaded, processed in some manner (in the background) and then searched using the subtitles in that video as keywords. ccextractor can extract subtitle from video.. but there is no documentation of it.
Я R
Hey Please, can you help me with my Django code?
Doragonsureiyā
Hey Please, can you help me with my Django code?
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
Maxim
Hey Please, can you help me with my Django code?
!meta is read this: https://t.me/django/221727
Я R
OK, I have a problem with editing my note in the app This is script from views.py def edit(request, title, number): post = get_object_or_404(Task, title=title) tasks = Task.objects.order_by('-id') number = int(number) if request.method == "POST": form = TaskForm(request.POST, instance=post) if form.is_valid(): post = form.save(commit=False) post.task = request.user post.dt = timezone.now() post.save() return redirect('main') else: form = TaskForm(instance=post) return render(request, 'main/edit.html', {'form': form, 'tasks': tasks, 'title': post.title, 'task': post.task, 'number': number})
Я R
I got this 'Tried to update field main.Task.task with a model instance, <SimpleLazyObject: <User: thekarenovich>>. Use a value compatible with TextField.'
Я R
Task field
Naggafin
in your Task model; so, what type of field is Task.task
Naggafin
in order to assign it to a user it needs to be of type ForeignKey with your User model as its base
Naggafin
unless you're wanting to assign to arbitrary models; in which case you would need to use GenericForeignKey
Naggafin
do you understand what I mean? I am asking because you have in your code: post.task = request.user
Naggafin
OK, I have a problem with editing my note in the app This is script from views.py def edit(request, title, number): post = get_object_or_404(Task, title=title) tasks = Task.objects.order_by('-id') number = int(number) if request.method == "POST": form = TaskForm(request.POST, instance=post) if form.is_valid(): post = form.save(commit=False) post.task = request.user post.dt = timezone.now() post.save() return redirect('main') else: form = TaskForm(instance=post) return render(request, 'main/edit.html', {'form': form, 'tasks': tasks, 'title': post.title, 'task': post.task, 'number': number})
opinionated suggestions I want to give you: 1) I would recommend you use class-based views instead of function-based views https://docs.djangoproject.com/en/4.1/topics/class-based-views/intro/ . when you get used to them, they really are better. 2) it can help with readability if you separate your context variables into their own context dict. i.e.: context = { 'form': form, 'tasks': tasks, ... } return render(request, "main/edit.html", context)
Seyed Alireza
How can I create a login user with jwt ?
Mirco
How can I create a login user with jwt ?
Get the info from jwt and create user with ORM