Anonymous
Like ofc when someone signs in you do create a session cookie
Anonymous
And then you can verify each time the user access the website if he is signed in or not
Anonymous
Ahh, in your case it's definitely the login view
mλdcodez
Yep
mλdcodez
I'm using a view to render login page
inchidi
Where. In login view?
its pretty simple if request.user.is_authenticated(): # do something if the user is authenticated
mλdcodez
Thanks 😊
inchidi
how is your login views looks like?
mλdcodez
how is your login views looks like?
https://pastebin.com/0BmCPMxf
inchidi
https://pastebin.com/0BmCPMxf
ah i thought you are using cbv. its easier then, just put after if request.method == 'POST':
mλdcodez
oh thanks 😊
inchidi
https://pastebin.com/DQzxm8A9 same output
no, put between line 3,4 after if request.method == 'POST':
mλdcodez
okay
inchidi
also i thought you want to redirect, why render? its different tho
mλdcodez
i get it now 😊
inchidi
okay buddy, trying redirect
https://docs.djangoproject.com/en/2.0/ref/request-response/#django.http.HttpResponseRedirect
Mouleswaran
Hi there
Mouleswaran
I want to develop a web application which will get input of server and credentials -> login and execute commands on Linux box -> capture the output and give success or failure response in web
Mouleswaran
Is is achievable using django
Django Bot
>> Links - Creating Dynamic Forms with Django | Caktus Group
N S
How to edit data in the models without updateview
Abhi
Hi guys
Abhi
I want to learn django 2.0
Abhi
Where to start?
Abhi
Also I want to know about the use of files like manage.py and view.py
Rohan
docs.djangoproject.com
Django Bot
>> Blogs - Always return namespaces in Django REST Framework >> Links - orsinium/djburger: Framework for big Django projects - yasintoy/Vecihi: Build Your Own Photo Sharing App in 5 minutes - Introduction · Django Girls Tutorial - Dockerizing a Python Django Web Application - Semaphore
inchidi
Where to start?
#starterpack
inchidi
New to Django? here is some resource to start Official docs tutorial Step by step tutorial Video tutorial Another video tutorial Books Django by Example Tango With Django
Django Bot
>> Links - Creating Sitemaps in Django - OverIQ.com
N S
then with View?
I need to update multiple records can you show how it is actually done
Mahesh
Abhay: Guys I was updating my Ubuntu to 18.04 and it got switch off in between.. E it's not booting up Wht may I do...?? Now black screen is coming
Daniel
Abhay: Guys I was updating my Ubuntu to 18.04 and it got switch off in between.. E it's not booting up Wht may I do...?? Now black screen is coming
Although you're offtopic, the black screen is caused by the Desktop Environment not starting. From what I know, Ubuntu has GNOME now, so in your case, hit CTRL+ALT+F2 to enter console mode, and debug there, check logs from /var/log/Xorg.0.log or journalctl -u gdm.
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
https://www.caktusgroup.com/blog/2009/08/14/creating-recursive-symmetrical-many-to-many-relationships-in-django/
Django Bot
>> Links - GitHub - areski/django-nvd3: Django wrapper for nvd3 - It's time for beauti - Schau dir "Building Amazing Data Dashboards With Django And D3JS" auf YouTu
Anonymous
Excuse me There are dango rest full api ? I need help I make a api for post file And with admin i can creat file objects but with post man it said (""detail": "Authentication credentials were not provided.") I send to it all of file that is make in models How i can fix it??
Anonymous
I didnt know how most edit it :(
inchidi
have you authenticated?
N S
This is my models @inchidi
Anonymous
HI YES BUT I FIX IT I DIDNT write my info in athentication part in postman and i think my model has a problem :))
Daniel
BRANHCES lol... wtf
Django Bot
>> Links - Talk Python to Me: #161 Django 2.0 - Tips for Building High-Quality Django Apps at Scale - pennersr/django-trackstats: Keep track of your statistics
inchidi
you want to update or add multiple rows(data)?
inchidi
which one? coz you said update here but your comment said add
inchidi
to create many row/data at once you can use this and for update you can use this
Django Bot
>> Links - Modern DevOps with Django | Jacob Cook
Django Bot
>> Links - Django: How to Extend The User Model (aka Custom User Model) - William S. V
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
Are there any way to upload multiple images to ImageField in a model?
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
I wrote a Image model that have ForeignKeyField to a (post model) so every post can have multiple images.. but my problem now is that i have 4 applications that have models also requires multiple images.
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
I think making an image model for every content type that requires multiple images is repetitive and against DRY
Django Bot
>> Links - Populate your Django test database with pytest fixtures | FlowFX
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
Arjun
One to many field?
inchidi
https://docs.djangoproject.com/en/2.0/topics/db/models/#abstract-base-classes
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
from anotherApp.models import Article
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
sounds like you are looking for abstract model
I just want the ability to upload multiple images per article
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
but i have Offer model that requires multiple images too
inchidi
I just want the ability to upload multiple images per article
then use ManyToManyField instead ForeignKey
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
so, there's no workaround to make models.ImageField accept multiple images per Article object? if that's true then i'll have a look on the abstract base classes.
𝒟𝑜𝓃𝒬𝓊𝒾𝓍𝑜𝓉𝑒
https://docs.djangoproject.com/en/2.0/topics/db/models/#abstract-base-classes
you are right!! thanks 😅 i forgot that i can inherit the Image class 😅
Django Bot
>> Links - DataTable with support for Django Formset : Blueprints : OpenStack Dashboar - Building a combined stream of recent additions using the Django ORM
Mi
I've coded my first django rest API and this is fucking awesome
Mi
Nothing to do with other 'productive' frameworks
Mi
I love it 😍
Abhi
I created a postgres database instance using command docker run --name postgres -it -e POSTGRES_USER=mannu -e POSTGRES_PASSWORD=mysecretpassword postgres
Abhi
i ran into this container shell
Abhi
created a database name itoucan and granted all the previleges to user 'mannu'