Login using phone and number

2024-04-13 Thread Yash Trivedi
I need a code for login using phone number and password without using 
form.py 
and tell me how can I do quickly 

-- 
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/aa859748-80f6-467b-a41b-30d54925bbd0n%40googlegroups.com.


Re: Help on Django_allauth Login Page

2024-03-08 Thread ALINDA Fortunate
Thank you for your response, okay let me try it

On Fri, Mar 8, 2024 at 5:48 PM Muhammad Juwaini Abdul Rahman <
juwa...@gmail.com> wrote:

> It's part of LoginForm in django_allauth:
> https://github.com/pennersr/django-allauth/blob/main/allauth/account/forms.py#L146
>
> You can subclass LoginForm and omit that part.
>
> On Fri, 8 Mar 2024 at 22:34, ALINDA Fortunate 
> wrote:
>
>> Hello colleagues, I have the following code for my login page using
>> django_allauth but it outputs the *forgot password?* link. How do I edit
>> this?
>>
>> 
>> {% extends "_base.html" %}
>>
>> {%load crispy_forms_tags%}
>>
>> {% block title %}Log In{% endblock title %}
>> {% block content %}
>> Log In
>> {% csrf_token%}
>> {{form | crispy}}
>>
>> Log In
>>
>> 
>> {% endblock content %}
>>
>>
>> And the output has f*orgot** password? link.* How do I remove it or
>> style it?
>>
>> Below is the output.
>>
>>
>> [image: image.png]
>>
>> --
>> ALINDA Fortunate
>> Graduate Of Computer Science
>> Gulu University
>> Passionate about Software Development in Python
>> If you can't explain it simply, you don't understand it well enough.
>> alindafortuna...@gmail.com .
>> +256 774339676 / +256 702910041
>> Kagadi.
>>
>> --
>> 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/CAPifpCtpktOM0dRwGceOd2jP5xGRso6xwey7SvDNv%3DSMsZm0yA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAPifpCtpktOM0dRwGceOd2jP5xGRso6xwey7SvDNv%3DSMsZm0yA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAFKhtoSgoD0y_fom1K_pr3w1esm3N3Cj5%2BybqDemv%2BzA7vqeXg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFKhtoSgoD0y_fom1K_pr3w1esm3N3Cj5%2BybqDemv%2BzA7vqeXg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 
ALINDA Fortunate
Graduate Of Computer Science
Gulu University
Passionate about Software Development in Python
If you can't explain it simply, you don't understand it well enough.
alindafortuna...@gmail.com .
+256 774339676 / +256 702910041
Kagadi.

-- 
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/CAPifpCsqiE86Oxc-jP%2B8zUANfL1u-SSz-RM9%3DMqY6p22cPV%3D8w%40mail.gmail.com.


Re: Help on Django_allauth Login Page

2024-03-08 Thread Muhammad Juwaini Abdul Rahman
It's part of LoginForm in django_allauth:
https://github.com/pennersr/django-allauth/blob/main/allauth/account/forms.py#L146

You can subclass LoginForm and omit that part.

On Fri, 8 Mar 2024 at 22:34, ALINDA Fortunate 
wrote:

> Hello colleagues, I have the following code for my login page using
> django_allauth but it outputs the *forgot password?* link. How do I edit
> this?
>
> 
> {% extends "_base.html" %}
>
> {%load crispy_forms_tags%}
>
> {% block title %}Log In{% endblock title %}
> {% block content %}
> Log In
> {% csrf_token%}
> {{form | crispy}}
>
> Log In
>
> 
> {% endblock content %}
>
>
> And the output has f*orgot** password? link.* How do I remove it or style
> it?
>
> Below is the output.
>
>
> [image: image.png]
>
> --
> ALINDA Fortunate
> Graduate Of Computer Science
> Gulu University
> Passionate about Software Development in Python
> If you can't explain it simply, you don't understand it well enough.
> alindafortuna...@gmail.com .
> +256 774339676 / +256 702910041
> Kagadi.
>
> --
> 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/CAPifpCtpktOM0dRwGceOd2jP5xGRso6xwey7SvDNv%3DSMsZm0yA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPifpCtpktOM0dRwGceOd2jP5xGRso6xwey7SvDNv%3DSMsZm0yA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAFKhtoSgoD0y_fom1K_pr3w1esm3N3Cj5%2BybqDemv%2BzA7vqeXg%40mail.gmail.com.


Help on Django_allauth Login Page

2024-03-08 Thread ALINDA Fortunate
Hello colleagues, I have the following code for my login page using
django_allauth but it outputs the *forgot password?* link. How do I edit
this?


{% extends "_base.html" %}

{%load crispy_forms_tags%}

{% block title %}Log In{% endblock title %}
{% block content %}
Log In
{% csrf_token%}
{{form | crispy}}

Log In


{% endblock content %}


And the output has f*orgot** password? link.* How do I remove it or style
it?

Below is the output.


[image: image.png]

-- 
ALINDA Fortunate
Graduate Of Computer Science
Gulu University
Passionate about Software Development in Python
If you can't explain it simply, you don't understand it well enough.
alindafortuna...@gmail.com .
+256 774339676 / +256 702910041
Kagadi.

-- 
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/CAPifpCtpktOM0dRwGceOd2jP5xGRso6xwey7SvDNv%3DSMsZm0yA%40mail.gmail.com.


Integrating Login form, registration form and model form

2024-02-13 Thread Janet Anastacia
I am trying to create a Django app such that when a user signs up, she goes
to login then sees the form containing the data of the model in my
apo.Kindly give me the steps with code  example for me to achieve this

On Mon, Feb 12, 2024, 12:53 AM Alexander Lyabah 
wrote:

> Hello Django Community,
>
> I'm excited to share with you a new Django package I've been working on,
> named django-content-settings. This package is designed to simplify the
> process of creating and managing project settings directly from the Django
> Admin interface. It aims to offer an intuitive way to handle configurations
> without the need to dive into code files for changes, making it especially
> useful for projects where non-developers need to adjust settings.
>
> Key Features:
>
> * Easy integration with existing Django projects.
> * A user-friendly interface to manage settings.
> * Advanced functionality for more complex configurations.
>
> The project is still in its early stages, and I'm looking for feedback
> from the Django community to make it more robust and useful. Whether it's a
> feature request, bug report, or any general advice, your input would be
> incredibly valuable.
>
> Additionally, I'm seeking contributors who are interested in helping to
> develop and improve django-content-settings. If you have experience with
> Django and a passion for open-source projects, I would love to collaborate
> with you. Contributing can range from coding to documentation, testing, and
> spreading the word.
>
> Getting Involved:
>
> Check out the project on GitHub:
> https://github.com/occipital/django-content-settings/
> Read through the documentation:
> https://django-content-settings.readthedocs.io/en/latest/
> You Tube Video with dive into development using DCS:
> https://www.youtube.com/watch?v=RNYmvv_G5zs
>
> Try it out in your project and let us know your thoughts.
> I believe that with your feedback and contributions, we can make
> django-content-settings a valuable tool for the Django community. Please
> feel free to reply to this thread or contact me directly at a [dot] lyabah
> [at] checkio [dot] org
>
> Thank you for your time and consideration. I'm looking forward to your
> feedback and hopefully welcoming some of you as contributors to the project!
>
> --
> 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/c33b7cf2-2883-4567-abb9-d124b27d9cf5n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c33b7cf2-2883-4567-abb9-d124b27d9cf5n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAA_zVTF01YQ%2BCnwVnYLC0b8OKswx7Uqyu7hEGMAtfZm4mhJh3w%40mail.gmail.com.


sending a message on next page refresh or login

2024-02-05 Thread vjwork
I'm using the messaging system to notify users of actions in synchronous 
session, but I also have some long runnning background tasks for certain 
users. 

How do insert a message into the django message framework for a user 
without having a request available? Is that possible at all?






-- 
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/d20b05a7-17b0-4ead-8898-b262ea935de7n%40googlegroups.com.


Re: login with token instead of password

2024-01-16 Thread 'Kasper Laudrup' via Django users
Isn't this pincode_auth_app just the same as the standard Django 
password authentication, only the password is stored in plain text and 
limited to four characters?


Maybe I'm missing something?

Kind regards,
Kasper Laudrup

--
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/3e7ec0be-1c03-42e5-a1de-18bfbb1be9b4%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: login with token instead of password

2024-01-16 Thread Ahmed Iftikhar
python manage.py startapp pincode_auth_app
# pincode_auth_app/models.py from django.contrib.auth.models import
AbstractUser from django.db import models class CustomUser(AbstractUser):
pin_code = models.CharField(max_length=4, blank=True, null=True)
***
# pincode_auth_app/admin.py from django.contrib import admin from .models
import CustomUser
admin.site.register(CustomUser)
***
python manage.py makemigrations
python manage.py migrate

# pincode_auth_app/forms.py from django import forms class
PinCodeLoginForm(forms.Form):
username = forms.CharField(max_length=150)
pin_code = forms.CharField(max_length=4, widget=forms.PasswordInput)
*
# pincode_auth_app/views.py from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login from .forms import
PinCodeLoginForm def pin_code_login(request): if request.method == 'POST':
form = PinCodeLoginForm(request.POST) if form.is_valid(): username =
form.cleaned_data['username'] pin_code = form.cleaned_data['pin_code'] user
= authenticate(request, username=username, pin_code=pin_code) if user is not
None: login(request, user) return redirect('success_page') # Redirect to a
success page else: # Authentication failed return render(request,
'login.html', {'form': form, 'error': 'Invalid username or pin code'}) else:
form = PinCodeLoginForm()
return render(request, 'login.html', {'form': form})
*
   
Pin Code Login   Login {% if error %} <
p style="color: red;">{{ error }} {% endif %}  {% csrf_token %} {{ form.as_p }} Login  

***
  # pincode_auth/urls.py from django.urls import path from
pincode_auth_app.views import pin_code_login urlpatterns = [ path(
'pin-code-login/', pin_code_login, name='pin_code_login'), # Add other URLs
as needed ]
***
# pincode_auth/urls.py from django.contrib import admin from django.urls
import path, include urlpatterns = [ path('admin/', admin.site.urls), path(
'', include('pincode_auth_app.urls')),
]


On Tue, Jan 16, 2024 at 8:02 PM ABDUL HAFEEZ  wrote:

> example:
> I have a model with fields username and password
> when users create account  there credentials saved in db next I want that 
> *instead
> of login with password I want create token *so he can login with token
> not password
>
> what should I do
> please provide me logic steps if someone have done already
>
> --
> 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/e43d49a3-e950-4396-9f90-3b1cd6f7af0an%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/e43d49a3-e950-4396-9f90-3b1cd6f7af0an%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAGAxPTyJC0x31Yr%2Bu7u4qfwmeqcsv-Z6TUW0nA6ctivUXD6jdw%40mail.gmail.com.


Re: login with token instead of password

2024-01-16 Thread IKT Service
Maybe try to send a token to user email, when used get that email with a
activation link, he can just click and activate the account

tir. 16. jan. 2024 kl. 16:02 skrev ABDUL HAFEEZ :

> example:
> I have a model with fields username and password
> when users create account  there credentials saved in db next I want that 
> *instead
> of login with password I want create token *so he can login with token
> not password
>
> what should I do
> please en provide me logic steps if someone have done already
>
> --
> 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/e43d49a3-e950-4396-9f90-3b1cd6f7af0an%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/e43d49a3-e950-4396-9f90-3b1cd6f7af0an%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAA7BsYjNwvTR_9Oe6O%2BS6Dfqsg77n6sy-oY9N4ubOAknoN2NWA%40mail.gmail.com.


login with token instead of password

2024-01-16 Thread ABDUL HAFEEZ
example: 
I have a model with fields username and password 
when users create account  there credentials saved in db next I want that 
*instead 
of login with password I want create token *so he can login with token not 
password

what should I do
please provide me logic steps if someone have done already

-- 
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/e43d49a3-e950-4396-9f90-3b1cd6f7af0an%40googlegroups.com.


Re: Problems in Django login authentication

2023-07-31 Thread Joshua Urasa
To add up..I see others comments told you to abstractUser ... this is when
you need to modify the default user maybe to add up other fields in default
user like age or date but from you code above you didn't abstractUser so
follow my previous comment and am sure you code will work

On Sun, Jul 30, 2023, 11:27 Joshua Urasa  wrote:

> If you use default user there is no need to write your model because is
> there by default so what you need to do create is form.py and inside it
> import usercreationform from then that form import to your view so that to
> handle response and request
>
> On Sun, Jul 30, 2023, 08:34 Prashanth Patelc 
> wrote:
>
>> Use default django user model
>>
>> from django.contrib.auth.models import User
>> # Create your models here.
>> class Registration (models.Model):
>> author = models.ForeignKey(User, on_delete=models.CASCADE)
>>
>> # write your fields here
>>
>>
>>
>> In settings.py
>>
>>
>> AUTH_USER_MODEL = app name . Modelname
>>
>> On Sun, Jul 30, 2023, 10:57 AM Mohammad Ehsan Ansari <
>> mdehsan...@gmail.com> wrote:
>>
>>> First extend abstract user model or abstract base user model in your
>>> user model and after that define auth.model in settings.py hope its work
>>>
>>> Sent from my iPhone
>>>
>>> On 30-Jul-2023, at 10:45 AM, Abdulrahman Abbas 
>>> wrote:
>>>
>>> 
>>> Can you login with superuser?
>>>
>>> On Sun, Jul 30, 2023, 02:32 Mh Limon  wrote:
>>>
>>>> Views.py file
>>>>
>>>> from django.shortcuts import render,HttpResponse,redirect
>>>> from .models import registration
>>>> from django.contrib.auth import authenticate,login
>>>>
>>>> def home(request):
>>>> return render(request,'home.html')
>>>>
>>>> def log_in(request):
>>>> if request.method == 'POST':
>>>> username = request.POST.get('username')
>>>> password = request.POST.get('password')
>>>>
>>>> user = authenticate(request, username=username, password=
>>>> password)
>>>>
>>>> if user is not None:
>>>> login(request, user)
>>>> return redirect('home')
>>>> else:
>>>> return HttpResponse("You have incorrect Username or
>>>> password")
>>>>
>>>> return render(request, 'log_in.html')
>>>>
>>>>
>>>> def sign_up(request):
>>>> if request.method == 'POST':
>>>> name = request.POST.get('fullname')
>>>> username = request.POST.get('username')
>>>> email = request.POST.get('email')
>>>> pass1 = request.POST.get('password')
>>>> pass2 = request.POST.get('confirm_password')
>>>>
>>>> if pass1 != pass2:
>>>> return HttpResponse("Password not matched")
>>>> else:
>>>> db = registration()
>>>>
>>>> db.Name = name
>>>> db.username = username
>>>> db.Email = email
>>>> db.Password = pass1
>>>>
>>>> db.save()
>>>>
>>>> return redirect('log_in')
>>>>
>>>>
>>>> return render(request,'sign_up.html')
>>>>
>>>> This is models.py for sqlite database:
>>>> from django.db import models
>>>>
>>>> class registration(models.Model):
>>>> Name = models.CharField(max_length=100)
>>>> username = models.CharField(max_length=100)
>>>> Email = models.CharField(max_length=100)
>>>> Password = models.CharField(max_length=100)
>>>>
>>>>
>>>> when providing the correct username and password, the system
>>>> consistently displays an error message stating "You have incorrect Username
>>>> or password."
>>>>
>>>> please help me to solve this error.
>>>>
>>>>
>>>>
>>>> --
>>>> 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...@go

Ynt: Problems in Django login authentication

2023-07-31 Thread Serkan Gülten
Password should be hash not just string Windows için Posta ile gönderildi Kimden: Mh LimonGönderilme: 30 Temmuz 2023 Pazar 04:32Kime: Django usersKonu: Problems in Django login authentication Views.py file  from django.shortcuts import render,HttpResponse,redirectfrom .models import registrationfrom django.contrib.auth import authenticate,login def home(request):    return render(request,'home.html') def log_in(request):    if request.method == 'POST':        username = request.POST.get('username')        password = request.POST.get('password')         user = authenticate(request, username=username, password=password)         if user is not None:            login(request, user)            return redirect('home')        else:            return HttpResponse("You have incorrect Username or password")     return render(request, 'log_in.html') def sign_up(request):    if request.method == 'POST':        name = request.POST.get('fullname')        username = request.POST.get('username')        email = request.POST.get('email')        pass1 = request.POST.get('password')        pass2 = request.POST.get('confirm_password')         if pass1 != pass2:            return HttpResponse("Password not matched")        else:            db = registration()             db.Name = name            db.username = username            db.Email = email            db.Password = pass1             db.save()             return redirect('log_in')     return render(request,'sign_up.html') This is models.py for sqlite database: from django.db import models class registration(models.Model):    Name = models.CharField(max_length=100)    username = models.CharField(max_length=100)    Email = models.CharField(max_length=100)    Password = models.CharField(max_length=100)  when providing the correct username and password, the system consistently displays an error message stating "You have incorrect Username or password."please help me to solve this error.  -- 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/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%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/4D4A2A26-6FAB-4D8C-ABF2-21CBA9B212AC%40hxcore.ol.


Re: Problems in Django login authentication

2023-07-31 Thread Joshua Urasa
If you use default user there is no need to write your model because is
there by default so what you need to do create is form.py and inside it
import usercreationform from then that form import to your view so that to
handle response and request

On Sun, Jul 30, 2023, 08:34 Prashanth Patelc 
wrote:

> Use default django user model
>
> from django.contrib.auth.models import User
> # Create your models here.
> class Registration (models.Model):
> author = models.ForeignKey(User, on_delete=models.CASCADE)
>
> # write your fields here
>
>
>
> In settings.py
>
>
> AUTH_USER_MODEL = app name . Modelname
>
> On Sun, Jul 30, 2023, 10:57 AM Mohammad Ehsan Ansari 
> wrote:
>
>> First extend abstract user model or abstract base user model in your user
>> model and after that define auth.model in settings.py hope its work
>>
>> Sent from my iPhone
>>
>> On 30-Jul-2023, at 10:45 AM, Abdulrahman Abbas 
>> wrote:
>>
>> 
>> Can you login with superuser?
>>
>> On Sun, Jul 30, 2023, 02:32 Mh Limon  wrote:
>>
>>> Views.py file
>>>
>>> from django.shortcuts import render,HttpResponse,redirect
>>> from .models import registration
>>> from django.contrib.auth import authenticate,login
>>>
>>> def home(request):
>>> return render(request,'home.html')
>>>
>>> def log_in(request):
>>> if request.method == 'POST':
>>> username = request.POST.get('username')
>>> password = request.POST.get('password')
>>>
>>> user = authenticate(request, username=username, password=
>>> password)
>>>
>>> if user is not None:
>>> login(request, user)
>>> return redirect('home')
>>> else:
>>> return HttpResponse("You have incorrect Username or
>>> password")
>>>
>>> return render(request, 'log_in.html')
>>>
>>>
>>> def sign_up(request):
>>> if request.method == 'POST':
>>> name = request.POST.get('fullname')
>>> username = request.POST.get('username')
>>> email = request.POST.get('email')
>>> pass1 = request.POST.get('password')
>>> pass2 = request.POST.get('confirm_password')
>>>
>>> if pass1 != pass2:
>>> return HttpResponse("Password not matched")
>>> else:
>>> db = registration()
>>>
>>> db.Name = name
>>> db.username = username
>>> db.Email = email
>>> db.Password = pass1
>>>
>>> db.save()
>>>
>>> return redirect('log_in')
>>>
>>>
>>> return render(request,'sign_up.html')
>>>
>>> This is models.py for sqlite database:
>>> from django.db import models
>>>
>>> class registration(models.Model):
>>> Name = models.CharField(max_length=100)
>>> username = models.CharField(max_length=100)
>>> Email = models.CharField(max_length=100)
>>> Password = models.CharField(max_length=100)
>>>
>>>
>>> when providing the correct username and password, the system
>>> consistently displays an error message stating "You have incorrect Username
>>> or password."
>>>
>>> please help me to solve this error.
>>>
>>>
>>>
>>> --
>>> 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/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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/CAGGqo0MMu55nqSSKhW2%2BjGgGCGf62JJoBuCZA2wgK3NONCxzCg%40mail.gmail.com
>> 

Re: Problems in Django login authentication

2023-07-31 Thread Mh Limon
Thank you all.My problem is solved.

On Sunday, July 30, 2023 at 11:34:43 AM UTC+6 Prashanth Patelc wrote:

> Use default django user model 
>
> from django.contrib.auth.models import User
> # Create your models here.
> class Registration (models.Model):
> author = models.ForeignKey(User, on_delete=models.CASCADE)
> 
> # write your fields here
>
>
>
> In settings.py
>
>
> AUTH_USER_MODEL = app name . Modelname
>
> On Sun, Jul 30, 2023, 10:57 AM Mohammad Ehsan Ansari  
> wrote:
>
>> First extend abstract user model or abstract base user model in your user 
>> model and after that define auth.model in settings.py hope its work
>>
>> Sent from my iPhone
>>
>> On 30-Jul-2023, at 10:45 AM, Abdulrahman Abbas  
>> wrote:
>>
>> 
>> Can you login with superuser?
>>
>> On Sun, Jul 30, 2023, 02:32 Mh Limon  wrote:
>>
>>> Views.py file 
>>>
>>> from django.shortcuts import render,HttpResponse,redirect
>>> from .models import registration
>>> from django.contrib.auth import authenticate,login
>>>
>>> def home(request):
>>> return render(request,'home.html')
>>>
>>> def log_in(request):
>>> if request.method == 'POST':
>>> username = request.POST.get('username')
>>> password = request.POST.get('password')
>>>
>>> user = authenticate(request, username=username, password=
>>> password)
>>>
>>> if user is not None:
>>> login(request, user)
>>> return redirect('home')
>>> else:
>>> return HttpResponse("You have incorrect Username or 
>>> password")
>>>
>>> return render(request, 'log_in.html')
>>>
>>>
>>> def sign_up(request):
>>> if request.method == 'POST':
>>> name = request.POST.get('fullname')
>>> username = request.POST.get('username')
>>> email = request.POST.get('email')
>>> pass1 = request.POST.get('password')
>>> pass2 = request.POST.get('confirm_password')
>>>
>>> if pass1 != pass2:
>>> return HttpResponse("Password not matched")
>>> else:
>>> db = registration()
>>>
>>> db.Name = name
>>> db.username = username
>>> db.Email = email
>>> db.Password = pass1
>>>
>>> db.save()
>>>
>>> return redirect('log_in')
>>>
>>>
>>> return render(request,'sign_up.html')
>>>
>>> This is models.py for sqlite database: 
>>> from django.db import models
>>>
>>> class registration(models.Model):
>>> Name = models.CharField(max_length=100)
>>> username = models.CharField(max_length=100)
>>> Email = models.CharField(max_length=100)
>>> Password = models.CharField(max_length=100)
>>>
>>>
>>> when providing the correct username and password, the system 
>>> consistently displays an error message stating "You have incorrect Username 
>>> or password."
>>>
>>> please help me to solve this error.
>>>
>>>
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAGGqo0MMu55nqSSKhW2%2BjGgGCGf62JJoBuCZA2wgK3NONCxzCg%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/CAGGqo0MMu55nqSSKhW2%2BjGgGCGf62JJoBuCZA2wgK3NONCxzCg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> -- 
>> 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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/BF995111-54EC-4CD1-A3E8-FE4F35AE49B1%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/django-users/BF995111-54EC-4CD1-A3E8-FE4F35AE49B1%40gmail.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/080b9766-217a-488b-be58-8f3f6b3662d8n%40googlegroups.com.


Re: Problems in Django login authentication

2023-07-29 Thread Prashanth Patelc
Use default django user model

from django.contrib.auth.models import User
# Create your models here.
class Registration (models.Model):
author = models.ForeignKey(User, on_delete=models.CASCADE)

# write your fields here



In settings.py


AUTH_USER_MODEL = app name . Modelname

On Sun, Jul 30, 2023, 10:57 AM Mohammad Ehsan Ansari 
wrote:

> First extend abstract user model or abstract base user model in your user
> model and after that define auth.model in settings.py hope its work
>
> Sent from my iPhone
>
> On 30-Jul-2023, at 10:45 AM, Abdulrahman Abbas 
> wrote:
>
> 
> Can you login with superuser?
>
> On Sun, Jul 30, 2023, 02:32 Mh Limon  wrote:
>
>> Views.py file
>>
>> from django.shortcuts import render,HttpResponse,redirect
>> from .models import registration
>> from django.contrib.auth import authenticate,login
>>
>> def home(request):
>> return render(request,'home.html')
>>
>> def log_in(request):
>> if request.method == 'POST':
>> username = request.POST.get('username')
>> password = request.POST.get('password')
>>
>>     user = authenticate(request, username=username, password=
>> password)
>>
>> if user is not None:
>> login(request, user)
>> return redirect('home')
>> else:
>> return HttpResponse("You have incorrect Username or password"
>> )
>>
>> return render(request, 'log_in.html')
>>
>>
>> def sign_up(request):
>> if request.method == 'POST':
>> name = request.POST.get('fullname')
>> username = request.POST.get('username')
>> email = request.POST.get('email')
>> pass1 = request.POST.get('password')
>> pass2 = request.POST.get('confirm_password')
>>
>> if pass1 != pass2:
>> return HttpResponse("Password not matched")
>> else:
>> db = registration()
>>
>> db.Name = name
>> db.username = username
>> db.Email = email
>> db.Password = pass1
>>
>> db.save()
>>
>> return redirect('log_in')
>>
>>
>> return render(request,'sign_up.html')
>>
>> This is models.py for sqlite database:
>> from django.db import models
>>
>> class registration(models.Model):
>> Name = models.CharField(max_length=100)
>> username = models.CharField(max_length=100)
>> Email = models.CharField(max_length=100)
>> Password = models.CharField(max_length=100)
>>
>>
>> when providing the correct username and password, the system consistently
>> displays an error message stating "You have incorrect Username or password."
>>
>> please help me to solve this error.
>>
>>
>>
>> --
>> 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/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAGGqo0MMu55nqSSKhW2%2BjGgGCGf62JJoBuCZA2wgK3NONCxzCg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGGqo0MMu55nqSSKhW2%2BjGgGCGf62JJoBuCZA2wgK3NONCxzCg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> --
> 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/BF995111-54EC-4CD1-A3E8-FE4F35AE49B1%40gmail.com
> <https://groups.google.com/d/msgid/django-users/BF995111-54EC-4CD1-A3E8-FE4F35AE49B1%40gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAMCU6CrPDJKA0riTFhZcPLp8MAhqRs3-XZiDrgZNF2PNWAz2Zw%40mail.gmail.com.


Re: Problems in Django login authentication

2023-07-29 Thread Mohammad Ehsan Ansari
First extend abstract user model or abstract base user model in your user model and after that define auth.model in settings.py hope its workSent from my iPhoneOn 30-Jul-2023, at 10:45 AM, Abdulrahman Abbas  wrote:Can you login with superuser?On Sun, Jul 30, 2023, 02:32 Mh Limon <mhlimon...@gmail.com> wrote:Views.py file from django.shortcuts import render,HttpResponse,redirectfrom .models import registrationfrom django.contrib.auth import authenticate,logindef home(request):    return render(request,'home.html')def log_in(request):    if request.method == 'POST':        username = request.POST.get('username')        password = request.POST.get('password')        user = authenticate(request, username=username, password=password)        if user is not None:            login(request, user)            return redirect('home')        else:            return HttpResponse("You have incorrect Username or password")    return render(request, 'log_in.html')def sign_up(request):    if request.method == 'POST':        name = request.POST.get('fullname')        username = request.POST.get('username')        email = request.POST.get('email')        pass1 = request.POST.get('password')        pass2 = request.POST.get('confirm_password')        if pass1 != pass2:            return HttpResponse("Password not matched")        else:            db = registration()            db.Name = name            db.username = username            db.Email = email            db.Password = pass1            db.save()            return redirect('log_in')    return render(request,'sign_up.html')This is models.py for sqlite database:
from django.db import modelsclass registration(models.Model):    Name = models.CharField(max_length=100)    username = models.CharField(max_length=100)    Email = models.CharField(max_length=100)    Password = models.CharField(max_length=100)when providing the correct username and password, the system consistently displays an error message stating "You have incorrect Username or password."please help me to solve this error.




-- 
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/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%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/CAGGqo0MMu55nqSSKhW2%2BjGgGCGf62JJoBuCZA2wgK3NONCxzCg%40mail.gmail.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/BF995111-54EC-4CD1-A3E8-FE4F35AE49B1%40gmail.com.


Re: Problems in Django login authentication

2023-07-29 Thread Abdulrahman Abbas
Can you login with superuser?

On Sun, Jul 30, 2023, 02:32 Mh Limon  wrote:

> Views.py file
>
> from django.shortcuts import render,HttpResponse,redirect
> from .models import registration
> from django.contrib.auth import authenticate,login
>
> def home(request):
> return render(request,'home.html')
>
> def log_in(request):
> if request.method == 'POST':
> username = request.POST.get('username')
> password = request.POST.get('password')
>
> user = authenticate(request, username=username, password=password)
>
> if user is not None:
> login(request, user)
> return redirect('home')
> else:
> return HttpResponse("You have incorrect Username or password")
>
> return render(request, 'log_in.html')
>
>
> def sign_up(request):
> if request.method == 'POST':
> name = request.POST.get('fullname')
> username = request.POST.get('username')
> email = request.POST.get('email')
> pass1 = request.POST.get('password')
> pass2 = request.POST.get('confirm_password')
>
> if pass1 != pass2:
> return HttpResponse("Password not matched")
> else:
> db = registration()
>
> db.Name = name
> db.username = username
> db.Email = email
> db.Password = pass1
>
> db.save()
>
> return redirect('log_in')
>
>
> return render(request,'sign_up.html')
>
> This is models.py for sqlite database:
> from django.db import models
>
> class registration(models.Model):
> Name = models.CharField(max_length=100)
> username = models.CharField(max_length=100)
> Email = models.CharField(max_length=100)
> Password = models.CharField(max_length=100)
>
>
> when providing the correct username and password, the system consistently
> displays an error message stating "You have incorrect Username or password."
>
> please help me to solve this error.
>
>
>
> --
> 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/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAGGqo0MMu55nqSSKhW2%2BjGgGCGf62JJoBuCZA2wgK3NONCxzCg%40mail.gmail.com.


Problems in Django login authentication

2023-07-29 Thread Mh Limon
Views.py file 

from django.shortcuts import render,HttpResponse,redirect
from .models import registration
from django.contrib.auth import authenticate,login

def home(request):
return render(request,'home.html')

def log_in(request):
if request.method == 'POST':
username = request.POST.get('username')
password = request.POST.get('password')

user = authenticate(request, username=username, password=password)

if user is not None:
login(request, user)
return redirect('home')
else:
return HttpResponse("You have incorrect Username or password")

return render(request, 'log_in.html')


def sign_up(request):
if request.method == 'POST':
name = request.POST.get('fullname')
username = request.POST.get('username')
email = request.POST.get('email')
pass1 = request.POST.get('password')
pass2 = request.POST.get('confirm_password')

if pass1 != pass2:
return HttpResponse("Password not matched")
else:
db = registration()

db.Name = name
db.username = username
db.Email = email
db.Password = pass1

db.save()

return redirect('log_in')


return render(request,'sign_up.html')

This is models.py for sqlite database: 
from django.db import models

class registration(models.Model):
Name = models.CharField(max_length=100)
username = models.CharField(max_length=100)
Email = models.CharField(max_length=100)
Password = models.CharField(max_length=100)


when providing the correct username and password, the system consistently 
displays an error message stating "You have incorrect Username or password."

please help me to solve this error.



-- 
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/4003937f-9045-4cea-bd6c-b071d7b1a6c3n%40googlegroups.com.


i am unable to login with this code

2023-06-29 Thread Gollamudi Rohith Sai
-- 
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/507df760-e873-4372-b20d-9b218fbf1496n%40googlegroups.com.
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login
from django.contrib import messages
from .forms import VideoUploadForm
from .models import Video, Progress
from django.http import JsonResponse
from django.contrib.auth.models import User
from django.middleware.csrf import get_token
from django.urls import reverse_lazy

def home(request):
return render(request, 'home.html')

def login_view(request):
if request.method == 'POST':
username = request.POST['username']
password = request.POST['password']
user = authenticate(request, username=username, password=password)
if user is not None:
    login(request, user)
return JsonResponse({'success': True})  # Return success response
else:
return JsonResponse({'success': False, 'message': 'Invalid username or password.'})  # Return failure response
else:
return render(request, 'login.html')

"""def login_view(request):
continue_watching_url = reverse_lazy('continue_watching')
return render(request, 'login.html', {'continue_watching_url': continue_watching_url})"""

"""@login_required
def continue_watching(request):
user = request.user
progress_list = Progress.objects.filter(user=user)
context = {'progress_list': progress_list}
return render(request, 'continue_watching.html', context)"""

@login_required
def continue_watching_view(request):
progress_list = [
{'video': {'id': 1, 'title': 'Video 1'}, 'progress': 50},
{'video': {'id': 2, 'title': 'Video 2'}, 'progress': 80},
{'video': {'id': 3, 'title': 'Video 3'}, 'progress': 10},
]
return render(request, 'continue_watching.html', {'progress_list': progress_list})

def get_progress_view(request, video_id):
# Perform logic to fetch progress for the given video_id
# Replace this with your actual implementation
progress = 0
if video_id == 1:
progress = 75
elif video_id == 2:
progress = 50
elif video_id == 3:
progress = 90

return JsonResponse({'progress': progress})


def update_progress(request, video_id):
# Your logic to update the video progress
video = Video.objects.get(id=video_id)
csrf_token = get_token(request)  # Retrieve the CSRF token using the get_token() function

return render(request, 'update_progress.html', {'video_id': video_id, 'csrf_token': csrf_token})

def upload_video(request):
if request.method == 'POST':
form = VideoUploadForm(request.POST, request.FILES)
if form.is_valid():
form.save()
return redirect('video_list')
else:
form = VideoUploadForm()
return render(request, 'upload_video.html', {'form': form})

def video_list(request):
videos = Video.objects.all()
return render(request, 'video_list.html', {'videos': videos})

def display_video(request, video_id):
video = Video.objects.get(id=video_id)
return render(request, 'display_video.html', {'video': video})
Title: Upload Video






Upload Video

{% csrf_token %}
    {{ form.as_p }}
Upload



Title: Login





Login

    
    {% csrf_token %}


Login





Title: Home





Welcome to the Home Page
This is the content of the home page.
Feel free to explore our website and discover amazing features.
Get Started





Title: Video List




Video List

{% for video in videos %}

{{ video.title }}

Your browser does not support the video tag.


{% empty %}
No videos available.
{% endfor %}



Title: Continue Watching




Continue Watching
{% if progress_list %}

{% for progress in progress_list %}

{{ progress.video.title }}
{{ progress.progress }}

{% endfor %}

{% else %}
No videos available.
{% endif %}



Title: Update Progress






Update Video Progress

Progress:


Update Progress




from django.conf.urls.static import static
from django.conf import settings
from django.urls import path, include
from django.contrib import admin
from myapp import vie

Multiuser Login and Registration required

2023-05-21 Thread chen...@gmail.com
I need a tutorial from scratch on how new Users can register and login 
having different forms for HOD, Staff and Student. 

I need tutorial on Multiusers

Thank you

-- 
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/eba30d6c-8bcc-4642-a8a2-0ddcbaf6c8adn%40googlegroups.com.


Re: Django-allauth & Facebook login

2023-04-01 Thread Namanya Daniel
Follow the following link, it shows you how to create a custom ssl
certificate and how to run ssl server
https://medium.com/@millienakiganda/creating-an-ssl-certificate-for-localhost-in-django-framework-45290d905b88



On Sat, 1 Apr 2023 at 15:32, Marcelo A. Robin 
wrote:

> Hi, I'm trying to use django-allauth to create a facebook login system.  i
> managed to get it all done but in my local test i get an error where
> facebook tells me my app path is not safe.  I understand that my
> http://localhost is missing the https://localhost.  this is so ?  How can
> I add https to my Django test server?
>
> I think there is an add-on that by installing it creates the https at the
> beginning of the route 127.0.0.1:8000.  What I don't know is if, when
> uploading the project to production, I should remove that library along
> with all the configurations that I have to do in settings.py
>
> --
> 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/a2e6588d-9808-485d-8099-82d043833922n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a2e6588d-9808-485d-8099-82d043833922n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAP4VW2Xdukfpuy%2Bxv4gmpcTzdx%3De8kenzp0aZkZwm2VAfx0_5w%40mail.gmail.com.


Django-allauth & Facebook login

2023-04-01 Thread Marcelo A. Robin
Hi, I'm trying to use django-allauth to create a facebook login system.  i 
managed to get it all done but in my local test i get an error where 
facebook tells me my app path is not safe.  I understand that my 
http://localhost is missing the https://localhost.  this is so ?  How can I 
add https to my Django test server?

I think there is an add-on that by installing it creates the https at the 
beginning of the route 127.0.0.1:8000.  What I don't know is if, when 
uploading the project to production, I should remove that library along 
with all the configurations that I have to do in settings.py

-- 
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/a2e6588d-9808-485d-8099-82d043833922n%40googlegroups.com.


Login and Logout using Django JWT Token

2023-03-05 Thread Themporst Aiden
Am working on a personal project, my plan is to build Mobile App in the 
future for it. I have already developed the backend api endpoints using 
Django Rest Framework and JWT. But the challenge now is that how can i 
consume the rest api endpoints from my same django project. ? I know how to 
send POST and GET request from Django. But how do i use the access and 
refresh token in the header for every request that need authentication. 
>From what i know so far, the access token expire so soon, and i need to 
store the refresh token on cookie. And whenever i need it i will just get 
the refresh token from the cookie and use it to send a post request to the 
refresh token endpoint, which will now get me access token. But my question 
is how do i do it ? 

I mean the code to login user and  alway make sure the access token is 
present whenever am sending a request  to the api endpoint 

-- 
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/8b4f8e12-c1f7-4733-a335-cf099b3036fdn%40googlegroups.com.


Re: it is very hard to find both email and phone number as username to login

2023-02-26 Thread Raphael Polanco
The username would be both a security risk and too damn long.

On Sun, Feb 26, 2023 at 9:20 AM Adeyemi Deji  wrote:

> Y do u need both?
>
> On Sun, 26 Feb 2023, 15:13 Manobhav Joshi,  wrote:
>
>> is there any way to use both email and phone number as username to login
>> safely which we can use authenticate() function.
>>
>> --
>> 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/fd5721c4-0a55-48c3-8a1c-5ef75e470e1cn%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/fd5721c4-0a55-48c3-8a1c-5ef75e470e1cn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAEO1Gron3DwbppShgPmED%2BfR%3DgbEfhKeuUu1M3dPeXgNoQbaSA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAEO1Gron3DwbppShgPmED%2BfR%3DgbEfhKeuUu1M3dPeXgNoQbaSA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAJoAtSmqRKqfFL%2B5qBRnhrS6nVK6M1Btfj9d7JmG_EkcQr%2BKZA%40mail.gmail.com.


Re: it is very hard to find both email and phone number as username to login

2023-02-26 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



I use a plugin / python program

AUTHENTICATION_BACKENDS = (
# AxesStandaloneBackend should be the first backend in the 
AUTHENTICATION_BACKENDS list.

'axes.backends.AxesModelBackend',

'django.contrib.auth.email-auth.EmailBackend',
'django.contrib.auth.backends.ModelBackend',
 )

email-auth.py

place in project root or

/usr/local/lib/python2.7/site-packages/Django-1.11.29-py2.7.egg/django/contrib/auth

use phone number for the user account id and email address will kick in 
automatically


can use either for login with valid password



___
# cat email-auth.py
from django.contrib.auth.models import User
import re

# vem = Verify E-Mail.  This regular expression is from 
http://www.regular-expressions.info/email.html

# and is designed to detect anything that meets the RFC-2822 standard.
vem = 
re.compile(r"""(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])""", 
re.I)



class BasicBackend:
def get_user(self, user_id):
try:
return User.objects.get(pk=user_id)
except User.DoesNotExist:
return None

class EmailBackend(BasicBackend):
def authenticate(self, username=None, password=None):
#If username is an email address, then try to pull it up
if vem.search(username):
try:
user = User.objects.get(email=username)
except User.DoesNotExist:
return None
else:
#We have a non-email address username we should 
try username

try:
user = User.objects.get(username=username)
except User.DoesNotExist:
return None
if user.check_password(password):
return user





Happy Sunday !!!
Thanks - paul

Paul Kudla


Scom.ca Internet Services <http://www.scom.ca>
004-1009 Byron Street South
Whitby, Ontario - Canada
L1N 4S3

Toronto 416.642.7266
Main 1.866.411.7266
Fax 1.888.892.7266
Email p...@scom.ca

On 2023-02-26 8:35 a.m., Manobhav Joshi wrote:
is there any way to use both email and phone number as username to login 
safely which we can use authenticate() function.


--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fd5721c4-0a55-48c3-8a1c-5ef75e470e1cn%40googlegroups.com <https://groups.google.com/d/msgid/django-users/fd5721c4-0a55-48c3-8a1c-5ef75e470e1cn%40googlegroups.com?utm_medium=email_source=footer>.


--
This message has been scanned for viruses and
dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
believed to be clean.


--
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/a875a175-d6d2-1ab2-c9aa-3460ee1e97c8%40scom.ca.


Re: it is very hard to find both email and phone number as username to login

2023-02-26 Thread Adeyemi Deji
Y do u need both?

On Sun, 26 Feb 2023, 15:13 Manobhav Joshi,  wrote:

> is there any way to use both email and phone number as username to login
> safely which we can use authenticate() function.
>
> --
> 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/fd5721c4-0a55-48c3-8a1c-5ef75e470e1cn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/fd5721c4-0a55-48c3-8a1c-5ef75e470e1cn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAEO1Gron3DwbppShgPmED%2BfR%3DgbEfhKeuUu1M3dPeXgNoQbaSA%40mail.gmail.com.


it is very hard to find both email and phone number as username to login

2023-02-26 Thread Manobhav Joshi
is there any way to use both email and phone number as username to login 
safely which we can use authenticate() function.

-- 
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/fd5721c4-0a55-48c3-8a1c-5ef75e470e1cn%40googlegroups.com.


Re: Please i need help in creating a Login page with Django

2023-01-20 Thread Aditi Dwivedi
You have to first create a superuser in your django project.
It is same as creating a root user in Linux or admin user in windows.
Super user can be created as..
1. Run command in django terminal
 Python manage.py createsuperuser


2. It will ask for user name, emai and password.

3. Run command
Python manage.py runserver.


Hope this helps.

On Thu, 19 Jan 2023, 6:51 pm Radhika Soni,  wrote:

> Hello,
> You can take help from udemy or coursera courses.
>
> On Thu, Jan 19, 2023, 4:36 PM Hubert Kanyamahanga 
> wrote:
>
>> Please share what you have been able to do, where you are blocked and
>> from there we can guide you, because, we don't even know which videos you
>> have been viewing!
>>
>> On Wednesday, January 18, 2023 at 11:56:45 PM UTC+1 macca...@gmail.com
>> wrote:
>>
>>> I am trying everything possible to create a basic login page with
>>> Django., i have tried so many videos and online tutorial, but still can't
>>> make anything meaningful out of it. Can anyone please take me through a
>>> systematic process please, since i am new here and want to take Django to
>>> be my friend
>>
>> --
>> 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/61f6c9f9-2973-4572-ae51-8689d6521292n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/61f6c9f9-2973-4572-ae51-8689d6521292n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAGhU6zNsAmutLvJRFdHMPOU8ZKS4Oywha%2B%3DoOWkKAUw4tsh61A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGhU6zNsAmutLvJRFdHMPOU8ZKS4Oywha%2B%3DoOWkKAUw4tsh61A%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAHBdd%2BAnpzf1N7VxS7Ue4OdEtzBzUTDf%3DizDmRkwA7xfvpdcZA%40mail.gmail.com.


Re: Please i need help in creating a Login page with Django

2023-01-19 Thread M Adnan
Join this group to discuss your issues with developers link below ,


https://chat.whatsapp.com/ICXdXOrbgoNFQTbKxalZD1

On Thu, 19 Jan 2023, 6:21 pm Radhika Soni,  wrote:

> Hello,
> You can take help from udemy or coursera courses.
>
> On Thu, Jan 19, 2023, 4:36 PM Hubert Kanyamahanga 
> wrote:
>
>> Please share what you have been able to do, where you are blocked and
>> from there we can guide you, because, we don't even know which videos you
>> have been viewing!
>>
>> On Wednesday, January 18, 2023 at 11:56:45 PM UTC+1 macca...@gmail.com
>> wrote:
>>
>>> I am trying everything possible to create a basic login page with
>>> Django., i have tried so many videos and online tutorial, but still can't
>>> make anything meaningful out of it. Can anyone please take me through a
>>> systematic process please, since i am new here and want to take Django to
>>> be my friend
>>
>> --
>> 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/61f6c9f9-2973-4572-ae51-8689d6521292n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/61f6c9f9-2973-4572-ae51-8689d6521292n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAGhU6zNsAmutLvJRFdHMPOU8ZKS4Oywha%2B%3DoOWkKAUw4tsh61A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGhU6zNsAmutLvJRFdHMPOU8ZKS4Oywha%2B%3DoOWkKAUw4tsh61A%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CABNyTSpXT57HOuVSWcmLk1NxSyq9F8hsZPYiWY0CtSRzk_2KpQ%40mail.gmail.com.


Re: Please i need help in creating a Login page with Django

2023-01-19 Thread ritik sahoo
Ofcourse

On Thu, 19 Jan, 2023, 7:40 pm Sebastian Jung, 
wrote:

> I think this is a good start or?
>
> https://github.com/earthcomfy/Django-registration-and-login-system
>
> Namanya Daniel  schrieb am Do., 19. Jan. 2023,
> 15:00:
>
>> Explain where you’re failing exactly, is it views, forms, templates or
>> models
>>
>> On Thu, 19 Jan 2023 at 01:56, Michael R. KOOMSON 
>> wrote:
>>
>>> I am trying everything possible to create a basic login page with
>>> Django., i have tried so many videos and online tutorial, but still can't
>>> make anything meaningful out of it. Can anyone please take me through a
>>> systematic process please, since i am new here and want to take Django to
>>> be my friend
>>>
>>> --
>>> 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/0c495fc8-ce4e-4d6f-a2d7-7b2d8478b06an%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/CAP4VW2V%3DuVe2p%3DCQJBWup%3DDcn4FGs5dLFp-zGEqXLQK6xwD6VQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAP4VW2V%3DuVe2p%3DCQJBWup%3DDcn4FGs5dLFp-zGEqXLQK6xwD6VQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAKGT9mxg9yy3OXojtu67UUSADUbrpYe%2B%2BQT2aFBW6h2tKMGN7w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKGT9mxg9yy3OXojtu67UUSADUbrpYe%2B%2BQT2aFBW6h2tKMGN7w%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAJwehCs8e4sZ9wGOoqq_8pA_OS6D%2BQgww2%2B9VvLgtwkV%3DoBWag%40mail.gmail.com.


Re: Please i need help in creating a Login page with Django

2023-01-19 Thread Sebastian Jung
I think this is a good start or?

https://github.com/earthcomfy/Django-registration-and-login-system

Namanya Daniel  schrieb am Do., 19. Jan. 2023,
15:00:

> Explain where you’re failing exactly, is it views, forms, templates or
> models
>
> On Thu, 19 Jan 2023 at 01:56, Michael R. KOOMSON 
> wrote:
>
>> I am trying everything possible to create a basic login page with
>> Django., i have tried so many videos and online tutorial, but still can't
>> make anything meaningful out of it. Can anyone please take me through a
>> systematic process please, since i am new here and want to take Django to
>> be my friend
>>
>> --
>> 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/0c495fc8-ce4e-4d6f-a2d7-7b2d8478b06an%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/CAP4VW2V%3DuVe2p%3DCQJBWup%3DDcn4FGs5dLFp-zGEqXLQK6xwD6VQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAP4VW2V%3DuVe2p%3DCQJBWup%3DDcn4FGs5dLFp-zGEqXLQK6xwD6VQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAKGT9mxg9yy3OXojtu67UUSADUbrpYe%2B%2BQT2aFBW6h2tKMGN7w%40mail.gmail.com.


Re: Please i need help in creating a Login page with Django

2023-01-19 Thread Namanya Daniel
Explain where you’re failing exactly, is it views, forms, templates or
models

On Thu, 19 Jan 2023 at 01:56, Michael R. KOOMSON 
wrote:

> I am trying everything possible to create a basic login page with Django.,
> i have tried so many videos and online tutorial, but still can't make
> anything meaningful out of it. Can anyone please take me through a
> systematic process please, since i am new here and want to take Django to
> be my friend
>
> --
> 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/0c495fc8-ce4e-4d6f-a2d7-7b2d8478b06an%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/CAP4VW2V%3DuVe2p%3DCQJBWup%3DDcn4FGs5dLFp-zGEqXLQK6xwD6VQ%40mail.gmail.com.


Re: Please i need help in creating a Login page with Django

2023-01-19 Thread ritik sahoo
If u will follow geekyshows channel on YouTube your basic must be cleared


On Thu, 19 Jan, 2023, 6:51 pm Radhika Soni,  wrote:

> Hello,
> You can take help from udemy or coursera courses.
>
> On Thu, Jan 19, 2023, 4:36 PM Hubert Kanyamahanga 
> wrote:
>
>> Please share what you have been able to do, where you are blocked and
>> from there we can guide you, because, we don't even know which videos you
>> have been viewing!
>>
>> On Wednesday, January 18, 2023 at 11:56:45 PM UTC+1 macca...@gmail.com
>> wrote:
>>
>>> I am trying everything possible to create a basic login page with
>>> Django., i have tried so many videos and online tutorial, but still can't
>>> make anything meaningful out of it. Can anyone please take me through a
>>> systematic process please, since i am new here and want to take Django to
>>> be my friend
>>
>> --
>> 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/61f6c9f9-2973-4572-ae51-8689d6521292n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/61f6c9f9-2973-4572-ae51-8689d6521292n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAGhU6zNsAmutLvJRFdHMPOU8ZKS4Oywha%2B%3DoOWkKAUw4tsh61A%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGhU6zNsAmutLvJRFdHMPOU8ZKS4Oywha%2B%3DoOWkKAUw4tsh61A%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAJwehCs3jF8TF5q%2BqY7XvWafPCprs8EtVcUA2oMLvcSUsumsJw%40mail.gmail.com.


Re: Please i need help in creating a Login page with Django

2023-01-19 Thread Radhika Soni
Hello,
You can take help from udemy or coursera courses.

On Thu, Jan 19, 2023, 4:36 PM Hubert Kanyamahanga 
wrote:

> Please share what you have been able to do, where you are blocked and from
> there we can guide you, because, we don't even know which videos you have
> been viewing!
>
> On Wednesday, January 18, 2023 at 11:56:45 PM UTC+1 macca...@gmail.com
> wrote:
>
>> I am trying everything possible to create a basic login page with
>> Django., i have tried so many videos and online tutorial, but still can't
>> make anything meaningful out of it. Can anyone please take me through a
>> systematic process please, since i am new here and want to take Django to
>> be my friend
>
> --
> 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/61f6c9f9-2973-4572-ae51-8689d6521292n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/61f6c9f9-2973-4572-ae51-8689d6521292n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAGhU6zNsAmutLvJRFdHMPOU8ZKS4Oywha%2B%3DoOWkKAUw4tsh61A%40mail.gmail.com.


Re: Please i need help in creating a Login page with Django

2023-01-19 Thread Hubert Kanyamahanga
Please share what you have been able to do, where you are blocked and from 
there we can guide you, because, we don't even know which videos you have 
been viewing!

On Wednesday, January 18, 2023 at 11:56:45 PM UTC+1 macca...@gmail.com 
wrote:

> I am trying everything possible to create a basic login page with Django., 
> i have tried so many videos and online tutorial, but still can't make 
> anything meaningful out of it. Can anyone please take me through a 
> systematic process please, since i am new here and want to take Django to 
> be my friend

-- 
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/61f6c9f9-2973-4572-ae51-8689d6521292n%40googlegroups.com.


Please i need help in creating a Login page with Django

2023-01-18 Thread Michael R. KOOMSON
I am trying everything possible to create a basic login page with Django., 
i have tried so many videos and online tutorial, but still can't make 
anything meaningful out of it. Can anyone please take me through a 
systematic process please, since i am new here and want to take Django to 
be my friend

-- 
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/0c495fc8-ce4e-4d6f-a2d7-7b2d8478b06an%40googlegroups.com.


Re: Location identification with login

2022-12-27 Thread tristant
Appreciate everyone's pointers!

Cheers,

On Sunday, December 25, 2022 at 9:26:50 PM UTC-7 yebo...@gmail.com wrote:

> This can be done GeoIP but it can be done in a different way I have done 
> one before that was with REST API, all you have to do if you don't want to 
> depend on any third library is to have a device model which stores the user 
> and IP then whenever the user login saves it.
> So with this, you have all the user's IPs so when they log in again then 
> you compare their previous IPs with the current if different you can send a 
> warning mail or you just send an OTP to verify before logging in.
> What I did was for one company I worked with so I can share the code I am 
> sorry for that.
>
> On Sun, 25 Dec 2022 at 20:58, 'Kasper Laudrup' via Django users <
> django...@googlegroups.com> wrote:
>
>> On 25/12/2022 20.52, tristant wrote:
>> > Is there a mechanism in Django where we can identify the location of 
>> > login? Any reading sources regarding this functionality would be much 
>> > appreciated.
>> >
>>
>> What you're looking for is something called geoip. To the best of my 
>> knowledge there's no such thing build into Django (wouldn't really make 
>> much sense anyway) but it should be trivial to query some geoip database 
>> from your code and get a somewhat reliable idea on where that IP is 
>> coming from.
>>
>> There's no way that can be accurate but it might be useful for something 
>> like detecting a locale (that the user can then change) or similar.
>>
>>
>> > Along the same line, is there a way to prevent a login attempt if the 
>> > location is within certain blacklisted IP subnets?
>> > 
>>
>> It is trivial to spoof a source IP address once you reach the Django 
>> application part of the communication. That's more of a feature than a 
>> bug actually because of things like proxies etc.
>>
>> If you want to blacklist IPs you have to do that on a lower level. For a 
>> single server running Linux something like netfilter/iptables might be 
>> used but I'm sure there are some more convenient scripts/services etc. 
>> that might be used. The main point is that you cannot do this from your 
>> Django code.
>>
>> Hope that helps you in the right direction.
>>
>> Kind regards,
>> Kasper Laudrup
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/e83a7b85-6fd3-ced8-b4bf-fdf77650cfe8%40stacktrace.dk
>> .
>>
>

-- 
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/5f7cf341-d2fb-448e-86e9-5b828f67afa7n%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-27 Thread Manjusha
need to create database for user and need to add id column in database.

On Tuesday, December 27, 2022 at 11:32:11 PM UTC+5:30 Manjusha wrote:

> User object doesn't have attribute id so it will not work, I have checked 
> now and you can refer this documentation 
> , so you will 
> get clear idea.
>
> On Monday, December 26, 2022 at 8:10:35 PM UTC+5:30 rajm1...@gmail.com 
> wrote:
>
>> Hey, 
>>
>> Here is what you can do:
>> When User clicks the Delete profile button you use Javascript Confirm 
>> then if they press OK you go to the view.
>>
>> def delete_account(request):
>> user = User.objects.get(id=request.user.id)
>> # You first logout the user then delete the account
>> logout(request)
>> # You can use either of these
>> # To Soft Delete
>> user.active = False
>> user.save()
>> # To Hard Delete
>> user.delete()
>> messages.success("You account has been deleted Successfully!")
>> return redirect('home')
>>
>>
>> Let me know if this doesn't work.
>> -Raj Mandaviya
>>  
>>
>>
>> On Saturday, December 24, 2022 at 7:43:09 PM UTC+5:30 
>> manjushak...@gmail.com wrote:
>>
>>> Hi, I have created authentication system in Django. Anyone just tell me 
>>> how to allow user to delete the created profile with default id of the 
>>> user.[image: 
>>> Screenshot 2022-12-24 193133.png]. I I am using built-in  User 
>>> authentication libraries for this purpose and haven't created database 
>>> model for the user. But the function (the commented function under 
>>> delete_account) that I have created it is not deleting the user.
>>> Now I am trying to delete user profile using generic editing views  of 
>>> Django.
>>> Anyone tell me how to allow user to delete the created profile with 
>>> default id of the user.
>>>
>>

-- 
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/80645ba8-15e1-4856-8c24-8aac09a643bdn%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-27 Thread Manjusha
User object doesn't have attribute id so it will not work, I have checked 
now and you can refer this documentation 
, so you will 
get clear idea.

On Monday, December 26, 2022 at 8:10:35 PM UTC+5:30 rajm1...@gmail.com 
wrote:

> Hey, 
>
> Here is what you can do:
> When User clicks the Delete profile button you use Javascript Confirm then 
> if they press OK you go to the view.
>
> def delete_account(request):
> user = User.objects.get(id=request.user.id)
> # You first logout the user then delete the account
> logout(request)
> # You can use either of these
> # To Soft Delete
> user.active = False
> user.save()
> # To Hard Delete
> user.delete()
> messages.success("You account has been deleted Successfully!")
> return redirect('home')
>
>
> Let me know if this doesn't work.
> -Raj Mandaviya
>  
>
>
> On Saturday, December 24, 2022 at 7:43:09 PM UTC+5:30 
> manjushak...@gmail.com wrote:
>
>> Hi, I have created authentication system in Django. Anyone just tell me 
>> how to allow user to delete the created profile with default id of the 
>> user.[image: 
>> Screenshot 2022-12-24 193133.png]. I I am using built-in  User 
>> authentication libraries for this purpose and haven't created database 
>> model for the user. But the function (the commented function under 
>> delete_account) that I have created it is not deleting the user.
>> Now I am trying to delete user profile using generic editing views  of 
>> Django.
>> Anyone tell me how to allow user to delete the created profile with 
>> default id of the user.
>>
>

-- 
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/7e0cc95d-ff5a-4bba-9d1f-4b3e007fac07n%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-26 Thread Raj Mandaviya
Hey, 

Here is what you can do:
When User clicks the Delete profile button you use Javascript Confirm then 
if they press OK you go to the view.

def delete_account(request):
user = User.objects.get(id=request.user.id)
# You first logout the user then delete the account
logout(request)
# You can use either of these
# To Soft Delete
user.active = False
user.save()
# To Hard Delete
user.delete()
messages.success("You account has been deleted Successfully!")
return redirect('home')


Let me know if this doesn't work.
-Raj Mandaviya
 


On Saturday, December 24, 2022 at 7:43:09 PM UTC+5:30 
manjushak...@gmail.com wrote:

> Hi, I have created authentication system in Django. Anyone just tell me 
> how to allow user to delete the created profile with default id of the 
> user.[image: 
> Screenshot 2022-12-24 193133.png]. I I am using built-in  User 
> authentication libraries for this purpose and haven't created database 
> model for the user. But the function (the commented function under 
> delete_account) that I have created it is not deleting the user.
> Now I am trying to delete user profile using generic editing views  of 
> Django.
> Anyone tell me how to allow user to delete the created profile with 
> default id of the user.
>

-- 
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/61331ab5-d9a7-46a8-b770-649cffb8a6c0n%40googlegroups.com.


Re: Location identification with login

2022-12-25 Thread Yeboah Dominic
This can be done GeoIP but it can be done in a different way I have done
one before that was with REST API, all you have to do if you don't want to
depend on any third library is to have a device model which stores the user
and IP then whenever the user login saves it.
So with this, you have all the user's IPs so when they log in again then
you compare their previous IPs with the current if different you can send a
warning mail or you just send an OTP to verify before logging in.
What I did was for one company I worked with so I can share the code I am
sorry for that.

On Sun, 25 Dec 2022 at 20:58, 'Kasper Laudrup' via Django users <
django-users@googlegroups.com> wrote:

> On 25/12/2022 20.52, tristant wrote:
> > Is there a mechanism in Django where we can identify the location of
> > login? Any reading sources regarding this functionality would be much
> > appreciated.
> >
>
> What you're looking for is something called geoip. To the best of my
> knowledge there's no such thing build into Django (wouldn't really make
> much sense anyway) but it should be trivial to query some geoip database
> from your code and get a somewhat reliable idea on where that IP is
> coming from.
>
> There's no way that can be accurate but it might be useful for something
> like detecting a locale (that the user can then change) or similar.
>
>
> > Along the same line, is there a way to prevent a login attempt if the
> > location is within certain blacklisted IP subnets?
> >
>
> It is trivial to spoof a source IP address once you reach the Django
> application part of the communication. That's more of a feature than a
> bug actually because of things like proxies etc.
>
> If you want to blacklist IPs you have to do that on a lower level. For a
> single server running Linux something like netfilter/iptables might be
> used but I'm sure there are some more convenient scripts/services etc.
> that might be used. The main point is that you cannot do this from your
> Django code.
>
> Hope that helps you in the right direction.
>
> Kind regards,
> Kasper Laudrup
>
> --
> 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/e83a7b85-6fd3-ced8-b4bf-fdf77650cfe8%40stacktrace.dk
> .
>

-- 
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/CAPVAacgu6LE_%2BN%2BFknaeZsFCYvOTpsz2TkjeJhy6tcMZx7oAKg%40mail.gmail.com.


Re: Location identification with login

2022-12-25 Thread 'Kasper Laudrup' via Django users

On 25/12/2022 20.52, tristant wrote:
Is there a mechanism in Django where we can identify the location of 
login? Any reading sources regarding this functionality would be much 
appreciated.




What you're looking for is something called geoip. To the best of my 
knowledge there's no such thing build into Django (wouldn't really make 
much sense anyway) but it should be trivial to query some geoip database 
from your code and get a somewhat reliable idea on where that IP is 
coming from.


There's no way that can be accurate but it might be useful for something 
like detecting a locale (that the user can then change) or similar.



Along the same line, is there a way to prevent a login attempt if the 
location is within certain blacklisted IP subnets?




It is trivial to spoof a source IP address once you reach the Django 
application part of the communication. That's more of a feature than a 
bug actually because of things like proxies etc.


If you want to blacklist IPs you have to do that on a lower level. For a 
single server running Linux something like netfilter/iptables might be 
used but I'm sure there are some more convenient scripts/services etc. 
that might be used. The main point is that you cannot do this from your 
Django code.


Hope that helps you in the right direction.

Kind regards,
Kasper Laudrup

--
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/e83a7b85-6fd3-ced8-b4bf-fdf77650cfe8%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: Location identification with login

2022-12-25 Thread David Nugent
Yes, that is certainly possible, although there is nothing built into 
Django itself.


Web servers (and proxies) both pass the IP address of the remote user, 
which can be recorded at login together with reference to the account. 
Using GeoIP you can associate this more or less reliably to a location, 
or at least a country.  Check out the django-geoip module on pipit.org 
to start (and there are others)


The general approach to tracking website visitiors uses this technique 
and is quite a useful metric. WRT logins it can be even more useful to 
track where a user signed up and where they typically log in from. This 
can trigger, e.g. email verification when a user logs in from an 
unexpected address.


Blacklisting by source IP though, I would argue is the job more suited 
to a reverse proxy, tcpwrappers or a firewall like Linux iptables.



Regards,
David

-- Original Message --

From "tristant" 

To "Django users" 
Date 12/26/2022 6:52:13 AM
Subject Location identification with login

Is there a mechanism in Django where we can identify the location of 
login? Any reading sources regarding this functionality would be much 
appreciated.


Along the same line, is there a way to prevent a login attempt if the 
location is within certain blacklisted IP subnets?


Thanks,


--
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/emb9305966-fe60-4aa2-9da7-6526197fb4e1%405ae6308e.com.


pgpKOCEJl_s7w.pgp
Description: PGP signature


Re: How to allow user to delete their own profile after login with their default id.

2022-12-25 Thread Manjusha
Thanks, both techniques are working now i.e 1)Replacing User.delete(u.id) 
with u.delete() and in 2) user is no getting authenticated with email, it 
is authenticated with only username and password with  
authenticate function.  


   But it is 
fine.
On Monday, December 26, 2022 at 12:22:40 AM UTC+5:30 ength...@gmail.com 
wrote:

> from django.contrib.auth import  authenticate
> def delete_account(request):
> if request.method == "POST":
> email = request.POST.get('email')
> password = request.POST.get('pswd1')
>
> u = 
> User.authenticate(request=request,email=email,password=password) #this will 
> check if any user exist with current password and email .
> if u :
> print(u)  
> u.delete()
> messages.success(request,"Account is deleted 
> successfully.")
> 
> return redirect('home')
> message.error(request,'incorrect user input data')
> return redirect('home')
> 
> Reply to all
> Reply to the author
> Forward
>
>
> On Sunday, 25 December 2022 at 10:20:12 UTC+3 manjushak...@gmail.com 
> wrote:
>
>> def delete_account(request):
>> if request.method == "POST":
>> email = request.POST.get('email')
>> password = request.POST.get('pswd1')
>> 
>> u = User.objects.filter(email=email).first()
>> print(u)  
>> User.delete(u.id)
>> messages.success(request,"Account is deleted successfully.")
>> return redirect('home')
>> 
>> return render(request,"account/delete_profile.html")  
>> 
>> 
>>  by 
>> using this function i am trying to delete the user , but it shows me 
>> following error i.e attribute error so how can I find default id of the 
>> user which is already created at the time of registration, I am not using 
>> rest framework of django and also not  created any user model in 
>> model.py file.[image: 
>> error.png]In this way I'am registering the user  
>> 
>>   def register(response):
>> if response.method == "POST" :
>> username = response.POST["username"]
>> email = response.POST["email"]
>> password1 = response.POST["pswd1"]
>> password2 = response.POST["pswd2"]
>>
>> try:
>> myuser = User.objects.create_user(username, email, password1)
>> myuser.password2 = password2
>> 
>> myuser.save()
>> #if myuser.objects.filter :
>> if len(username) >10:
>> messages.error(response,"Username should contain at most 
>> 10 characters.")
>> except IntegrityError:
>> pass
>> messages.success(response,"You have successfully registered.")
>> return redirect('login')
>>   
>> return render(response,'account/registration.html')   
>> 
>> On Sunday, December 25, 2022 at 4:44:06 AM UTC+5:30 ength...@gmail.com 
>> wrote:
>>
>>> ***
>>> views.py
>>> from rest_framework import generics,permissions
>>> class NotifyDestroy(generics.DestroyAPIView):
>>> """delete current user """
>>> permission_classes=[permissions.IsAuthenticated]
>>> serializer_class=user_delete_ser
>>> queryset=User.objects.all()  
>>>
>>> *
>>> serializers.py
>>>
>>> from rest_framework.serializers import ModelSerializer
>>> class user_setting_ser(ModelSerializer):
>>> class Meta:
>>> model=User
>>> fields=['id']
>>>
>>>
>>> 
>>> urls.py
>>>
>>> path('delete_user/',NotifyDestroy.as_view(),name='delete-current-user'),
>>>  
>>>
>>>> *
>>>
>>

-- 
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/0029-29ee-4020-9b3a-b0076594fcb8n%40googlegroups.com.


Location identification with login

2022-12-25 Thread tristant
Is there a mechanism in Django where we can identify the location of login? 
Any reading sources regarding this functionality would be much appreciated.

Along the same line, is there a way to prevent a login attempt if the 
location is within certain blacklisted IP subnets?

Thanks,

-- 
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/76a1fcf2-99cc-4b6a-a55e-c5e4776dad05n%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-25 Thread Eng Thanoon
from django.contrib.auth import  authenticate
def delete_account(request):
if request.method == "POST":
email = request.POST.get('email')
password = request.POST.get('pswd1')
   
u = 
User.authenticate(request=request,email=email,password=password) #this will 
check if any user exist with current password and email .
if u :
print(u)  
u.delete()
messages.success(request,"Account is deleted successfully.")

return redirect('home')
message.error(request,'incorrect user input data')
return redirect('home')

Reply to all
Reply to the author
Forward


On Sunday, 25 December 2022 at 10:20:12 UTC+3 manjushak...@gmail.com wrote:

> def delete_account(request):
> if request.method == "POST":
> email = request.POST.get('email')
> password = request.POST.get('pswd1')
> 
> u = User.objects.filter(email=email).first()
> print(u)  
> User.delete(u.id)
> messages.success(request,"Account is deleted successfully.")
> return redirect('home')
> 
> return render(request,"account/delete_profile.html")  
> 
> 
>  by 
> using this function i am trying to delete the user , but it shows me 
> following error i.e attribute error so how can I find default id of the 
> user which is already created at the time of registration, I am not using 
> rest framework of django and also not  created any user model in 
> model.py file.[image: 
> error.png]In this way I'am registering the user  
> 
>   def register(response):
> if response.method == "POST" :
> username = response.POST["username"]
> email = response.POST["email"]
> password1 = response.POST["pswd1"]
> password2 = response.POST["pswd2"]
>
> try:
> myuser = User.objects.create_user(username, email, password1)
> myuser.password2 = password2
> 
> myuser.save()
> #if myuser.objects.filter :
> if len(username) >10:
> messages.error(response,"Username should contain at most 
> 10 characters.")
> except IntegrityError:
> pass
> messages.success(response,"You have successfully registered.")
> return redirect('login')
>   
> return render(response,'account/registration.html')   
> 
> On Sunday, December 25, 2022 at 4:44:06 AM UTC+5:30 ength...@gmail.com 
> wrote:
>
>> ***
>> views.py
>> from rest_framework import generics,permissions
>> class NotifyDestroy(generics.DestroyAPIView):
>> """delete current user """
>> permission_classes=[permissions.IsAuthenticated]
>> serializer_class=user_delete_ser
>> queryset=User.objects.all()  
>>
>> *
>> serializers.py
>>
>> from rest_framework.serializers import ModelSerializer
>> class user_setting_ser(ModelSerializer):
>> class Meta:
>> model=User
>> fields=['id']
>>
>>
>> 
>> urls.py
>>
>> path('delete_user/',NotifyDestroy.as_view(),name='delete-current-user'),
>>  
>>
>>> *
>>
>

-- 
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/cbb72d23-0740-4443-8bc2-1891b947060fn%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-25 Thread Eng Thanoon
from django.contrib.auth import  authenticate
def delete_account(request):
if request.method == "POST":
email = request.POST.get('email')
password = request.POST.get('pswd1')
   
u = 
User.authenticate(request=request,email=email,password=password) #this will 
check if any user exist with current password and email .
if u :
u.delete()
messages.success(request,"Account is deleted successfully.")
print(u)  
return redirect('home')
message.error(request,'incorrect user input data')
return redirect('home')
On Sunday, 25 December 2022 at 21:35:21 UTC+3 Ryan Nowakowski wrote:

> Use the delete method on the instance instead of the class. So replace:
> User.delete(u.id)
>
> ...with:
> u.delete()
>
>
>
> On December 25, 2022 1:20:12 AM CST, Manjusha  
> wrote:
>>
>> def delete_account(request):
>> if request.method == "POST":
>> email = request.POST.get('email')
>> password = request.POST.get('pswd1')
>> 
>> u = User.objects.filter(email=email).first()
>> print(u)  
>> User.delete(u.id)
>> messages.success(request,"Account is deleted successfully.")
>> return redirect('home')
>> 
>> return render(request,"account/delete_profile.html")  
>> 
>> 
>>  by 
>> using this function i am trying to delete the user , but it shows me 
>> following error i.e attribute error so how can I find default id of the 
>> user which is already created at the time of registration, I am not using 
>> rest framework of django and also not  created any user model in 
>> model.py file.[image: 
>> error.png]In this way I'am registering the user  
>> 
>>   def register(response):
>> if response.method == "POST" :
>> username = response.POST["username"]
>> email = response.POST["email"]
>> password1 = response.POST["pswd1"]
>> password2 = response.POST["pswd2"]
>>
>> try:
>> myuser = User.objects.create_user(username, email, password1)
>> myuser.password2 = password2
>> 
>> myuser.save()
>> #if myuser.objects.filter :
>> if len(username) >10:
>> messages.error(response,"Username should contain at most 
>> 10 characters.")
>> except IntegrityError:
>> pass
>> messages.success(response,"You have successfully registered.")
>> return redirect('login')
>>   
>> return render(response,'account/registration.html')   
>> 
>> On Sunday, December 25, 2022 at 4:44:06 AM UTC+5:30 ength...@gmail.com 
>> wrote:
>>
>>> ***
>>> views.py
>>> from rest_framework import generics,permissions
>>> class NotifyDestroy(generics.DestroyAPIView):
>>> """delete current user """
>>> permission_classes=[permissions.IsAuthenticated]
>>> serializer_class=user_delete_ser
>>> queryset=User.objects.all()  
>>>
>>> *
>>> serializers.py
>>>
>>> from rest_framework.serializers import ModelSerializer
>>> class user_setting_ser(ModelSerializer):
>>> class Meta:
>>> model=User
>>> fields=['id']
>>>
>>>
>>> 
>>> urls.py
>>>
>>> path('delete_user/',NotifyDestroy.as_view(),name='delete-current-user'),
>>>  
>>>
>>>> *
>>>
>>

-- 
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/17b887b5-8d0f-49f8-bbe4-e84592fcf1a1n%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-24 Thread Manjusha
def delete_account(request):
if request.method == "POST":
email = request.POST.get('email')
password = request.POST.get('pswd1')

u = User.objects.filter(email=email).first()
print(u)  
User.delete(u.id)
messages.success(request,"Account is deleted successfully.")
return redirect('home')

return render(request,"account/delete_profile.html")


   by 
using this function i am trying to delete the user , but it shows me 
following error i.e attribute error so how can I find default id of the 
user which is already created at the time of registration, I am not using 
rest framework of django and also not  created any user model in 
model.py file.[image: error.png]  
  In this way I'am registering the user

def register(response):
if response.method == "POST" :
username = response.POST["username"]
email = response.POST["email"]
password1 = response.POST["pswd1"]
password2 = response.POST["pswd2"]

try:
myuser = User.objects.create_user(username, email, password1)
myuser.password2 = password2

myuser.save()
#if myuser.objects.filter :
if len(username) >10:
messages.error(response,"Username should contain at most 10 
characters.")
except IntegrityError:
pass
    messages.success(response,"You have successfully registered.")
return redirect('login')
  
return render(response,'account/registration.html') 
  
On Sunday, December 25, 2022 at 4:44:06 AM UTC+5:30 ength...@gmail.com 
wrote:

> ***
> views.py
> from rest_framework import generics,permissions
> class NotifyDestroy(generics.DestroyAPIView):
> """delete current user """
> permission_classes=[permissions.IsAuthenticated]
> serializer_class=user_delete_ser
> queryset=User.objects.all()  
>
> *
> serializers.py
>
> from rest_framework.serializers import ModelSerializer
> class user_setting_ser(ModelSerializer):
> class Meta:
> model=User
> fields=['id']
>
>
> 
> urls.py
>
> path('delete_user/',NotifyDestroy.as_view(),name='delete-current-user'),
>  
>
>> *
>

-- 
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/c182bde7-8a92-4da3-8fdb-a3f7b3acdaeen%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-24 Thread Eng Thanoon
***
views.py
from rest_framework import generics,permissions
class NotifyDestroy(generics.DestroyAPIView):
"""delete current user """
permission_classes=[permissions.IsAuthenticated]
serializer_class=user_delete_ser
queryset=User.objects.all()  

*
serializers.py

from rest_framework.serializers import ModelSerializer
class user_setting_ser(ModelSerializer):
class Meta:
model=User
fields=['id']



urls.py
path('delete_user/',NotifyDestroy.as_view(),name='delete-current-user'),
 

> *

-- 
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/22fd723f-a07b-4fe1-9f70-80c23e1dcd38n%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-24 Thread Eng Thanoon
i sent message before bot never being accept from admins , don't now why ???

On Saturday, 24 December 2022 at 20:21:07 UTC+3 Ryan Nowakowski wrote:

> Well it looks like you have a good start. What, in particular, isn't 
> working? It would help if you can post the corrected code and any error 
> messages/tracebacks.
>
>
> On December 24, 2022 9:23:32 AM CST, Manjusha  
> wrote:
>>
>> want to know how to allow user to delete the created profile with default 
>> id of the user.
>>
>> On Saturday, December 24, 2022 at 8:52:32 PM UTC+5:30 Manjusha wrote:
>>
>>> that incorrect picture
>>>
>>>
>>> On Saturday, December 24, 2022 at 8:51:56 PM UTC+5:30 Manjusha wrote:
>>>
 actually the code I have written it is for function based view but it 
 not working that's why I am trying to do with generic editing views sorry 
 for that 

 On Saturday, December 24, 2022 at 8:45:05 PM UTC+5:30 Ryan Nowakowski 
 wrote:

> You're using a class-based view here but your code looks like it's 
> supposed to be for a function based view. Which style do you want to use?
>
>
> On December 24, 2022 8:13:09 AM CST, Manjusha  
> wrote:
>>
>> Hi, I have created authentication system in Django. Anyone just tell 
>> me how to allow user to delete the created profile with default id of 
>> the 
>> user.[image: Screenshot 2022-12-24 193133.png]. I I am using 
>> built-in  User authentication libraries for this purpose and haven't 
>> created database model for the user. But the function (the commented 
>> function under delete_account) that I have created it is not deleting 
>> the 
>> user.
>> Now I am trying to delete user profile using generic editing views  
>> of Django.
>> Anyone tell me how to allow user to delete the created profile with 
>> default id of the user.
>>
>>

-- 
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/fe310d88-bdc8-49f4-ba06-acc1afcb6e02n%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-24 Thread rahul sharma
Delete_status=0
Add coloum in database table
Like delete_status

On Sat, Dec 24, 2022, 20:23 Manjusha  wrote:

> want to know how to allow user to delete the created profile with default
> id of the user.
>
> On Saturday, December 24, 2022 at 8:52:32 PM UTC+5:30 Manjusha wrote:
>
>> that incorrect picture
>>
>>
>> On Saturday, December 24, 2022 at 8:51:56 PM UTC+5:30 Manjusha wrote:
>>
>>> actually the code I have written it is for function based view but it
>>> not working that's why I am trying to do with generic editing views sorry
>>> for that
>>>
>>> On Saturday, December 24, 2022 at 8:45:05 PM UTC+5:30 Ryan Nowakowski
>>> wrote:
>>>
 You're using a class-based view here but your code looks like it's
 supposed to be for a function based view. Which style do you want to use?


 On December 24, 2022 8:13:09 AM CST, Manjusha 
 wrote:
>
> Hi, I have created authentication system in Django. Anyone just tell
> me how to allow user to delete the created profile with default id of the
> user.[image: Screenshot 2022-12-24 193133.png]. I I am using
> built-in  User authentication libraries for this purpose and haven't
> created database model for the user. But the function (the commented
> function under delete_account) that I have created it is not deleting the
> user.
> Now I am trying to delete user profile using generic editing views  of
> Django.
> Anyone tell me how to allow user to delete the created profile with
> default id of the user.
>
> --
> 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/45912e33-592c-4ca2-b618-c8fb9a1b6066n%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/CACvpWir3vHN1u%3D2%3DtVJkM7D_eV2St8_xu0M9QzB%2Bq%2BvzfpF2mQ%40mail.gmail.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-24 Thread Manjusha
want to know how to allow user to delete the created profile with default 
id of the user.

On Saturday, December 24, 2022 at 8:52:32 PM UTC+5:30 Manjusha wrote:

> that incorrect picture
>
>
> On Saturday, December 24, 2022 at 8:51:56 PM UTC+5:30 Manjusha wrote:
>
>> actually the code I have written it is for function based view but it not 
>> working that's why I am trying to do with generic editing views sorry for 
>> that 
>>
>> On Saturday, December 24, 2022 at 8:45:05 PM UTC+5:30 Ryan Nowakowski 
>> wrote:
>>
>>> You're using a class-based view here but your code looks like it's 
>>> supposed to be for a function based view. Which style do you want to use?
>>>
>>>
>>> On December 24, 2022 8:13:09 AM CST, Manjusha  
>>> wrote:

 Hi, I have created authentication system in Django. Anyone just tell me 
 how to allow user to delete the created profile with default id of the 
 user.[image: 
 Screenshot 2022-12-24 193133.png]. I I am using built-in  User 
 authentication libraries for this purpose and haven't created database 
 model for the user. But the function (the commented function under 
 delete_account) that I have created it is not deleting the user.
 Now I am trying to delete user profile using generic editing views  of 
 Django.
 Anyone tell me how to allow user to delete the created profile with 
 default id of the user.



-- 
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/45912e33-592c-4ca2-b618-c8fb9a1b6066n%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-24 Thread Manjusha
that incorrect picture


On Saturday, December 24, 2022 at 8:51:56 PM UTC+5:30 Manjusha wrote:

> actually the code I have written it is for function based view but it not 
> working that's why I am trying to do with generic editing views sorry for 
> that 
>
> On Saturday, December 24, 2022 at 8:45:05 PM UTC+5:30 Ryan Nowakowski 
> wrote:
>
>> You're using a class-based view here but your code looks like it's 
>> supposed to be for a function based view. Which style do you want to use?
>>
>>
>> On December 24, 2022 8:13:09 AM CST, Manjusha  
>> wrote:
>>>
>>> Hi, I have created authentication system in Django. Anyone just tell me 
>>> how to allow user to delete the created profile with default id of the 
>>> user.[image: 
>>> Screenshot 2022-12-24 193133.png]. I I am using built-in  User 
>>> authentication libraries for this purpose and haven't created database 
>>> model for the user. But the function (the commented function under 
>>> delete_account) that I have created it is not deleting the user.
>>> Now I am trying to delete user profile using generic editing views  of 
>>> Django.
>>> Anyone tell me how to allow user to delete the created profile with 
>>> default id of the user.
>>>
>>>

-- 
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/a1d277c7-c066-4fbf-a879-cdaf9fb580dbn%40googlegroups.com.


Re: How to allow user to delete their own profile after login with their default id.

2022-12-24 Thread Manjusha
actually the code I have written it is for function based view but it not 
working that's why I am trying to do with generic editing views sorry for 
that 

On Saturday, December 24, 2022 at 8:45:05 PM UTC+5:30 Ryan Nowakowski wrote:

> You're using a class-based view here but your code looks like it's 
> supposed to be for a function based view. Which style do you want to use?
>
>
> On December 24, 2022 8:13:09 AM CST, Manjusha  
> wrote:
>>
>> Hi, I have created authentication system in Django. Anyone just tell me 
>> how to allow user to delete the created profile with default id of the 
>> user.[image: 
>> Screenshot 2022-12-24 193133.png]. I I am using built-in  User 
>> authentication libraries for this purpose and haven't created database 
>> model for the user. But the function (the commented function under 
>> delete_account) that I have created it is not deleting the user.
>> Now I am trying to delete user profile using generic editing views  of 
>> Django.
>> Anyone tell me how to allow user to delete the created profile with 
>> default id of the user.
>>
>>

-- 
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/22f29850-0cae-43d6-aa5d-17d6dde3b289n%40googlegroups.com.


Re: login()/logout() with valid user and request not attaching user to session

2022-10-22 Thread Jordan Edmunds
I figured out the issue. The django_sessions database *does* get updated
with entries when a login is successfully attempted. I'm not entirely sure
why I initially observed that it wasn't. I may have been checking the wrong
database. This is not an issue with django. I have tracked down the
underlying issue to be that the cookies and CSRF tokens were not being
transmitted on request/responses - this was an issue in my frontend. Now
(almost) fixed.

On Sat, Oct 22, 2022 at 11:05 AM Jordan  wrote:

> So I have some rather bizarre behavior on my hands - I am trying to use
> session authentication to login a user. I am able to login/logout through
> the django admin console just fine. However, when I explicitly call
> django.contrib.auth.login(), nothing happens. No errors are thrown, the
> login method executes to completion, but I am not logged in. I can tell
> because (1) When re-loading the user admin console it asks me to
> authenticate and (2) no changes are made to the Session object database. It
> looks exactly the same before the login call as after the login call.
>
> The same is true of logging out - neither method appears to be
> attaching/detaching users to sessions. I have replicated this behavior with
> non-superusers. No errors are ever thrown, but no sessions are ever added
> or deleted. This is utterly bizarre to me - and I don't know what to do.
> Any suggestions for debugging would be immensely helpful - obviously
> authentication is a critical part of our application, and I can't move on
> until I fix this.
>
> I have uploaded my settings.py in a repo below. Some notes on my
> configuration - I am using the email field as my username, and am using
> dj-rest-auth <https://dj-rest-auth.readthedocs.io/en/latest/index.html>
> for authentication. There seems to be nothing wrong with dj-rest-auth: when
> I pass in a valid email/password combination, it successfully calls
> django's authenticate() method, which creates a valid user object, and then
> passes it to django.contrib.auth.login() along with the request. No
> exceptions are thrown inside the login() function - which I verified by
> stepping through it line-by-line with breakpoints. I am using the default
> runserver command as my django server.
>
> Where is the actual code in the login() function that makes changes to the
> database? The only thing I can think of is that somehow the
> user_logged_in.send() signal is responsible, but this doesn't appear to be
> directly attached to any code I can find that could plausibly make database
> modifications.
>
> https://github.com/edmundsj/django_auth_debug
>
> --
> 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/1a73c0d9-da20-4d7e-8d65-50c279ccd5f2n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/1a73c0d9-da20-4d7e-8d65-50c279ccd5f2n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAJkO6Yz%2BhSVo%2B0TH74AW%3DdyQhpPfBsoYW4Gxcv8cKf%3DEZmEqrA%40mail.gmail.com.


login()/logout() with valid user and request not attaching user to session

2022-10-22 Thread Jordan
So I have some rather bizarre behavior on my hands - I am trying to use 
session authentication to login a user. I am able to login/logout through 
the django admin console just fine. However, when I explicitly call 
django.contrib.auth.login(), nothing happens. No errors are thrown, the 
login method executes to completion, but I am not logged in. I can tell 
because (1) When re-loading the user admin console it asks me to 
authenticate and (2) no changes are made to the Session object database. It 
looks exactly the same before the login call as after the login call. 

The same is true of logging out - neither method appears to be 
attaching/detaching users to sessions. I have replicated this behavior with 
non-superusers. No errors are ever thrown, but no sessions are ever added 
or deleted. This is utterly bizarre to me - and I don't know what to do. 
Any suggestions for debugging would be immensely helpful - obviously 
authentication is a critical part of our application, and I can't move on 
until I fix this.

I have uploaded my settings.py in a repo below. Some notes on my 
configuration - I am using the email field as my username, and am using 
dj-rest-auth <https://dj-rest-auth.readthedocs.io/en/latest/index.html> for 
authentication. There seems to be nothing wrong with dj-rest-auth: when I 
pass in a valid email/password combination, it successfully calls django's 
authenticate() method, which creates a valid user object, and then passes 
it to django.contrib.auth.login() along with the request. No exceptions are 
thrown inside the login() function - which I verified by stepping through 
it line-by-line with breakpoints. I am using the default runserver command 
as my django server. 

Where is the actual code in the login() function that makes changes to the 
database? The only thing I can think of is that somehow the 
user_logged_in.send() signal is responsible, but this doesn't appear to be 
directly attached to any code I can find that could plausibly make database 
modifications.

https://github.com/edmundsj/django_auth_debug

-- 
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/1a73c0d9-da20-4d7e-8d65-50c279ccd5f2n%40googlegroups.com.


Re: my admin django not correct: NoReverseMatch à /admin/login/

2022-09-29 Thread Muhammad Juwaini Abdul Rahman
There's no 'index' in your urls.py.

On Tue, 20 Sept 2022 at 21:38, Nicodem Laurore 
wrote:

> Hello guys,
> I no longer have access to my Django admin, this in all my projects, I
> know what I did to get there, but getting out would be fine in order to
> continue my projects, if you know any way to handle this, it would be good
> for me, thank you
>
>
>
> Environment:
>
>
> Request Method: GET
> Request URL: http://localhost:8000/admin/login/?next=/admin/
>
> Django Version: 4.1
> Python Version: 3.8.10
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.messages',
>  'django.contrib.staticfiles']
> Installed Middleware:
> ['django.middleware.security.SecurityMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.common.CommonMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware',
>  'django.middleware.clickjacking.XFrameOptionsMiddleware']
>
>
> Template error:
> In template
> /home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/contrib/admin/templates/admin/base_site.html,
> error at line 6
>Reverse for 'index' not found. 'index' is not a valid view function or
> pattern name.
>1 : {% extends "admin/base.html" %}
>2 :
>3 : {% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{
> title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
>4 :
>5 : {% block branding %}
>6 : {{
> site_header|default:_('Django administration') }}
>7 : {% endblock %}
>8 :
>9 : {% block nav-global %}{% endblock %}
>10 :
>
> Traceback (most recent call last):
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/core/handlers/exception.py",
> line 55, in inner
> response = get_response(request)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/core/handlers/base.py",
> line 220, in _get_response
> response = response.render()
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/response.py",
> line 114, in render
> self.content = self.rendered_content
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/response.py",
> line 92, in rendered_content
> return template.render(context, self._request)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/backends/django.py",
> line 62, in render
> return self.template.render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 175, in render
> return self._render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 167, in _render
> return self.nodelist.render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 1005, in render
> return SafeString("".join([node.render_annotated(context) for node in
> self]))
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 1005, in 
> return SafeString("".join([node.render_annotated(context) for node in
> self]))
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 966, in render_annotated
> return self.render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/loader_tags.py",
> line 157, in render
> return compiled_parent._render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 167, in _render
> return self.nodelist.render(context)
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
> line 1005, in render
> return SafeString("".join([node.render_annotated(context) for node in
> self]))
>   File
> "/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv

Re: Not avle to login with google in my website

2022-09-25 Thread Mohammad Ehsan Ansari
Add into allowed origin

On Fri, 23 Sep, 2022, 7:20 pm Rajesh Kumar,  wrote:

> Hi All,
> I have integrated the social_django package for social logins like google
> and Fb ...etc.
> But It's working in localhost fine but after deployed in AWS ec2 with
> docker It's not working
> Authorization Error coming: redirect_uri https://0.0.0.0:8000/. but
> it should redirect to HTTPS://{my_domain}/
>
> If anybody can help with that It would be very helpful for me.
> Thanks in advance
>
> Rajesh Kumar
>
> --
> 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/CAKNDe%3D%3DQTdff8ZzOiHN6wdqcOH1L%3DXU7iE5%2BQj3Dht4o1gNktA%40mail.gmail.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/CAF8ux6LKQ_XxCZYq58cPRGPwFB89MuhtBr8-_r%3D_-fC-D14bmw%40mail.gmail.com.


Not avle to login with google in my website

2022-09-23 Thread Rajesh Kumar
Hi All,
I have integrated the social_django package for social logins like google
and Fb ...etc.
But It's working in localhost fine but after deployed in AWS ec2 with
docker It's not working
Authorization Error coming: redirect_uri https://0.0.0.0:8000/. but it
should redirect to HTTPS://{my_domain}/

If anybody can help with that It would be very helpful for me.
Thanks in advance

Rajesh Kumar

-- 
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/CAKNDe%3D%3DQTdff8ZzOiHN6wdqcOH1L%3DXU7iE5%2BQj3Dht4o1gNktA%40mail.gmail.com.


my admin django not correct: NoReverseMatch à /admin/login/

2022-09-20 Thread Nicodem Laurore
Hello guys,
I no longer have access to my Django admin, this in all my projects, I know 
what I did to get there, but getting out would be fine in order to continue 
my projects, if you know any way to handle this, it would be good for me, 
thank you



Environment:


Request Method: GET
Request URL: http://localhost:8000/admin/login/?next=/admin/

Django Version: 4.1
Python Version: 3.8.10
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']


Template error:
In template 
/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/contrib/admin/templates/admin/base_site.html,
 
error at line 6
   Reverse for 'index' not found. 'index' is not a valid view function or 
pattern name.
   1 : {% extends "admin/base.html" %}
   2 : 
   3 : {% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{ 
title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
   4 : 
   5 : {% block branding %}
   6 : {{ 
site_header|default:_('Django administration') }}
   7 : {% endblock %}
   8 : 
   9 : {% block nav-global %}{% endblock %}
   10 : 

Traceback (most recent call last):
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/core/handlers/exception.py",
 
line 55, in inner
response = get_response(request)
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/core/handlers/base.py",
 
line 220, in _get_response
response = response.render()
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/response.py",
 
line 114, in render
self.content = self.rendered_content
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/response.py",
 
line 92, in rendered_content
return template.render(context, self._request)
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/backends/django.py",
 
line 62, in render
return self.template.render(context)
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
 
line 175, in render
return self._render(context)
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
 
line 167, in _render
return self.nodelist.render(context)
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
 
line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in 
self]))
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
 
line 1005, in 
return SafeString("".join([node.render_annotated(context) for node in 
self]))
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
 
line 966, in render_annotated
return self.render(context)
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/loader_tags.py",
 
line 157, in render
return compiled_parent._render(context)
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
 
line 167, in _render
return self.nodelist.render(context)
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
 
line 1005, in render
return SafeString("".join([node.render_annotated(context) for node in 
self]))
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
 
line 1005, in 
return SafeString("".join([node.render_annotated(context) for node in 
self]))
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/base.py",
 
line 966, in render_annotated
return self.render(context)
  File 
"/home/nicodem-laurore/PycharmProjects/Djangopro/tpenv/lib/python3.8/site-packages/django/template/loader_tags.py",
 
line 157, in render
return compiled_parent._render(context)
  File 
"/ho

Forbidden error- login to django admin

2022-09-02 Thread Amal Babu
I try to deploy my django project on railway. But i got this error[image: 
Screenshot 2022-09-02 102845.png]

my prod settings -->


import os
from .common import *

DEBUG = False

SECRET_KEY = os.environ.get('SECRET_KEY')

ALLOWED_HOSTS = ['web-production-b9a0.up.railway.app',
 'containers-us-west-62.railway.app']




DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get('PGDATABASE'),
'USER': os.environ.get('PGUSER'),
'PASSWORD': os.environ.get('PGPASSWORD'),
'HOST': os.environ.get('PGHOST'),
'PORT': os.environ.get('PGPORT')
},
}

main settings is



from datetime import timedelta
import os
from datetime import timedelta
from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent.parent



# Application definition

INSTALLED_APPS = [
'jazzmin',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'django_filters',
'djoser',
'rest_framework_simplejwt.token_blacklist',
'corsheaders',
 
]

MIDDLEWARE = [
"corsheaders.middleware.CorsMiddleware",
'django.middleware.security.SecurityMiddleware',
"whitenoise.middleware.WhiteNoiseMiddleware",
'silk.middleware.SilkyMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]


INTERNAL_IPS = [
# ...
'127.0.0.1',
# ...
]

CSRF_TRUSTED_ORIGINS = ['http://*.railway.app',
'https://web-production-b9a0.up.railway.app/']


ROOT_URLCONF = 'storefront.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'storefront.wsgi.application'


# Password validation
# 
https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 
'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True



STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

MEDIA_URL = '/media/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')


DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

REST_FRAMEWORK = {
'COERCE_DECIMAL_TO_STRING': False,
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_simplejwt.authentication.JWTAuthentication',
),
}

-- 
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/33075c91-b177-4568-b326-bc824b339b6en%40googlegroups.com.


enumerate login in django

2022-08-31 Thread Dilja E G
how to create a function to login with user nam e. if user name and 
password is already exist, but want to login with user for super user.

-- 
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/92a4fb37-819b-4478-b501-d66bad01546dn%40googlegroups.com.


Re: Help to implement custome user login

2022-08-09 Thread Samuel Alie Mansaray
How to add apps in django new version?

On Fri, 5 Aug 2022, 20:00 vijay chourey,  wrote:

> Even you can extend your user modle and can store your extra fields and
> OTP verification field. It's posible to change your email to phone based
> login.
>
> On Fri, 5 Aug, 2022, 7:29 pm Rinki Prasad,  wrote:
>
>> Hi team ,
>> Actually i want to implement custom model in Django Like i want that the
>> user should not register.Directly i want that he should login through
>> mobile and otp  instead of username and password, and the same data should
>> be store in database so how can i do this with django?Actually i have tried
>> a lot but still not able to change the fields of username and password of
>> djangol auth_model to mobile
>>
>> --
>> 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/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAD54TfxT8ESwM42%3DvPBFXVuHm7RbxV0fD%3Dpyxrao6TOKXsqGBA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAD54TfxT8ESwM42%3DvPBFXVuHm7RbxV0fD%3Dpyxrao6TOKXsqGBA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAAEwWnzKQLDOiWSZMVov%2BLuSvy_b-S6ykkvxNKJYngbsjC71Cg%40mail.gmail.com.


Re: Help to implement custome user login

2022-08-05 Thread vijay chourey
Even you can extend your user modle and can store your extra fields and OTP
verification field. It's posible to change your email to phone based login.

On Fri, 5 Aug, 2022, 7:29 pm Rinki Prasad,  wrote:

> Hi team ,
> Actually i want to implement custom model in Django Like i want that the
> user should not register.Directly i want that he should login through
> mobile and otp  instead of username and password, and the same data should
> be store in database so how can i do this with django?Actually i have tried
> a lot but still not able to change the fields of username and password of
> djangol auth_model to mobile
>
> --
> 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/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAD54TfxT8ESwM42%3DvPBFXVuHm7RbxV0fD%3Dpyxrao6TOKXsqGBA%40mail.gmail.com.


Re: Help to implement custome user login

2022-08-05 Thread Lakshyaraj Dash
You can have this awesome course by codewithharry:
https://youtube.com/playlist?list=PLu0W_9lII9ah7DDtYtflgwMwpT3xmjXY9

On Fri, 5 Aug, 2022, 22:16 Bhoopesh sisoudiya,  wrote:

> Hey,
>
> No needs to go in any whatsapp group or wasting time because time is very
> important.
> This group have sufficient resources for helping each other.
>
> If you want master in any framework go on original site and read document
> carefully if you don't have basic knowledge then purchase a course from any
> course site.
>
> In previous mail exact solution provided by
> Lakshyaraj as you need.
>
> I have already done this multiple time.
>
> Thanks
> Bhoopesh Sisoudiya
>
>
> On Fri, 5 Aug, 2022, 9:36 pm Lakshyaraj Dash, <
> dashlakshyaraj2...@gmail.com> wrote:
>
>> Hey you... Instead of helping that guy, you're just creating a monopoly.
>> You want that everyone would ask questions in your group, then why this
>> Google groups has been created by django???
>>
>> On Fri, Aug 5, 2022, 21:12 Satyajit Barik 
>> wrote:
>>
>>> Hey,
>>>
>>> Join in Whatsapp python group to solve your problem using the below link:
>>>
>>> https://chat.whatsapp.com/Bq2jcxLJVG50v9Wbkvz6Vy
>>>
>>> [Membership benefits] Here are some great perks you get for becoming a
>>> member:
>>> * Ask your python & django related problems: get quick possible answer.
>>> * Friendly environment: you can learn python & django from core.
>>> * Daily Python Assignment exercise.
>>>
>>> On Fri, Aug 5, 2022 at 7:48 PM Lakshyaraj Dash <
>>> dashlakshyaraj2...@gmail.com> wrote:
>>>
>>>> You can add fields to the default django user model by using the
>>>> AbstractUser class from django.contrib.auth.models, you can't change the
>>>> default fields. Rather you'll need to write your custom user model
>>>> containing OTP and mobile number instead of username or password.
>>>>
>>>> On Fri, Aug 5, 2022, 19:29 Rinki Prasad  wrote:
>>>>
>>>>> Hi team ,
>>>>> Actually i want to implement custom model in Django Like i want that
>>>>> the user should not register.Directly i want that he should login through
>>>>> mobile and otp  instead of username and password, and the same data should
>>>>> be store in database so how can i do this with django?Actually i have 
>>>>> tried
>>>>> a lot but still not able to change the fields of username and password of
>>>>> djangol auth_model to mobile
>>>>>
>>>>> --
>>>>> 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/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> 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/CAF7qQgCHnu1eLdb6fDp2A%2B4OMCb%3DrT78pbM0aeP0V7JYOxR37w%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAF7qQgCHnu1eLdb6fDp2A%2B4OMCb%3DrT78pbM0aeP0V7JYOxR37w%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
>>> 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/CANd-%2BoCRLwa1iRnagBupzx%2BCy5E_xDncc2Df8saryXUu%3DjX6XQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CANd-%2BoCRLwa1iRnagBupzx%2BCy5E_xDncc2Df8saryXUu%3DjX6XQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>

Re: Help to implement custome user login

2022-08-05 Thread Bhoopesh sisoudiya
Hey,

No needs to go in any whatsapp group or wasting time because time is very
important.
This group have sufficient resources for helping each other.

If you want master in any framework go on original site and read document
carefully if you don't have basic knowledge then purchase a course from any
course site.

In previous mail exact solution provided by
Lakshyaraj as you need.

I have already done this multiple time.

Thanks
Bhoopesh Sisoudiya


On Fri, 5 Aug, 2022, 9:36 pm Lakshyaraj Dash, 
wrote:

> Hey you... Instead of helping that guy, you're just creating a monopoly.
> You want that everyone would ask questions in your group, then why this
> Google groups has been created by django???
>
> On Fri, Aug 5, 2022, 21:12 Satyajit Barik 
> wrote:
>
>> Hey,
>>
>> Join in Whatsapp python group to solve your problem using the below link:
>>
>> https://chat.whatsapp.com/Bq2jcxLJVG50v9Wbkvz6Vy
>>
>> [Membership benefits] Here are some great perks you get for becoming a
>> member:
>> * Ask your python & django related problems: get quick possible answer.
>> * Friendly environment: you can learn python & django from core.
>> * Daily Python Assignment exercise.
>>
>> On Fri, Aug 5, 2022 at 7:48 PM Lakshyaraj Dash <
>> dashlakshyaraj2...@gmail.com> wrote:
>>
>>> You can add fields to the default django user model by using the
>>> AbstractUser class from django.contrib.auth.models, you can't change the
>>> default fields. Rather you'll need to write your custom user model
>>> containing OTP and mobile number instead of username or password.
>>>
>>> On Fri, Aug 5, 2022, 19:29 Rinki Prasad  wrote:
>>>
>>>> Hi team ,
>>>> Actually i want to implement custom model in Django Like i want that
>>>> the user should not register.Directly i want that he should login through
>>>> mobile and otp  instead of username and password, and the same data should
>>>> be store in database so how can i do this with django?Actually i have tried
>>>> a lot but still not able to change the fields of username and password of
>>>> djangol auth_model to mobile
>>>>
>>>> --
>>>> 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/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
>>> 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/CAF7qQgCHnu1eLdb6fDp2A%2B4OMCb%3DrT78pbM0aeP0V7JYOxR37w%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAF7qQgCHnu1eLdb6fDp2A%2B4OMCb%3DrT78pbM0aeP0V7JYOxR37w%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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/CANd-%2BoCRLwa1iRnagBupzx%2BCy5E_xDncc2Df8saryXUu%3DjX6XQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CANd-%2BoCRLwa1iRnagBupzx%2BCy5E_xDncc2Df8saryXUu%3DjX6XQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAF7qQgBeVHFXDHK4i5SFAUTd1G55AjnN3bW0EHr5tuCYjTfGsw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF7qQgBeVHFXDHK4i5SFAUTd1G55AjnN3bW0EHr5tuCYjTfGsw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAAk3c1PLSC%3DZw6bWqNS%3D0%2BPLzsHHnFLuBUyMwnn0RGBm6%2BJ6fg%40mail.gmail.com.


Re: Help to implement custome user login

2022-08-05 Thread Lakshyaraj Dash
Hey you... Instead of helping that guy, you're just creating a monopoly.
You want that everyone would ask questions in your group, then why this
Google groups has been created by django???

On Fri, Aug 5, 2022, 21:12 Satyajit Barik 
wrote:

> Hey,
>
> Join in Whatsapp python group to solve your problem using the below link:
>
> https://chat.whatsapp.com/Bq2jcxLJVG50v9Wbkvz6Vy
>
> [Membership benefits] Here are some great perks you get for becoming a
> member:
> * Ask your python & django related problems: get quick possible answer.
> * Friendly environment: you can learn python & django from core.
> * Daily Python Assignment exercise.
>
> On Fri, Aug 5, 2022 at 7:48 PM Lakshyaraj Dash <
> dashlakshyaraj2...@gmail.com> wrote:
>
>> You can add fields to the default django user model by using the
>> AbstractUser class from django.contrib.auth.models, you can't change the
>> default fields. Rather you'll need to write your custom user model
>> containing OTP and mobile number instead of username or password.
>>
>> On Fri, Aug 5, 2022, 19:29 Rinki Prasad  wrote:
>>
>>> Hi team ,
>>> Actually i want to implement custom model in Django Like i want that the
>>> user should not register.Directly i want that he should login through
>>> mobile and otp  instead of username and password, and the same data should
>>> be store in database so how can i do this with django?Actually i have tried
>>> a lot but still not able to change the fields of username and password of
>>> djangol auth_model to mobile
>>>
>>> --
>>> 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/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> 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/CAF7qQgCHnu1eLdb6fDp2A%2B4OMCb%3DrT78pbM0aeP0V7JYOxR37w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAF7qQgCHnu1eLdb6fDp2A%2B4OMCb%3DrT78pbM0aeP0V7JYOxR37w%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CANd-%2BoCRLwa1iRnagBupzx%2BCy5E_xDncc2Df8saryXUu%3DjX6XQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANd-%2BoCRLwa1iRnagBupzx%2BCy5E_xDncc2Df8saryXUu%3DjX6XQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAF7qQgBeVHFXDHK4i5SFAUTd1G55AjnN3bW0EHr5tuCYjTfGsw%40mail.gmail.com.


Re: Help to implement custome user login

2022-08-05 Thread Satyajit Barik
Hey,

Join in Whatsapp python group to solve your problem using the below link:

https://chat.whatsapp.com/Bq2jcxLJVG50v9Wbkvz6Vy

[Membership benefits] Here are some great perks you get for becoming a
member:
* Ask your python & django related problems: get quick possible answer.
* Friendly environment: you can learn python & django from core.
* Daily Python Assignment exercise.

On Fri, Aug 5, 2022 at 7:48 PM Lakshyaraj Dash 
wrote:

> You can add fields to the default django user model by using the
> AbstractUser class from django.contrib.auth.models, you can't change the
> default fields. Rather you'll need to write your custom user model
> containing OTP and mobile number instead of username or password.
>
> On Fri, Aug 5, 2022, 19:29 Rinki Prasad  wrote:
>
>> Hi team ,
>> Actually i want to implement custom model in Django Like i want that the
>> user should not register.Directly i want that he should login through
>> mobile and otp  instead of username and password, and the same data should
>> be store in database so how can i do this with django?Actually i have tried
>> a lot but still not able to change the fields of username and password of
>> djangol auth_model to mobile
>>
>> --
>> 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/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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/CAF7qQgCHnu1eLdb6fDp2A%2B4OMCb%3DrT78pbM0aeP0V7JYOxR37w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAF7qQgCHnu1eLdb6fDp2A%2B4OMCb%3DrT78pbM0aeP0V7JYOxR37w%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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/CANd-%2BoCRLwa1iRnagBupzx%2BCy5E_xDncc2Df8saryXUu%3DjX6XQ%40mail.gmail.com.


Re: Help to implement custome user login

2022-08-05 Thread Lakshyaraj Dash
You can add fields to the default django user model by using the
AbstractUser class from django.contrib.auth.models, you can't change the
default fields. Rather you'll need to write your custom user model
containing OTP and mobile number instead of username or password.

On Fri, Aug 5, 2022, 19:29 Rinki Prasad  wrote:

> Hi team ,
> Actually i want to implement custom model in Django Like i want that the
> user should not register.Directly i want that he should login through
> mobile and otp  instead of username and password, and the same data should
> be store in database so how can i do this with django?Actually i have tried
> a lot but still not able to change the fields of username and password of
> djangol auth_model to mobile
>
> --
> 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/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CAF7qQgCHnu1eLdb6fDp2A%2B4OMCb%3DrT78pbM0aeP0V7JYOxR37w%40mail.gmail.com.


Help to implement custome user login

2022-08-05 Thread Rinki Prasad
Hi team ,
Actually i want to implement custom model in Django Like i want that the 
user should not register.Directly i want that he should login through 
mobile and otp  instead of username and password, and the same data should 
be store in database so how can i do this with django?Actually i have tried 
a lot but still not able to change the fields of username and password of 
djangol auth_model to mobile 

-- 
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/9a853e26-6190-46b8-8c9c-1de2452175d9n%40googlegroups.com.


Re: hr and employee login api in django authendication

2022-06-27 Thread 'Kasper Laudrup' via Django users

On 27/06/2022 11.03, Ganush K wrote:
hr and employee login api in django authendication ..plz help ..hr view 
1.total employee ,salry mangement  then employee view only our 
account..any code or refer any things share me.. ganushgm2...@gmail.com




If you want someone to help you at least spent some time writing a 
question/request people have a chance of understanding.


Right now you just sound like a jerk and I doubt anyone will even 
consider doing anything to help you and that's not only because nobody 
has any idea what you are talking about.


Kind regards,

Kasper Laudrup

--
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/c845995d-ec5a-e367-3828-731f77e7f089%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


hr and employee login api in django authendication

2022-06-27 Thread Ganush K
hr and employee login api in django authendication ..plz help ..hr view 
1.total employee ,salry mangement  then employee view only our account..any 
code or refer any things share me.. ganushgm2...@gmail.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/f5a49691-37b3-4a20-a50a-857c4cbb8bd0n%40googlegroups.com.


Re: CSRF issue in default login

2022-06-17 Thread Mike Kilmer
If you're interested in some piecemeal work, I could use some help. mike at 
mzoo.org.

On Friday, June 17, 2022 at 3:10:16 PM UTC-5 181...@northsouth.edu wrote:

> I have basic to intermediate knowledge on Django, but don't find any entry 
> level job to master my django knowledge in my country, can any one suggest 
> me where I can get some project or industry level job in django , please. I 
> am badly need that
>
> On Friday, June 17, 2022 at 11:29:04 PM UTC+6 Mike Kilmer wrote:
>
>> That sounds hopeful. Where do you put that config? Settings.py?
>>
>> On Friday, June 17, 2022 at 12:25:29 PM UTC-5 vicker...@gmail.com wrote:
>>
>>> I was having a similar issue after setting up https with certbot. After 
>>> searching around, I found adding this to settings worked.
>>>
>>> CSRF_TRUSTED_ORIGINS = ["https://yourdomain.com;, 
>>> "https://www.yourdomain.com;]
>>>
>>> I'd be curious to hear from others, because I'm *not *an expert in how to 
>>> best set up django for production.
>>>
>>>
>>> On Fri, 17 Jun 2022 at 11:48, Mike Kilmer  wrote:
>>>
>>>> Hi.
>>>>
>>>> I'm fairly new to Django. Here's what I need insight on:
>>>>
>>>> Local server, no issue.
>>>>
>>>> On production: CSRF 403 error on login.
>>>>
>>>> There's a cookie loaded on the login page containing csrftoken: 
>>>> pAFeeUI8YFXZ2PKRYxOTX1qz4Xgto42WVNi7FFvBlZDqcFLwQ2rdQvVeZBHFSpLW
>>>>
>>>> (Local and Session storage are empty)
>>>>
>>>> In the FORM element:
>>>>
>>>> >>> value="Vz4FiujD4qkLpxCwWNJU0HCWs4u0Qf4RrMHyJf66rK0cznDbOimeTb7BnIVckANR">
>>>>
>>>> Notice they don't match.
>>>>
>>>> I tried running ./migrate.py clearsessions.
>>>>
>>>> Once, yesterday, it seemed that the error did not occur in an Incognito 
>>>> Window, but today it persists even in an incognito window, as well as a 
>>>> different browser.
>>>>
>>>> One additional piece of information, I have allauth installed, but it 
>>>> doesn't seem to be correctly configured. It's login page is not loading. 
>>>>
>>>> Additionally, the problem was there even when I removed allauth from 
>>>> Apps and Authentication Backends.
>>>>
>>>> Thanks much.
>>>>
>>>> –Mike
>>>>
>>>> -- 
>>>> 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...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/django-users/551AFE93-8B25-4CB9-8D3F-F1BF1EC4F585%40mzoo.org
>>>> .
>>>>
>>>

-- 
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/810b5821-7117-48d5-a71b-3ad09df7a1ean%40googlegroups.com.


Re: CSRF issue in default login

2022-06-17 Thread Abul Kashim 1811949642
I have basic to intermediate knowledge on Django, but don't find any entry 
level job to master my django knowledge in my country, can any one suggest 
me where I can get some project or industry level job in django , please. I 
am badly need that

On Friday, June 17, 2022 at 11:29:04 PM UTC+6 Mike Kilmer wrote:

> That sounds hopeful. Where do you put that config? Settings.py?
>
> On Friday, June 17, 2022 at 12:25:29 PM UTC-5 vicker...@gmail.com wrote:
>
>> I was having a similar issue after setting up https with certbot. After 
>> searching around, I found adding this to settings worked.
>>
>> CSRF_TRUSTED_ORIGINS = ["https://yourdomain.com;, 
>> "https://www.yourdomain.com;]
>>
>> I'd be curious to hear from others, because I'm *not *an expert in how to 
>> best set up django for production.
>>
>>
>> On Fri, 17 Jun 2022 at 11:48, Mike Kilmer  wrote:
>>
>>> Hi.
>>>
>>> I'm fairly new to Django. Here's what I need insight on:
>>>
>>> Local server, no issue.
>>>
>>> On production: CSRF 403 error on login.
>>>
>>> There's a cookie loaded on the login page containing csrftoken: 
>>> pAFeeUI8YFXZ2PKRYxOTX1qz4Xgto42WVNi7FFvBlZDqcFLwQ2rdQvVeZBHFSpLW
>>>
>>> (Local and Session storage are empty)
>>>
>>> In the FORM element:
>>>
>>> >> value="Vz4FiujD4qkLpxCwWNJU0HCWs4u0Qf4RrMHyJf66rK0cznDbOimeTb7BnIVckANR">
>>>
>>> Notice they don't match.
>>>
>>> I tried running ./migrate.py clearsessions.
>>>
>>> Once, yesterday, it seemed that the error did not occur in an Incognito 
>>> Window, but today it persists even in an incognito window, as well as a 
>>> different browser.
>>>
>>> One additional piece of information, I have allauth installed, but it 
>>> doesn't seem to be correctly configured. It's login page is not loading. 
>>>
>>> Additionally, the problem was there even when I removed allauth from 
>>> Apps and Authentication Backends.
>>>
>>> Thanks much.
>>>
>>> –Mike
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/551AFE93-8B25-4CB9-8D3F-F1BF1EC4F585%40mzoo.org
>>> .
>>>
>>

-- 
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/dd868e4f-997d-4e6a-8f1d-744d2c8de649n%40googlegroups.com.


Re: CSRF issue in default login

2022-06-17 Thread Mike Kilmer
That sounds hopeful. Where do you put that config? Settings.py?

On Friday, June 17, 2022 at 12:25:29 PM UTC-5 vicker...@gmail.com wrote:

> I was having a similar issue after setting up https with certbot. After 
> searching around, I found adding this to settings worked.
>
> CSRF_TRUSTED_ORIGINS = ["https://yourdomain.com;, 
> "https://www.yourdomain.com;]
>
> I'd be curious to hear from others, because I'm *not *an expert in how to 
> best set up django for production.
>
>
> On Fri, 17 Jun 2022 at 11:48, Mike Kilmer  wrote:
>
>> Hi.
>>
>> I'm fairly new to Django. Here's what I need insight on:
>>
>> Local server, no issue.
>>
>> On production: CSRF 403 error on login.
>>
>> There's a cookie loaded on the login page containing csrftoken: 
>> pAFeeUI8YFXZ2PKRYxOTX1qz4Xgto42WVNi7FFvBlZDqcFLwQ2rdQvVeZBHFSpLW
>>
>> (Local and Session storage are empty)
>>
>> In the FORM element:
>>
>> > value="Vz4FiujD4qkLpxCwWNJU0HCWs4u0Qf4RrMHyJf66rK0cznDbOimeTb7BnIVckANR">
>>
>> Notice they don't match.
>>
>> I tried running ./migrate.py clearsessions.
>>
>> Once, yesterday, it seemed that the error did not occur in an Incognito 
>> Window, but today it persists even in an incognito window, as well as a 
>> different browser.
>>
>> One additional piece of information, I have allauth installed, but it 
>> doesn't seem to be correctly configured. It's login page is not loading. 
>>
>> Additionally, the problem was there even when I removed allauth from Apps 
>> and Authentication Backends.
>>
>> Thanks much.
>>
>> –Mike
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/551AFE93-8B25-4CB9-8D3F-F1BF1EC4F585%40mzoo.org
>> .
>>
>

-- 
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/d592ab6f-68ee-483e-9ae6-6f4074cdbcefn%40googlegroups.com.


Re: CSRF issue in default login

2022-06-17 Thread mike vickers
I was having a similar issue after setting up https with certbot.
After searching around, I found adding this to settings worked.

CSRF_TRUSTED_ORIGINS = ["https://yourdomain.com;, "https://www.yourdomain.com;]

I'd be curious to hear from others, because I'm *not *an expert in how
to best set up django for production.


On Fri, 17 Jun 2022 at 11:48, Mike Kilmer  wrote:

> Hi.
>
> I'm fairly new to Django. Here's what I need insight on:
>
> Local server, no issue.
>
> On production: CSRF 403 error on login.
>
>     There's a cookie loaded on the login page containing csrftoken:
> pAFeeUI8YFXZ2PKRYxOTX1qz4Xgto42WVNi7FFvBlZDqcFLwQ2rdQvVeZBHFSpLW
>
> (Local and Session storage are empty)
>
> In the FORM element:
>
>  value="Vz4FiujD4qkLpxCwWNJU0HCWs4u0Qf4RrMHyJf66rK0cznDbOimeTb7BnIVckANR">
>
> Notice they don't match.
>
> I tried running ./migrate.py clearsessions.
>
> Once, yesterday, it seemed that the error did not occur in an Incognito
> Window, but today it persists even in an incognito window, as well as a
> different browser.
>
> One additional piece of information, I have allauth installed, but it
> doesn't seem to be correctly configured. It's login page is not loading.
>
> Additionally, the problem was there even when I removed allauth from Apps
> and Authentication Backends.
>
> Thanks much.
>
> –Mike
>
> --
> 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/551AFE93-8B25-4CB9-8D3F-F1BF1EC4F585%40mzoo.org
> .
>

-- 
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/CACaDatQQiGcmw62HNgajxBJsibfu%2BW-0LqdhasckNGsK4iymCA%40mail.gmail.com.


Re: About Specific User Login

2022-06-17 Thread Sebastian Jung
Hello,

Yoz get per query userdata and then wrotes it as further contrext
https://vsupalov.com/pass-context-to-django-cbv/

Then you can render this in your template.



Abhinandan K  schrieb am Fr., 17. Juni 2022,
18:27:

> use django icontains
>
> On Fri, Jun 17, 2022, 9:27 PM Shubham Mendade 
> wrote:
>
>> I want to know that how django  user module helps me to get the data of
>> specific user from lots of user to its dashboard after he/she logins
>>
>> --
>> 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/e714288b-b813-41b7-ab19-0e708154e1f0n%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/CAA6_Mp6Ca%2Be2x%2BTC%3DQyy1gdqa36XBPSiN%2BEgv8SebvrYA9DkTQ%40mail.gmail.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/CAKGT9mxV8P73J6QcttHMwdjJ3%2BPAt_gpB0JT4-b%2BqHvVGNM9AQ%40mail.gmail.com.


Re: About Specific User Login

2022-06-17 Thread Abhinandan K
use django icontains

On Fri, Jun 17, 2022, 9:27 PM Shubham Mendade 
wrote:

> I want to know that how django  user module helps me to get the data of
> specific user from lots of user to its dashboard after he/she logins
>
> --
> 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/e714288b-b813-41b7-ab19-0e708154e1f0n%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/CAA6_Mp6Ca%2Be2x%2BTC%3DQyy1gdqa36XBPSiN%2BEgv8SebvrYA9DkTQ%40mail.gmail.com.


Re: CSRF issue in default login

2022-06-17 Thread rahul sharma
Html form like action form use

On Fri, Jun 17, 2022, 21:23 Mike Kilmer  wrote:

> By the way, using Django 4.0.
>
> Thanks, Rahul.
>
> I believe this is a default Django template, and wouldn't the fact the the
> page/form creates a cookie be a sign that that action triggered by `{%
> crsf_token %}` has taken place?
>
> On Friday, June 17, 2022 at 10:51:24 AM UTC-5 rahul@gmail.com wrote:
>
>>  {% crsf_token %} use this action form down
>>
>>
>> On Fri, Jun 17, 2022, 20:47 Mike Kilmer  wrote:
>>
>>> Hi.
>>>
>>> I'm fairly new to Django. Here's what I need insight on:
>>>
>>> Local server, no issue.
>>>
>>> On production: CSRF 403 error on login.
>>>
>>> There's a cookie loaded on the login page containing csrftoken:
>>> pAFeeUI8YFXZ2PKRYxOTX1qz4Xgto42WVNi7FFvBlZDqcFLwQ2rdQvVeZBHFSpLW
>>>
>>> (Local and Session storage are empty)
>>>
>>> In the FORM element:
>>>
>>> >> value="Vz4FiujD4qkLpxCwWNJU0HCWs4u0Qf4RrMHyJf66rK0cznDbOimeTb7BnIVckANR">
>>>
>>> Notice they don't match.
>>>
>>> I tried running ./migrate.py clearsessions.
>>>
>>> Once, yesterday, it seemed that the error did not occur in an Incognito
>>> Window, but today it persists even in an incognito window, as well as a
>>> different browser.
>>>
>>> One additional piece of information, I have allauth installed, but it
>>> doesn't seem to be correctly configured. It's login page is not loading.
>>>
>>> Additionally, the problem was there even when I removed allauth from
>>> Apps and Authentication Backends.
>>>
>>> Thanks much.
>>>
>>> –Mike
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/551AFE93-8B25-4CB9-8D3F-F1BF1EC4F585%40mzoo.org
>>> .
>>>
>> --
> 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/4522cbf1-cb66-49a2-b033-d438dd5b7200n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/4522cbf1-cb66-49a2-b033-d438dd5b7200n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CACvpWiqRd3aW6oRBRfxVoc3LpKr%3DtuMKhsYT37OPXDFrsL6JPA%40mail.gmail.com.


About Specific User Login

2022-06-17 Thread Shubham Mendade
I want to know that how django  user module helps me to get the data of 
specific user from lots of user to its dashboard after he/she logins 

-- 
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/e714288b-b813-41b7-ab19-0e708154e1f0n%40googlegroups.com.


Re: CSRF issue in default login

2022-06-17 Thread rahul sharma
 {% crsf_token %} use this action form down


On Fri, Jun 17, 2022, 20:47 Mike Kilmer  wrote:

> Hi.
>
> I'm fairly new to Django. Here's what I need insight on:
>
> Local server, no issue.
>
> On production: CSRF 403 error on login.
>
> There's a cookie loaded on the login page containing csrftoken:
> pAFeeUI8YFXZ2PKRYxOTX1qz4Xgto42WVNi7FFvBlZDqcFLwQ2rdQvVeZBHFSpLW
>
> (Local and Session storage are empty)
>
> In the FORM element:
>
>  value="Vz4FiujD4qkLpxCwWNJU0HCWs4u0Qf4RrMHyJf66rK0cznDbOimeTb7BnIVckANR">
>
> Notice they don't match.
>
> I tried running ./migrate.py clearsessions.
>
> Once, yesterday, it seemed that the error did not occur in an Incognito
> Window, but today it persists even in an incognito window, as well as a
> different browser.
>
> One additional piece of information, I have allauth installed, but it
> doesn't seem to be correctly configured. It's login page is not loading.
>
> Additionally, the problem was there even when I removed allauth from Apps
> and Authentication Backends.
>
> Thanks much.
>
> –Mike
>
> --
> 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/551AFE93-8B25-4CB9-8D3F-F1BF1EC4F585%40mzoo.org
> .
>

-- 
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/CACvpWiqBzm7%2BZ6tnN0J5FkdetM%3DaPH6hKRuGV7GNjcYdOR1grg%40mail.gmail.com.


CSRF issue in default login

2022-06-17 Thread Mike Kilmer
Hi.

I'm fairly new to Django. Here's what I need insight on:

Local server, no issue.

On production: CSRF 403 error on login.

There's a cookie loaded on the login page containing csrftoken: 
pAFeeUI8YFXZ2PKRYxOTX1qz4Xgto42WVNi7FFvBlZDqcFLwQ2rdQvVeZBHFSpLW

(Local and Session storage are empty)

In the FORM element:



Notice they don't match.

I tried running ./migrate.py clearsessions.

Once, yesterday, it seemed that the error did not occur in an Incognito Window, 
but today it persists even in an incognito window, as well as a different 
browser.

One additional piece of information, I have allauth installed, but it doesn't 
seem to be correctly configured. It's login page is not loading. 

Additionally, the problem was there even when I removed allauth from Apps and 
Authentication Backends.

Thanks much.

–Mike

-- 
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/551AFE93-8B25-4CB9-8D3F-F1BF1EC4F585%40mzoo.org.


Re: Can't login with Username

2022-06-16 Thread Ryan Nowakowski
You could use manage.py shell to set the email address of your super user.

On June 13, 2022 12:22:30 AM CDT, Sudip Khokhar 
 wrote:
>Hi All,
>
>I am practicing Django since 3 months and recently I encountered an issue 
>with my practice project as I made a super user and didn't added email to 
>it.
>Then after I set email as the USERNAME_FIELD = 'email' in my django model 
>to access the database. But not I don't know how to add email after making 
>migrations to it.
>I had also tried by commenting *USERNAME_FIELD = 'email'* and *REQUIRED_FIELDS 
>= [], *but didn't worked well and I'm unable to login to my django admin 
>database.
>
>-- 
>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/3426cc22-422d-4d2c-b845-bc90243b2e9dn%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/4A42925B-A189-46B6-B385-AC2814448F47%40fattuba.com.


Re: Can't login with Username

2022-06-13 Thread Abdul Qoyyuum
Create another superuser with 

python manage.py createsuperuser --username=joe --email=j...@example.com

And then, login with joe and your new password.

On Monday, June 13, 2022 at 9:39:04 PM UTC+8 sudip.flyon...@gmail.com wrote:

> Hi All,
>
> I am practicing Django since 3 months and recently I encountered an issue 
> with my practice project as I made a super user and didn't added email to 
> it.
> Then after I set email as the USERNAME_FIELD = 'email' in my django model 
> to access the database. But not I don't know how to add email after making 
> migrations to it.
> I had also tried by commenting *USERNAME_FIELD = 'email'* and 
> *REQUIRED_FIELDS 
> = [], *but didn't worked well and I'm unable to login to my django admin 
> database.
>

-- 
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/b8fd6ea3-9dba-4e53-8f1a-08d6ef9c5a9en%40googlegroups.com.


Can't login with Username

2022-06-13 Thread Sudip Khokhar
Hi All,

I am practicing Django since 3 months and recently I encountered an issue 
with my practice project as I made a super user and didn't added email to 
it.
Then after I set email as the USERNAME_FIELD = 'email' in my django model 
to access the database. But not I don't know how to add email after making 
migrations to it.
I had also tried by commenting *USERNAME_FIELD = 'email'* and *REQUIRED_FIELDS 
= [], *but didn't worked well and I'm unable to login to my django admin 
database.

-- 
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/3426cc22-422d-4d2c-b845-bc90243b2e9dn%40googlegroups.com.


Re: Session in Python for Login and Logout

2022-06-07 Thread 'Kasper Laudrup' via Django users

On 07/06/2022 06.59, Mukul Verma wrote:
yeah i was saying in Django Thanks Everyone please tell me something in 
steps for this like how to use session variable in django and can create 
session currently i am able to generate token (access and refresh) and 
further need to create session  with this.




https://docs.djangoproject.com/en/4.0/topics/http/sessions/

Kind regards,

Kasper Laudrup

--
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/5fc1ebc5-d538-2f13-55f0-2cecd9b79ba5%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: Session in Python for Login and Logout

2022-06-07 Thread 'Kasper Laudrup' via Django users

On 07/06/2022 06.59, Mukul Verma wrote:
yeah i was saying in Django Thanks Everyone please tell me something in 
steps for this like how to use session variable in django and can create 
session currently i am able to generate token (access and refresh) and 
further need to create session  with this.




https://docs.djangoproject.com/en/4.0/topics/http/sessions/

Kind regards,

Kasper Laudrup

--
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/0bb76cb7-85e8-129f-2a86-2817506e7c0a%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: Session in Python for Login and Logout

2022-06-06 Thread Muhammad Juwaini Abdul Rahman
I think what he meant is 'session' in django.

Probably can take a look at this:
https://docs.djangoproject.com/en/4.0/ref/request-response/

For example, django app wants to know who is the current user, can use
something like:
`request.user`

On Mon, 6 Jun 2022 at 22:45, 'Kasper Laudrup' via Django users <
django-users@googlegroups.com> wrote:

> On 06/06/2022 11.16, Mukul Verma wrote:
> > Hii,
> >
> > Help me out in this stuff please, some steps for solve this out
> >
>
> Python is a programming language so there's no such thing as a "session
> for login and logout".
>
> If you want someone to help you, you should try to clarify what you
> actually need help with. I assume you mean something with Django
> sessions but it's impossible for me or anyone else to know exactly what
> kind of issue you need to solve.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/ade6fd19-d942-f5e9-dc9e-1f921d94b648%40stacktrace.dk
> .
>

-- 
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/CAFKhtoRrvi6Y%3Dwu9rea42B7D9wSF-dOheiqXiFnUtADx4pBb%3Dg%40mail.gmail.com.


Re: Session in Python for Login and Logout

2022-06-06 Thread 'Kasper Laudrup' via Django users

On 06/06/2022 11.16, Mukul Verma wrote:

Hii,

Help me out in this stuff please, some steps for solve this out



Python is a programming language so there's no such thing as a "session 
for login and logout".


If you want someone to help you, you should try to clarify what you 
actually need help with. I assume you mean something with Django 
sessions but it's impossible for me or anyone else to know exactly what 
kind of issue you need to solve.


Kind regards,

Kasper Laudrup

--
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/ade6fd19-d942-f5e9-dc9e-1f921d94b648%40stacktrace.dk.


OpenPGP_0xE5D9CAC64AAA55EB.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Session in Python for Login and Logout

2022-06-06 Thread Mukul Verma
Hii,

Help me out in this stuff please, some steps for solve this out

-- 
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/0b5522ff-2a71-4a51-b1db-847169d2d104n%40googlegroups.com.


Re: LogIn Class Based View

2022-05-28 Thread waqar khan
I think so problem cleaned data try if this pattern
em= form.cleaned_data['email']
ps= form.cleaned_data['password']
user = authenticate(request,email=em,password=ps)

this is way not solve problem share me error

On Fri, May 27, 2022 at 1:07 AM '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
> <https://groups.google.com/d/msgid/django-users/ea6c54f2-ecc0-407d-a296-e168d509a299n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CA%2B08CAN_YD3OF9PvBowO9cE9i5rzdVJ3fEqPnOuKDWMATLyvXA%40mail.gmail.com.


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

2022-05-28 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



ok i will assume you are running a flavor of unix aka linux, freebsd etc

/admin/login is a mount point but it depends on your hdd layout

for example depending on your hdd initalization


# df
Filesystem   SizeUsed 
Avail Capacity  Mounted on
zroot/ROOT/default   393G3.3G 
389G 1%/
devfs1.0K1.0K 
0B   100%/dev
zroot/var/tmp389G 96K 
389G 0%/var/tmp
zroot/tmp389G136K 
389G 0%/tmp
zroot/var/log389G1.4M 
389G 0%/var/log
zroot389G 96K 
389G 0%/zroot
zroot/var/mail   389G148K 
389G 0%/var/mail
zroot/usr/src391G1.7G 
389G 0%/usr/src
zroot/var/audit  389G 96K 
389G 0%/var/audit
zroot/usr/ports  399G9.4G 
389G 2%/usr/ports
zroot/usr/home   431G 42G 
389G10%/usr/home
zroot/var/crash  389G 96K 
389G 0%/var/crash


when you do s 'df' to list you hdd's it will give you the partition 
layouts and avaliable hdd space


if /admin/login is on it own partition then it probably has reduced size?

check that first

make sure you data base is running where there is plenty of space (ie /usr/)

otherwise post back your hdd layout

and do a

ps -axww

and return the process layouts

between the two you should be able to figure out where your database, 
dhango etc lives and go from there


keep in mind that default locations usually work but sometimes not 
pending how your system was formatted.






Happy Saturday !!!
Thanks - paul

Paul Kudla


Scom.ca Internet Services <http://www.scom.ca>
004-1009 Byron Street South
Whitby, Ontario - Canada
L1N 4S3

Toronto 416.642.7266
Main 1.866.411.7266
Fax 1.888.892.7266
Email p...@scom.ca

On 5/27/2022 5:37 PM, Andrew Rea wrote:

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 
<mailto: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 
<https://groups.google.com/d/msgid/django-users/d96ae214-4c6f-43c7-ae94-7fba910e68a1n%40googlegroups.com?utm_medium=email_source=footer>.


--
This message has been scanned for viruses and
dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
believed to be clean.


--
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/ed6369f9-23f7-d3ce-38e2-4c1437496fd2%40scom.ca.


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.


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: 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=PLEsfXFp6DpzTD1BD1aWNxS2Ep06vIkaeW=36=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
> <https://groups.google.com/d/msgid/django-users/ea6c54f2-ecc0-407d-a296-e168d509a299n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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.


Re: LogIn Class Based View

2022-05-26 Thread Vishesh Mangla
https://ccbv.co.uk/projects/Django/4.0/django.contrib.auth.views/LoginView/
https://openclassrooms.com/en/courses/7107341-intermediate-django/7263527-create-a-login-page-with-class-based-views

https://stackoverflow.com/questions/56761409/how-to-make-a-login-view-for-django-custom-user

On Fri, May 27, 2022 at 1:07 AM '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
> <https://groups.google.com/d/msgid/django-users/ea6c54f2-ecc0-407d-a296-e168d509a299n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CACaE8x6gGXLJ_6kdBAbmjc0xYc%2BnQTgMpgNFn-YqkgmUFGz2PA%40mail.gmail.com.


Re: LogIn Class Based View

2022-05-26 Thread Vishesh Mangla
 Sorry, on looking again I realized that CBV already does this.
https://ccbv.co.uk/projects/Django/4.0/django.contrib.auth.views/LoginView/
https://openclassrooms.com/en/courses/7107341-intermediate-django/7263527-create-a-login-page-with-class-based-views

https://stackoverflow.com/questions/56761409/how-to-make-a-login-view-for-django-custom-user

On Fri, May 27, 2022 at 1:07 AM '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
> <https://groups.google.com/d/msgid/django-users/ea6c54f2-ecc0-407d-a296-e168d509a299n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CACaE8x7xCs634EU-QO%3D%2BhYNsU8z-3s3xyNExufAdkQpscJUgog%40mail.gmail.com.


Re: LogIn Class Based View

2022-05-26 Thread Vishesh Mangla
Sorry, on looking again I realized that CBV already does this.
https://ccbv.co.uk/projects/Django/4.0/django.contrib.auth.views/LoginView/
https://openclassrooms.com/en/courses/7107341-intermediate-django/7263527-create-a-login-page-with-class-based-views

Btw,

On Fri, May 27, 2022 at 2:26 AM Vishesh Mangla 
wrote:

> I think it's good, function based views offer you more flexibility. If you
> are not liking your code it's because your function should be split up into
> smaller functions, or use a class without it being a view.
>
> On Fri, 27 May 2022, 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
>> <https://groups.google.com/d/msgid/django-users/ea6c54f2-ecc0-407d-a296-e168d509a299n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/CACaE8x4RTf0k3DKcKfxhiFcXckGFKp8tifQGVF_FpxXBQcAkdg%40mail.gmail.com.


Re: LogIn Class Based View

2022-05-26 Thread Vishesh Mangla
I think it's good, function based views offer you more flexibility. If you
are not liking your code it's because your function should be split up into
smaller functions, or use a class without it being a view.

On Fri, 27 May 2022, 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
> <https://groups.google.com/d/msgid/django-users/ea6c54f2-ecc0-407d-a296-e168d509a299n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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/CACaE8x5iCrx496xhUCw5wZ3hgXe2cmFRy2k2iPNub%3DxJdC4V5g%40mail.gmail.com.


LogIn Class Based View

2022-05-26 Thread 'dtdave' via Django users
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.


  1   2   3   4   5   6   7   8   9   10   >