Re: LogIn Class Based View

2022-05-27 Thread Lalit Suthar
refer:
https://docs.djangoproject.com/en/4.0/topics/class-based-views/
https://www.youtube.com/watch?v=Xeh9r0CXBmU&list=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW&index=36&t=1s

On Fri, 27 May 2022 at 01:07, 'dtdave' via Django users <
django-users@googlegroups.com> wrote:

> I have this function based view which works perfectly but I would like to
> convert to a class based view but am stuck on how to do this:
> This is my fbv:
>
> def loginView(request):
> if request.method == 'POST':
> form = LoginForm(request.POST)
> if form.is_valid():
> cd = form.cleaned_data
> user = authenticate(request,
>email=cd['email'],
>password=cd['password'])
>
> if user is not None:
> login(request, user)
> if user.is_authenticated and user.is_client:
> return redirect('clients:detail') # Go to client
> dashboard
> elif user.is_authenticated and user.is_account_manager:
> return redirect('accountmanagers:detail') #Go to
> account manager dashboard
> else:
>return HttpResponse('Invalid login')
> else:
> # Invalid email or password. Handle as you wish
> form = LoginForm()
>
> return render(request, 'registration/login.html', {'form': form})
>
> I would appreciate any help.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ea6c54f2-ecc0-407d-a296-e168d509a299n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGp2JVG6zwbf3i4wfT_BgvTQ07i9ZJwrDiyE%2B%3D3q4y24q4SYFg%40mail.gmail.com.


OperationalError at /admin/login database or disk is full

2022-05-27 Thread Andrew Rea
Hello!

This is my first post in this group so be gentle. 

I'm creating a new Django project, and I've successfully created a 
superuser. But when I try to access the Admin page of my project with my 
superuser credentials, I receive this error:

OperationalError at /admin/login/ 
database or disk is full

Is this because my SQLite database is full from other projects? Or possibly 
because I have too many virtual envs from those same other projects? *Or* is 
it due to my personal computer's disk being too full?

Thank you in advance,

Andrew S. Rea

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d96ae214-4c6f-43c7-ae94-7fba910e68a1n%40googlegroups.com.


Re: What do they mean, exactly

2022-05-27 Thread Sabir Ali
(Hpenv) E:\HealthPrediction>python manage.py makemigrations
*No changes detected*

(Hpenv) E:\HealthPrediction>


"No changes detected' what will i do Please help me. I am beginner in 
django. Please help me


On Friday, May 27, 2022 at 2:12:09 AM UTC+5:30 dcol...@gmail.com wrote:

> I was reading the django docs and i have been confused by the explanation 
> as shown in the snippet.
> [image: Screenshot from 2022-04-29 01-36-59.png]
>
> in the first snippet of code does it mean that both conditions will have 
> to be met as in the case of "and" in logical operators?
> Second snippet, do they imply that the blog objects will first be filtered 
> to have only those that contains "lennon" and then the results will be 
> filtered again to have only those in year 2008?
>
> Please help
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dd74a081-d8ce-464e-9ae4-5f87d9e849dan%40googlegroups.com.


Django Overlap Checking

2022-05-27 Thread Akib Hasan Ratul
I am trying to make django overlapping validation but could not do it, can 
anyone help me

record=[] if count > 1: for i in range(count): start_run = 
self.data.get(f'runningdefinition_set-{i}-start_run',[]) end_run = 
self.data.get(f'runningdefinition_set-{i}-end_run',[]) application_run 
=self.data.getlist(f'runningdefinition_set-{i}-application_run') for 
overlap_check in (i, start_run, end_run, application_run): if overlap_check 
not in record: record.append(overlap_check) else: raise ValidationError( 
"overlapping not allowed" )

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/85769229-7a16-4e81-9bf8-2e50dd6389acn%40googlegroups.com.


Re: OperationalError at /admin/login database or disk is full

2022-05-27 Thread Clive Bruton



On 27 May 2022, at 22:37, Andrew Rea wrote:


OperationalError at /admin/login/
database or disk is full

Is this because my SQLite database is full from other projects? Or  
possibly because I have too many virtual envs from those same other  
projects? Or is it due to my personal computer's disk being too full?


I wouldn't bet on it, but I suspect that you do not have the correct  
permissions to write to the database. Because your HD really isn't  
full, is it?



-- Clive

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CE3C33E3-7796-4ED5-92E5-190DDEBDE91E%40indx.co.uk.