DreamDev007
above is template
DreamDev007
print to the console, which is in the variable 'val'
I checked that by putting print() in forms.py value is printing correctly... but its not being catched by if block
Sajid
I want to use django-allAuth Library in my django rest framework project for authentication. I searched a log about this on the internet but I couldn't find any single blog or tutorial for this. All I saw was dj-rest-auth library for the django rest framework. Is it not possible to use django-allAuth Library in django rest framework. If it is possible then can anyone suggest a blog or tutorial of it. This will be very helpful. Thanks
Qwerty
I checked that by putting print() in forms.py value is printing correctly... but its not being catched by if block
form = YourForm(request.POST) for field in form: print("Field Error:", field.name, field.errors) Only debugging can help u
DreamDev007
field name name <ul class="errorlist"><li>Enter Valid Name</li></ul> field name addr above is printed to console
DreamDev007
ok ok .. The thing is.. error is being triggered by django correctly... as per console data.. but, it is not being displayed in chrome
.
ok ok .. The thing is.. error is being triggered by django correctly... as per console data.. but, it is not being displayed in chrome
Does your page maintain at the same form page or it’s redirected to the success url? If still at the same form page, probably you haven’t put a form error rendering element in the template. Try {{ form.errors }} or something like that.
kha ~
Hello, what website offer to deploy django project for free
DreamDev007
Does your page maintain at the same form page or it’s redirected to the success url? If still at the same form page, probably you haven’t put a form error rendering element in the template. Try {{ form.errors }} or something like that.
Hi, it doesn’t redirect to new page. It will be on same form. I tried this, but not worked. Only rendering is the problem.. at the Backend, I could notice validation errors are being captured correctly via print(form.errors)
vermudra
Hi! How do you unit test several remote databases? Should I create copies of the databases for testing and connect to them in another settings.py file or should I create fixtures?
vermudra
Sorry for my english 🙊
vermudra
Why you need to test databases?
Sorry, not exactly the databases but connections to them in views. For example I need to test a function that queries a database in development env but in my current testing environment there are no any defined connections to the databases so I cannot test them
Arash
Hello, i have a bot function in my django project that uploads files in a telegram channel can i track the upload progress? Ps. Files are in server then sent to tl channal def backup(channal_username, file_path):     base_url = f"https://api.telegram.org/bot{bot_token}/sendDocument"     message_text = ''     params = {         'chat_id': channal_username,         'caption': message_text,     }     files = {         'document': open(file_path, 'rb')     }     requests.get(base_url, params=params, files=files)
Dima
Hello!
Dima
How to do a task quickly? https://twilight-omelet-8db.notion.site/Backend-Django-84df1e1fe2d54283b37d1dc95e95ee53
Dima
Rule #1: Speak English!
Sorry. My english is bad. I need help. How to do task?
Asadbek8802
Sorry. My english is bad. I need help. How to do task?
is the task for getting a internship in Russia?
Qwerty
Sorry. My english is bad. I need help. How to do task?
if you don't know how to solve it, then I think it's too early for you to look for a job 😉
Dima
Thank you
Yo_
Hi I am new to django. Can anyone recommend some courses for free?
Yo_
I am a student
Coders Needed Eth
And what will be the content of this data?
That's your payload and f.readlines() is where you pass the file
Coders Needed Eth
It's the type of the file that you're uploading
MDEV
#question, for example, on news websites, one picture, then a little text, and then another picture, how to do it i.e. one image text
Husen
I want to put an avatar picture in the profile part of the admin panel, but I can't put an image in JINJA, what should I do?
Qwerty
#question, for example, on news websites, one picture, then a little text, and then another picture, how to do it i.e. one image text
On one page? If you use django templates, it's enough to go through the records with a loop for.
Husen
Jinja allows you to use the img tag
<img src="{{ user.get_avatar }}" alt="">
Qwerty
<img src="{{ user.get_avatar }}" alt="">
get avatar what is this? show your model or what is this
Qwerty
Husen
avatar = models.ImageField(upload_to="user/")
Qwerty
<img src="{{ user.avatar.url }}" alt="">
Husen
The 'avatar' attribute has no file associated with it. ERROR
Qwerty
Url for imagefield?
other options?
Qwerty
The 'avatar' attribute has no file associated with it. ERROR
{% if user.avatar %} <img src="{{ user.avatar.url }}" alt=""> {% endif %}
Qwerty
Url for imagefield?
the image is stored in media or static files, and not in the database, so the route where this image is stored is required for display in the browser template.
Y
best tutorial for learning django + react???
Rose
best tutorial for learning django + react???
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial (https://docs.djangoproject.com/en/dev/intro/tutorial01/) * Tutorial from MDN (https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django) * Tutorial from django-girls (https://tutorial.djangogirls.org/en/)
Ma.Gubina 🇺🇦†
Hi, can anyone help me with my code? I'm getting a 404 error on my website and I don't understand what's wrong(
Ma.Gubina 🇺🇦†
Python django)
Qwerty
Python django)
show your code, how can we help you if we can't see this?
Qwerty
urls in your application and in base url file. and url on which you catch an error
Ma.Gubina 🇺🇦†
urls in your application and in base url file. and url on which you catch an error
from django.contrib import admin from django.urls import path from main.views import index urlpatterns = [ path('main/', index), path('admin/', admin.site.urls), ]
Qwerty
(⌐■-■)
I have a chat application... And I want to not send chat messages if the session has expired. How can I implement it?
(⌐■-■)
Yeah... Obviously. But.. Kinda stuck with the implementation
Qwerty
Yeah... Obviously. But.. Kinda stuck with the implementation
it is very difficult to recommend something when do not see your implementation
(⌐■-■)
Yeah.. I kind of realized that a second late
(⌐■-■)
I'll try something
Rafik
Hello, What's the solution in case the Django admin css is crashed?
Rafik
??
The css files aren't loading?
Muflone
90% of the Django users are unable to understand the static files
(⌐■-■)
The css files aren't loading?
How are you loading them?
(⌐■-■)
U done necessary changes in settings.py file?
Zelalem
how to add fields to the table that are not migrate to the database but exsist in the model and views
Amireshoon
hey guys, how can i learn Django??
ᅠ ᅠ
hey guys, how can i learn Django??
Hi, just learn and that's it. YouTube is full of videos
Volodymyr
ᅠ ᅠ