inchidi
@Inchidi have you seen my code?
which url path you call?
godmode
127.0.0.1:8000/dashboard
inchidi
127.0.0.1:8000/dashboard
then remove dashboard/ in this line https://github.com/Godm0de/uec/blob/master/uec/apps/dashboard/urls.py#L9
José
hey guys, i want to create a news feed, similar to that of facebook, in my django project. I want when I upload a file, all users to get a notification, like what happens on facebook, any help will be appreciated, thank you
inchidi
no
you can read about it first, the concept would be you proxy many models into one proxy model so you can retrieve all data of many different models from one model only
godmode
then remove dashboard/ in this line https://github.com/Godm0de/uec/blob/master/uec/apps/dashboard/urls.py#L9
Why? I want to dashboard yo control their own urls and the dashboard is the main of this app
inchidi
Why? I want to dashboard yo control their own urls and the dashboard is the main of this app
because currently you set your dashboard view in http://127.0.0.1:8000/dashboard/dashboard/
godmode
because currently you set your dashboard view in http://127.0.0.1:8000/dashboard/dashboard/
And how do i do to attach the view to the main page of dashboard?
inchidi
okay, thanks
you can also create new model like Notification(models.Model) for example, then use generic relation and fk to all models data you want to show in your notification. its easier
puneet
How to speed up django response time??
godmode
^ godmode
Yeah , i'm gomma do It , but i want to attach the view
inchidi
How to speed up django response time??
https://docs.djangoproject.com/en/2.2/topics/performance/
puneet
Can you tell me for flask also??? Is this work for flask?
inchidi
Can you tell me for flask also??? Is this work for flask?
you can try read and understand first, then you will know
inchidi
Albert
umm have tried using SMTPHandler instead AdminEmailHandler? coz iirc smtp handler will raise error if you have problem with your config while admin email handler not
Thank you, it works that way. Parameters are the same. But I still did not understand why AdminEmailHandler did not work.
inchidi
yes
try same test but use from django.core.mail import mail_admins instead. prolly you will get the reason there
Albert
try same test but use from django.core.mail import mail_admins instead. prolly you will get the reason there
from django.core.mail import mail_admins from hidjama.settings import * mail_admins(message='op', subject='op') it's work, letter came.
godmode
what do you mean by attaching view?
The view home inside dashboard belong yo the urls 127.0.0.1:8000/dashboard
godmode
How do i do that?
inchidi
How do i do that?
urlpatterns = [ path('', views.home, name='home'),] use that urlpatterns here https://github.com/Godm0de/uec/blob/master/uec/apps/dashboard/urls.py
godmode
@Inchidi you're right , love you Bro!
godmode
Thank you!
inchidi
Thank you!
maybe now you want to re-read what i wrote https://t.me/django/47756
godmode
@Inchidi i've already reat it
godmode
whole the time, i was having dinner so i couldn't check it out by mylself
inchidi
😒
godmode
@inchidi but i want to return the view home to that url, so i try to remove in the line than you told me the string dashboard... and it didn't work
godmode
i don't why
godmode
i wanto to path('dashboard', views.home, name='home'), return this view home.. to dashboard so i tried dashboard/dashboard and you ere right... but when i do path('', views.home, name='home'),it doesn't work
godmode
it's supposed i could do 127.0.0.1:8000/dashboard and see the page than home render
Sirius
Hello everybody! At the registration of a new user, I'm getting an error like : UNIQUE constraint failed : accounts_user.username.
Anonymous
Hello, I could ask you something, I would like if you could guide me a bit on how to work more on django rest framework with mongodb, I was looking at a library called djongo but it lacks a lot of information besides that this something outdated, I am something new using mongodb but I would like if you can help me how to work with these two and if it is necessary or not to use djongo.
cj
Hello, I could ask you something, I would like if you could guide me a bit on how to work more on django rest framework with mongodb, I was looking at a library called djongo but it lacks a lot of information besides that this something outdated, I am something new using mongodb but I would like if you can help me how to work with these two and if it is necessary or not to use djongo.
well... django was made for using relational databases, but yes, there are some libraries to let you use it with noSQL databases, but I guess you should think again if you really need to use noSQL with a RDBMS focused framework... keep in mind it wasn't designed for that
Anonymous
hello. can any one tell me what is the best tutorial about django advanced queries?
Anonymous
hello. can any one tell me what is the best tutorial about django advanced queries?
😂😂😂😂 holy shit (your name) you can use documention of django or a orm tutorial
Anonymous
😂😂😂😂 holy shit (your name) you can use documention of django or a orm tutorial
it's my fake account dude.LOL can you tell me a specific tutorial name or teacher name or youtube channel!!!
cj
it's my fake account dude.LOL can you tell me a specific tutorial name or teacher name or youtube channel!!!
isn't it https://docs.djangoproject.com/en/2.2/topics/db/queries/ enough for what you're looking for?
Anonymous
👆
❤️thanks
Why after updating the page information is added again ?
Anonymous
it covers a wide range of queries, from simples ones to complex ones
dear cj i had a question in login viwe writing it is better than we use by django class or use from usual and manual founctions
Anonymous
yes i know you can use git,ir can't you?
i already downloaded all tutorials of git,ir😂👌
cj
dear cj i had a question in login viwe writing it is better than we use by django class or use from usual and manual founctions
I'll always recommend using Classes, but it's up to everyone's coding styles what to use
Patola
integrates better with the django flow and permits more flexibility and separation of tasks
Patola
not using classes is more straightforward and easier to understand and it might be easier to debug tho
Anonymous
cj
what's the diffrences?
Classes make things simpler and you avoid to repeat writing the same code for some simple/recurrent tasks
Happy
Some good resources to learn from?
https://www.youtube.com/watch?v=Dlx8_LJ3rek
Happy
Some good resources to learn from?
https://www.udemy.com/learn-database-design-with-mysql/
Happy
Some good resources to learn from?
http://www.mysqltutorial.org/
Happy
https://dev.mysql.com/doc/
Happy
hello. can any one tell me what is the best tutorial about django advanced queries?
https://books.agiliq.com/en/latest/ Django cook book……
Happy
Sorry, My english is bad. I means that... A lot of example in those books.
Aluisco Miguel
Anyone can help me?? I have little problem with dicttionaries and Django Templates
Aluisco Miguel
I'm working with STRIPE Gateway Payment on Django and I'm facing problems for access to dicctionary on Templates I already do on pure python and work fine. This is my view @login_required def invoice_details(request): customer = stripe.Customer.list(email=request.user) return render(request, 'payment.html', customer) and in template this is my code: <h2>{% trans "User details" %}</h2> {% for actual_customer in customer.data %} ID: {{ actual_customer.id }} {% endfor %} The above code isn't working, any help is appreciated
Aluisco Miguel
I try to send different
Aluisco Miguel
@login_required def invoice_details(request): context = dict() context['customer'] = stripe.Customer.list(email=request.user) return render(request, 'payment.html', context)
Aluisco Miguel
But only get first items
Happy
What is len(customer.data) print ?
Aluisco Miguel
What is len(customer.data) print ?
customer = stripe.Customer.list(email='some@email.com') for actual_customer in customer['data']: print(actual_customer['id'])
Aluisco Miguel
This code work perfect on python
Aluisco Miguel
What is len(customer.data) print ?
Print Customer Object has JSON more or less
Aluisco Miguel
What is len(customer.data) print ?
[<Customer customer id=cus_FSUwGiF5Inuga at 0x7fed412de4a8> JSON: { "account_balance": 0, "address": null, "balance": 0, "created": 1563457586, "currency": "usd", ......
Isaías
Hello. How create forgot my password in Django rest?
Alexey
Hello. How create forgot my password in Django rest?
you can use django-rest-auth + allauth
Isaías
Ok. Thank you.