Le Createur
Anonymous
i agree but still he is novice.
Anu
Opened settings .py
Le Createur
i agree but still he is novice.
When novice don't give bad advice else he will do it after.
Anonymous
When novice don't give bad advice else he will do it after.
partially agree, we can debate over this later...
Anu
No I found allowed hosts [ ]
Anu
What to do here
Anonymous
go to Google.com and type ... what is allowed hosts in settings.py... and let us know what to enter ... howzz it ?
Anonymous
How do u link django with react native
inchidi
Vitaly hey english only
Mirco
using REST APIs
Or GraphQL 😊
Sam
Hi guys. Anyone here know a cool text editor i can implement in my django blog project? I use Django 2.1
Anonymous
how to access the name of created account user
Anonymous
from django.shortcuts import render, redirect from django.contrib.auth.forms import UserCreationForm from django.contrib import messages def register(request): if request.method == 'POST': form = UserCreationForm(request.POST) if form.is_valid(): username = form.cleaned_data.get('username') messages.success(request, f'Account created for {username}!') return redirect('blog-home') else: form = UserCreationForm() return render(request, 'users/register.html', {'form': form})
Anonymous
it displays Account created for {username}
Anonymous
from views.py .. messages.success(request, f'Account created for {username}!')
Anonymous
this is a template {% if messages %} {% for message in messages %} <div class="alert alert-{{ message.tags }}"> {{ message }} </div> {% endfor %} {% endif %} {% block content %}{% endblock %}
Le Createur
how to access the name of created account user
form.instance should give you the instance of User created
Le Createur
Anonymous
what ?
I didn't get you well
Le Createur
I didn't get you well
form = UserCreationForm(request.POST) if form.is_valid(): form.save() user = form.instance fullname = user.get_fullname() username = form.cleaned_data.get('username') messages.success(request, f'Account created for {username}!')
Le Createur
Thank you 😊
👍🏽👍🏽
Loki
I need to have authentification system and to store more than just login and password. For example, I need to register workers with fields like 'age', 'price', 'is_available' and then I want to have access to this data (to sort old workers e.g.). Should I do it via User model and OneToOneField or there is more appropriate way?
Le Createur
It displays again-- Account created for {username}!
form = UserCreationForm(request.POST) if form.is_valid(): form.save() user = form.instance fullname = user.get_fullname() username = form.cleaned_data.get('username') messages.success(request, 'Account created for %s!' % fullname) restart
Anonymous
Hi guys....How can i insert the graph plotted in django views in django templates
Le Createur
Hi guys....How can i insert the graph plotted in django views in django templates
hummm some peoples prefer to generate the image of the graph in backend and show it in template. but you can try dash https://dash.plot.ly/getting-started
Anonymous
hummm some peoples prefer to generate the image of the graph in backend and show it in template. but you can try dash https://dash.plot.ly/getting-started
Its a good tutorial but is there another alternative where direct graph is plotted as first generating image in my project will not work
Le Createur
Its a good tutorial but is there another alternative where direct graph is plotted as first generating image in my project will not work
if you are good at JS then you can try plot.js or highchart.js. the problem is that python is running in the server side. if you want client side rendering then you have to go with javascript
Anonymous
Ok thanks
Rammanoj
I am using django with reactjs. Everytime I make a request, there is options request being made before the original one. OPTIONS request is basically to check if cors for the current domain is enabled (if both frontend and backend are in different domains). This is creating more delay. However I can not avoid cors request. But is there any way to increase the time for it ? (like if I make a cors request today, I want it to be validated again only after 1 day).
Anu
Django https://imgur.com/gallery/4LWejRh
Anu
Where I can find text "it worked" In package
Mirco
Where I can find text "it worked" In package
Why ? It's the default one of django
Anu
How can I change "it worked" Into my name
Anu
In the same page
Mirco
By making your main page
Anu
Hoe....in this page I can't
Mirco
Hoe....in this page I can't
This page is only enabled in dev mode
Mirco
And the goal of that page is to let u know Django is working correctly
Anu
Ok
Sagar
How can I change "it worked" Into my name
Create your app. Write your own function in views, there u can write your name
Anu
Ok
Le Createur
Ok
And follow the django tutorial 👍
Mirco
And follow the django tutorial 👍
Strooongly suggested! 😎
Anonymous
How can I edit the UserCreationForm to add CSS on it
Anonymous
How do I do that coz I can't tell what's inside {{form.as_p}}
Le Createur
How do I do that coz I can't tell what's inside {{form.as_p}}
There is a way to add custom class in each generated field
Le Createur
Like the bootstrp form-control class
Anonymous
There is a way to add custom class in each generated field
I think we having a miss understanding the Django signup form show u this as 8 character and add number I wanna hide that
Mirco
How do I do that coz I can't tell what's inside {{form.as_p}}
You can render field by field Or specify css class into your form class
Anonymous
You can render field by field Or specify css class into your form class
I'm still a kid when it comes to Django can I inbox u so that u explain more
Le Createur
I'm still a kid when it comes to Django can I inbox u so that u explain more
https://docs.djangoproject.com/en/2.2/topics/forms/#rendering-fields-manually
Shreehari
someone help me with this: https://del.dog/bumevutebe.sql im getting this while during deploying my site to heroku
Anonymous
Hi here is sample django Vue js crud application https://github.com/balaraju1278/djangovue
Anonymous
Fork it
Anonymous
Hit star
Shreehari
okay thanks
Shreehari
Hit star
im getting error while installing django-heroku
Anonymous
Shreehari
fixed it sir just did sudo pacman -S postgresql
Shreehari
thanks for the help
Sebuhi
Anyone has used MQTT broker with RabbitMQ and pass it to Django app, anyone has experience?
Héctor
which engine is recommended for a project in django + mongodb?
Macurrent
is it a good idea to use django and react(a javascript library for building user interfaces) for web dev?