#Authentication

12 messages · Page 1 of 1 (latest)

hasty girder
#

https://github.com/HISHAN03/Quiz

This is my django quiz app inside templates/student/login and registration is my login and registration form I don't know how I can setup authentication I used raw SQL. The views of the login and registration is present in the bottom of the views section. Can u help me to setup authentication please 🥺

GitHub

Contribute to HISHAN03/Quiz development by creating an account on GitHub.

prime snow
#

Django has built-in auth why are you rolling your own?

#

VIews looks pretty bad, you don't have to use ORM with Django, but if you don't it's a good question why are you using django at all?

#

Have you done the official tutorial?

hasty girder
#

@prime snow it is a college project and it was Mandatory to use raw SQL

#

And I choose django to work with it

#

How can I make my views.py file better ? Where can I put my views code ?

prime snow
#

Problem is not where you put it, but the fact that you completely avoid using django.forms that makes code repetititive, ugly and in combination with rawSQL extremely vulnerable

#

So do you have to use raw SQL for everything? Or just your logic? It would be not very easy to remove all ORM operations from a django project I think

#

Anyway for auth you should use built-ins. If you have to make it use raw sql - customize it DB part

hasty girder
#

Ok I'll use ORM

#

Thanks 👍🏻