getting error while deploying zappa with aws

2021-12-13 Thread Paras Jain



botocore.exceptions.ClientError: An error occurred (AccessDeniedException) 
when calling the CreateFunction operation: Lambda was unable to encrypt 
your environment variables because the KMS access was denied. Please check 
your KMS permissions. KMS Exception: AccessDeniedException KMS Message: 
User: arn:aws:iam::816087693535:user/p...@123.com is not authorized to 
perform: kms:Encrypt on resource: 
arn:aws:kms:us-east-1:816087693535:key/22a02ce6-2afe-4184-bfbf-18d72d238bdd 
with an explicit deny in a service control policy

Also we tried to read and write kms policies but it did not workout

-- 
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/921724d5-fe41-44d8-9ce8-97f6f5562a01n%40googlegroups.com.


Re: Intern

2019-12-24 Thread Paras Jain
Hi,
i am interested for internship
Thanks paras

On Tue, Dec 24, 2019 at 8:12 PM Dvs Khamele  wrote:

> Hi, all Each year,
> We at Pythonmate provides 3 months - 6-month internships starting January.
> It works as in office as well as remote.
> Reply to me for more details.
> Thanks
>
> On Tue, 24 Dec 2019 at 18:55, Sarvesh singh  wrote:
>
>> Please, suggest me any intern or job opportunity.
>> I completed my b.tech in cse. I have good knowledge of Django.
>>
>> On Tue, Dec 24, 2019, 6:50 PM Arjun Baidya 
>> wrote:
>>
>>> I want to work in office intern.
>>> If possible then send me the e-mail I will send my cv.
>>>
>>>
>>> On Monday, December 23, 2019 at 11:56:31 PM UTC+6, Marcelo Juan Saciloto
>>> wrote:

 Hello how are you doing?

 I have some friends that work on Waves labs. If you want I can share
 your vc with them

 Let me know your thoughts

 Best regards

 On Mon 23. Dec 2019 at 17:53, Arjun Baidya  wrote:

> I have completed Bsc in CSE. I have good knowledge about python
> language and machine learning algorithms.
> Now I need a intern job opportunity which i can grow my skill.
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/aa184428-6999-4ccc-8c4d-ddea909087cf%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/3447a52e-efa1-4418-be62-9cdc77c89e24%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/CAK3CZUY8gnaWXYsFD8my%3D6Vv0LqUXZK53_jB9_wtp%2B5MfvAjrg%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/CAH9mneV9gQesLZ-rpOBk9je2iBjEHWtbyfYyU1X26iUPkYtJHg%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/CAMtmBS-09WT4pFHp-KJNUouiWxMU6%3DvJZin9kuFr2w9O%3DiGZpg%40mail.gmail.com.


[no subject]

2019-11-24 Thread Paras Jain
its showing error like this:
TypeError at /edit_profile/

edit_profile() missing 1 required positional argument: 'pk'

views.py:
def edit_profile(request, pk):
post = get_object_or_404(User, pk=pk)
if request.method == "POST":
form = EditProfileForm(request.POST, instance=post)
if form.is_valid():
post = form.save(commit=False)
post.save()
return redirect('company/detail.html', pk=post.pk)
else:
return render(request,'company/edit_profile.html')


def detail(request,pk):
details = get_object_or_404(User, pk=pk) #it will create object
return render(request, 'company/detail.html',{'details':details})


urls.py:

from django.urls import path
from django.conf.urls import  url
#from .views import HomePageView
from .import views

urlpatterns=[
path('', views.home, name='company-home'),
path('register/', views.register, name='company-register'),
path('detail/', views.detail, name='company-detail'),
path('login/', views.login, name='company-login'),
path('add/', views.add, name='company-add'),
path('edit_profile/', views.edit_profile, name='company-edit'),


]

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


Re: Help

2019-11-24 Thread Paras Jain
remove from .cleaned data part

On Sun, Nov 24, 2019 at 8:03 PM Tosin Ayoola  wrote:

> Halo guyz,  working on a school management system,  and I created a view
> that filter & display the assignment given to a particular class,  but
> instead I'm getting a "assignment_form has no attributes cleaned_data"
> error message what am I doing wrong, can anyone help out below is d view
>
> --
> 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/CAHLKn73k%3DUKJ0prRjpGhnxazUdsJXDAuNdqAJZLgdDsLy43eew%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/CAMtmBS8F59pre87v9OMg6b2RCn3mhL_4SoC17oqRnQwE%3Dx%3DePg%40mail.gmail.com.


Re:

2019-11-23 Thread Paras Jain
bro dont say this i tried to read but i was unable to understand built in
function django and this is part of my project its different

On Sat, Nov 23, 2019 at 10:24 PM Kasper Laudrup 
wrote:

> Hi Raja,
>
> On 23/11/2019 17.26, Raja Sekar Sambath wrote:
> > Hi,
> > request object will have the user information of currently logged-in
> user.
> >
> > try with request.user
> >
>
> Paras is trying to reimplement Djangos authentication system because he
> cannot be bothered to read the documentation, doesn't understand how
> HTTP works and cannot be bothered to learn that either.
>
> Don't waste your time trying to help him.
>
> 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/0e7d21a3-7d29-148e-cb94-4afe3df76327%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/CAMtmBS-CyUT0b5BOetQdcHcMJBjYQASLUvaR8Nd%3DgoBn%3DBpPWQ%40mail.gmail.com.


[no subject]

2019-11-23 Thread Paras Jain
i want my 'user_id' to be passed from detail function to edit profile
function but how?? need help

def detail(request,user_id):
details = get_object_or_404(User, pk=user_id)
return render(request, 'company/detail.html',{'details':details})



def edit_profile(request):
return render(request, 'company/edit_profile.html')

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


[no subject]

2019-11-21 Thread Paras Jain
i am not rendring to detail page
views.py:
def detail(request):
#print('hobbies : ', user.hobbies)
return render(request, 'company/detail.html',{'details':request.user})

def login(request):
if request.method == 'POST':
email  = request.POST['email']
password = request.POST['password']

user = User.objects.get(email=email)   # get will fetch details
from database and it will match value with post

if user.password == password:

if user.type == 'Manager':
return redirect('company-add')

if user.type == 'Normal':
print('hobbies : ', user.hobbies)
return HttpResponseRedirect(reverse('company-detail'),user)
# return redirect('company-detail',user)
# return detail(request,user)
else:
messages.success(request, 'invalids credentials')
return redirect('company-login')

else:
return render(request, 'company/login.html')


urls.py:
from django.urls import path
from django.conf.urls import  url
#from .views import HomePageView
from .import views

urlpatterns=[
path('', views.home, name='company-home'),
path('register/', views.register, name='company-register'),
path('detail/', views.detail, name='company-detail'),
path('login/', views.login, name='company-login'),
path('add/', views.add, name='company-add'),

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


Re:

2019-11-21 Thread Paras Jain
my render is not working on calling the detail function : its not helping
me to reach the /detail url
  views.py:
def detail(request,user):
#print('hobbies : ', user.hobbies)
return render(request, 'company/detail.html',{'details':user})

def login(request):
if request.method == 'POST':
email  = request.POST['email']
password = request.POST['password']

user = User.objects.get(email=email)   # get will fetch details
from database and it will match value with post

if user.password == password:

if user.type == 'Manager':
return redirect('company-add')

if user.type == 'Normal':
print('hobbies : ', user.hobbies)
return detail(request,user)
else:
messages.success(request, 'invalids credentials')
return redirect('company-login')

else:
return render(request, 'company/login.html')

urls.py:
from django.urls import path
from .import views

urlpatterns=[
path('', views.home, name='company-home'),
path('register/', views.register, name='company-register'),
path('detail/', views.detail, name='company-detail'),
path('login/', views.login, name='company-login'),
path('add/', views.add, name='company-add'),


On Thu, Nov 21, 2019 at 2:06 PM Kasper Laudrup 
wrote:

> Hi Paras,
>
> On 21/11/2019 06.03, Paras Jain wrote:
> > i need the code i am not able to understand by reading documenetation
> >
>
> Then I suggest you focus on writing your requirements down and pay
> someone to write the code for you.
>
> If you're not even willing to learn, then software development is
> clearly not for you.
>
> 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/fa5ab206-1087-0344-a163-f3f4441527ea%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/CAMtmBS81awo5ap6dJ5E54PCPGPB9SZirtZH-65iSX__H45VGkA%40mail.gmail.com.


Re:

2019-11-20 Thread Paras Jain
i need the code i am not able to understand by reading documenetation

On Thu, Nov 21, 2019 at 1:34 AM Kasper Laudrup 
wrote:

> Hi Paras,
>
> I hope I'm mistaken but these lines:
>
> On 20/11/2019 18.52, Paras Jain wrote:
> >  user = User.objects.get(email=email)
> >  if user.password == password:
> >
>
> Makes it look like you are storing users passwords in cleartext.
>
> If that is correct, then please don't do that. Never, ever. This is
> hopefully just a hobby project, but still it's good to do things
> correctly and learn good habits from the beginning.
>
> Considering your question, you generally can't as HTTP is basically
> stateless, so the "details" view doesn't know about the user object you
> created in your "login" view.
>
> A workaround for this is using session cookies which isn't exactly
> trivial to handle, so thankfully Django provides a way to make that very
> transparent with Django authentication:
>
> https://docs.djangoproject.com/en/2.2/topics/auth/
>
> If you read up on that documentation you would find the answer to your
> question.
>
> It seems a bit like your trying to reinvent something Django already
> provides for you, I could be wrong of course.
>
> 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/6529ab99-2733-6511-dc86-2e8f69a7cbc0%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/CAMtmBS_kd9TghqeoU99H2fjWh3ta920yzE%2B3aH7AdmODDFpX5A%40mail.gmail.com.


Re:

2019-11-20 Thread Paras Jain
but i have passed two argument in login function its showing error
  if user.type == 'Normal':
print('hobbies : ', user.hobbies)
return detail(request, user)

def detail(request):
print('hobbies : ', user.hobbies)
return render(request, 'company/detail.html',{'details':request.user})

it wont work tell me what should i do to get at render page

On Thu, Nov 21, 2019 at 1:04 AM Jordan Micle 
wrote:

> def detail(request,user):
>> print('hobbies : ', user.hobbies)
>> return render(request, 'company/detail.html',{'details':user})
>>
>
> change detail function like this
> def detail(request):
> print('hobbies : ', user.hobbies)
> return render(request, 'company/detail.html',{'details':request.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/3f6f3d82-63cf-45ff-99da-e008d2cd3841%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/CAMtmBS8oF0CD%3DAqcmw8KwGPoXr5NoNXVsi%2Bg7pyfC-MUW4Tfbw%40mail.gmail.com.


[no subject]

2019-11-20 Thread Paras Jain
my render function its not working in detail function its not rendering to
detail.html.please help any one

views.py:
def detail(request,user):
print('hobbies : ', user.hobbies)
return render(request, 'company/detail.html',{'details':user})

def login(request):
if request.method == 'POST':
email  = request.POST['email']
password = request.POST['password']

user = User.objects.get(email=email)

if user.password == password:

if user.type == 'Manager':
return redirect('company-add')

if user.type == 'Normal':
print('hobbies : ', user.hobbies)
return detail(request, user) #calling the detail
function
else:
messages.success(request, 'invalids credentials')
return redirect('company-login')

else:
return render(request, 'company/login.html')

urls.py
from django.urls import path
from .import views

urlpatterns=[
path('', views.home, name='company-home'),
path('register/', views.register, name='company-register'),
path('detail/', views.detail, name='company-detail'),
path('login/', views.login, name='company-login'),
path('add/', views.add, name='company-add'),

]

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


Re:

2019-11-20 Thread Paras Jain
  'user = User.objects.get(email=email) '  i have to pass this 'user'
instance  from login function to detail function  in django

  views.py:

def login(request):
if request.method == 'POST':
email  = request.POST['email']
password = request.POST['password']

user = User.objects.get(email=email)
if user.password == password:

if user.type == 'Manager':
return redirect('company-add')


if user.type == 'Normal':
details = user# i want this instance
user  to be passed onto detail function


#return
redirect('company-detail',{'details':details})


else:
messages.success(request, 'invalids credentials')
return redirect('company-login')

else:
return render(request, 'company/login.html')

def detail(request):

return render(request, 'company/detail.html')



urls.py:
from django.urls import path
from .import views

urlpatterns=[
path('', views.home, name='company-home'),
path('register/', views.register, name='company-register'),
path('detail/', views.detail, name='company-detail'),
path('login/', views.login, name='company-login'),
path('add/', views.add, name='company-add'),



On Wed, Nov 20, 2019 at 9:07 PM Bob Gailer  wrote:

> On Nov 20, 2019 10:27 AM, "Paras Jain"  wrote:
> >
> > how to take pass one object of one function to other in django
>
> I do not understand your question. Perhaps someone else will understand it
> and give you the answer you're seeking. If you don't get an answer please
> try restating your question or give us an example of what you're trying to
> do.
>
> Bob Gailer
>
> --
> 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/CAP1rxO4fZcKofjNFkF9VNkW%3DMPrRD%3DcBfOz8xKq-z2_HcHqhKA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAP1rxO4fZcKofjNFkF9VNkW%3DMPrRD%3DcBfOz8xKq-z2_HcHqhKA%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/CAMtmBS-oHtP-%3DhV8vh_w6%3Dtbz1gmpH5%2BvYnnzhH8g4ZDJ32jrA%40mail.gmail.com.


[no subject]

2019-11-20 Thread Paras Jain
how to take pass one object of one function to other in django

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


Re: How to change how foreign keys are view in admin site

2019-11-15 Thread Paras Jain
after that model write like this
def __str__(self):
  return self.title

On Fri, Nov 15, 2019 at 6:18 PM Usman Hassan 
wrote:

> I have a problem with my django app, I created a an that has two models
> one which is post and the other is comment, and the comment has a foreign
> key relationship to post. But anytime I view the admin site and I tried to
> relate a comment to a post I made, it won't show me the title of the post
> but instead it will show 'post object (1)'. Pls I there any way I can
> change that???
>
> --
> 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/c92d6f0a-b50f-4d7a-adf8-fd0e3b04a801%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/CAMtmBS9LiH7F9D_T0DRNT8-eNJNzGs6rmfxMJOuyqkoCb%3DsHEw%40mail.gmail.com.


[no subject]

2019-11-15 Thread Paras Jain
 i am not able to send email showing odd type of error need help
views.py:
from django.shortcuts import render, redirect
from django.contrib import messages
from profilestorer.settings import EMAIL_HOST_USER
from django.conf import settings
from .forms import SignUpForm
from django.core.mail import send_mail
from django.utils.crypto import get_random_string
from django.contrib.auth import authenticate,  logout
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, HttpResponse
from .models import User

# Create your views here.
def home(request):
return render(request, 'company/home.html', {'title':'profilestorer'})

@login_required
def user_logout(request):
logout(request)
return HttpResponseRedirect(reverse('login'))


def register(request):
form = SignUpForm()
if request.method == 'POST':
form = SignUpForm(request.POST)

#unique_id = get_random_string(length=8)
subject = 'Welcome to DataFlair'
message = 'Hope you are enjoying your Django Tutorials'
recepient = str(form['Email'].value())
send_mail(subject, message, EMAIL_HOST_USER, [recepient],
fail_silently = False)
return render(request, 'company/success.html',
{'recepient': recepient})
#return redirect('login')

#else:
#form =SignUpForm()
return render(request, 'company/register.html', {'form': form})

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


[no subject]

2019-11-14 Thread Paras Jain
   i m using only email for sign up and sending the random password  on the
mail which will be used for login
Now I want login to be done using register email and password send to mail
I m stuck here that I m generating random password but how I will save as
password and email in my 'views.Py ' file .so that email password can be
used for login
 Please need help

views.py:
from django.shortcuts import render
from profilestorer.settings import EMAIL_HOST_USER
from .forms import SignUp
from django.core.mail import send_mail
from django.utils.crypto import get_random_string
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect, HttpResponse

# Create your views here.
@login_required
def user_logout(request):
logout(request)
return HttpResponseRedirect(reverse('company-login'))


def register(request):
form =SignUpForm()
if request.method == 'POST':
form = SignUpForm(data=request.POST)
unique_id = get_random_string(length=8)
subject = 'Welcome to profile storer'
message = 'Please enter this password for login :   ' +
unique_id
recepient = str(form['Email'].value())
send_mail(subject,
message, EMAIL_HOST_USER, [recepient], fail_silently =
False)
return render(request, 'company/success.html', {'recepient':
recepient})


return render(request, 'company/register.html', {'form':form})

forms.py:

from django import forms
from django.contrib.auth.forms import UserCreationForm
from .models import User


class SignUp(UserCreationForm):
email = forms.EmailField(max_length=200)

class Meta:
model = User
fields =('email')

models.py:

from django.db import models
from django.contrib.auth.models import User

# Create your models here.
class User(models.Model):
email = models.EmailField()
password = models.CharField(max_length=50)

def __str__(self):#will return search
add by the user
return '{}'.format(self.email)

class Meta:
verbose_name_plural = '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/CAMtmBS9Dttmx17L5rhE9qqXS-sOYkdqkvuOUfq5piKoHsVKVqA%40mail.gmail.com.


[no subject]

2019-11-13 Thread Paras Jain
now i want to generate random password and send it to mail instead of
simple message
views.py:

from django.shortcuts import render
from profilestorer.settings import EMAIL_HOST_USER
from . import forms
from django.core.mail import send_mail


# Create your views here.
def login(request):
form = forms.SignInForm()
return render(request, 'company/login.html', {'form':form})


def register(request):
form = forms.SignUpForm()
if request.method == 'POST':
form = forms.SignUpForm(request.POST)
form.save()
subject = 'welcome to profile storer'
message = 'Hope you find the mail'
recepient = str(form['Email'].value())
send_mail(subject,
message, EMAIL_HOST_USER, [recepient], fail_silently =
False)
return render(request, 'company/success.html', {'recepient':
recepient})
return render(request, 'company/register.html', {'form':form})

-- 
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/CAMtmBS-TKN%3D_iOJX%3DV-dUcCWxBj_%3Df3kXf_gQDPYt14TnDmRAQ%40mail.gmail.com.


Re:

2019-11-13 Thread Paras Jain
thanks u so  so so much bro i have done such a silly mistake .Really
appreciated

On Wed, Nov 13, 2019 at 5:11 PM Vivek Jha  wrote:

> Go to admin.py and import the model and then
>
>
> admin.site.register(modelname)
>
> Save and refresh it
>
> On Wed 13 Nov, 2019, 5:08 PM Nitin Kalmaste, 
> wrote:
>
>> if your migrations are successful run queries through manage.py shell
>> There is existing User model inside django.contrb.auth.User
>>
>> On Wed, Nov 13, 2019 at 3:49 PM Paras Jain 
>> wrote:
>>
>>> i have just created a model which will have login information in
>>> database but it is not showing its appearance i have also done migration
>>>
>>> models.py:
>>>
>>> from django.db import models
>>>
>>> # Create your models here.
>>> class User(models.Model):
>>> email = models.EmailField()
>>> password = models.CharField(max_length=50)
>>>
>>> def __str__(self):
>>> return '{}'.format(self.email)
>>>
>>> --
>>> 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/CAMtmBS_GUL4vj5QPRd%2BqFLDkbnjRr_m%3DRbbt4QgG3sW-QbDVyQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAMtmBS_GUL4vj5QPRd%2BqFLDkbnjRr_m%3DRbbt4QgG3sW-QbDVyQ%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/CAKroR%2B139BnAHBORc33TCXDetsp5TvMgq6_Da4w7xCksZBmJRg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAKroR%2B139BnAHBORc33TCXDetsp5TvMgq6_Da4w7xCksZBmJRg%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/CAMriZeFyAPP9vN46e%2BwROv34Pc6d1a5%3DMdi038Ru_aqpLfbfEw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMriZeFyAPP9vN46e%2BwROv34Pc6d1a5%3DMdi038Ru_aqpLfbfEw%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/CAMtmBS9YoVPNVAeK4dWqi7E80qF6M7Ni_TVALXsA5Km5PDgGGA%40mail.gmail.com.


[no subject]

2019-11-13 Thread Paras Jain
i have just created a model which will have login information in database
but it is not showing its appearance i have also done migration

models.py:

from django.db import models

# Create your models here.
class User(models.Model):
email = models.EmailField()
password = models.CharField(max_length=50)

def __str__(self):
return '{}'.format(self.email)

-- 
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/CAMtmBS_GUL4vj5QPRd%2BqFLDkbnjRr_m%3DRbbt4QgG3sW-QbDVyQ%40mail.gmail.com.


[no subject]

2019-11-11 Thread Paras Jain
how send email in django for password reset

-- 
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/CAMtmBS-07d3%3DwFy7C0vQ0ROuCmVzpZhVpSGa%3DuV%2BCBiZTQnoiw%40mail.gmail.com.


Re:

2019-11-08 Thread Paras Jain
no worries but thanks for the solution bro really appreciate it

On Fri, Nov 8, 2019 at 8:14 PM Nijo Joseph  wrote:

> In the add function. Sorry for the breaking emails sending from phone.
>
> On Fri, 8 Nov 2019, 8:11 pm Nijo Joseph,  wrote:
>
>> Or the either way round  instead of form =
>> CompanyForm(request.POST), make it PersonForm(request.POST).
>>
>> On Fri, 8 Nov 2019, 4:26 pm Paras Jain,  wrote:
>>
>>> Hy, i am not getting my all fields on the my page which is written
>>> inside the forms.py of 'PersonForm'
>>>
>>>
>>> models.py:
>>> from django.db import models
>>>
>>> # Create your models here.
>>> TITLE_CHOICES = (
>>> ('Normal', 'Manager'),
>>> )
>>>
>>> class Company(models.Model):
>>> email = models.EmailField()
>>>
>>> def __str__(self):#will return
>>> search add by the user
>>> return '{}'.format(self.email)
>>>
>>>
>>> class Meta:
>>> verbose_name_plural = 'Company'
>>>
>>>
>>>
>>> class Person(models.Model):
>>> name = models.CharField(max_length=255)
>>> email = models.EmailField()
>>> type = models.CharField(max_length=6, choices=TITLE_CHOICES)
>>>
>>> class Meta:
>>> verbose_name_plural = 'Person'
>>>
>>>
>>> forms.py:
>>> from django import forms
>>> from .models import Company,Person
>>>
>>> class CompanyForm(forms.ModelForm):
>>> class Meta:
>>> model = Company
>>> fields = ('email',)
>>>
>>> class PersonForm(forms.ModelForm):
>>> class Meta:
>>> model = Person
>>> fields = ('type', 'name','email',)
>>>
>>> views.py:
>>> from django.shortcuts import render
>>> from .forms import CompanyForm, PersonForm
>>> from django.views.generic  import CreateView
>>>
>>> # Create your views here.
>>> def home(request):
>>>
>>> form = CompanyForm()
>>>
>>> if request.method  == "POST":
>>> form = CompanyForm(request.POST)
>>>
>>> if form.is_valid():
>>> form.save(commit=True)
>>>
>>> else:
>>> print('Error form invalid')
>>>
>>> return render(request, 'home.html', {'form':form})
>>>
>>> def add(request):
>>>
>>> form= PersonForm()
>>> if request.method  == "POST":
>>> form = CompanyForm(request.POST)
>>>
>>> if form.is_valid():
>>> form.save(commit=True)
>>>
>>>
>>>
>>> return render(request, 'add.html', {'form':form})
>>>
>>> --
>>> 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/CAMtmBS-LUNiBy-ey%2BrpvB1%3DRPo6n9x3GwuSnOswObBRt2OZK1g%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAMtmBS-LUNiBy-ey%2BrpvB1%3DRPo6n9x3GwuSnOswObBRt2OZK1g%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/CAFFcXKJvzLA632%2BKp2VvF5TVKJRp1j8iRXoTyjwiWSb8CaeDHw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFFcXKJvzLA632%2BKp2VvF5TVKJRp1j8iRXoTyjwiWSb8CaeDHw%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/CAMtmBS8tRF7rsL6O-Bfz7tof9RZXkPzaVje-H-1er1kxBO6exA%40mail.gmail.com.


[no subject]

2019-11-08 Thread Paras Jain
Hy, i am not getting my all fields on the my page which is written inside
the forms.py of 'PersonForm'


models.py:
from django.db import models

# Create your models here.
TITLE_CHOICES = (
('Normal', 'Manager'),
)

class Company(models.Model):
email = models.EmailField()

def __str__(self):#will return search
add by the user
return '{}'.format(self.email)


class Meta:
verbose_name_plural = 'Company'



class Person(models.Model):
name = models.CharField(max_length=255)
email = models.EmailField()
type = models.CharField(max_length=6, choices=TITLE_CHOICES)

class Meta:
verbose_name_plural = 'Person'


forms.py:
from django import forms
from .models import Company,Person

class CompanyForm(forms.ModelForm):
class Meta:
model = Company
fields = ('email',)

class PersonForm(forms.ModelForm):
class Meta:
model = Person
fields = ('type', 'name','email',)

views.py:
from django.shortcuts import render
from .forms import CompanyForm, PersonForm
from django.views.generic  import CreateView

# Create your views here.
def home(request):

form = CompanyForm()

if request.method  == "POST":
form = CompanyForm(request.POST)

if form.is_valid():
form.save(commit=True)

else:
print('Error form invalid')

return render(request, 'home.html', {'form':form})

def add(request):

form= PersonForm()
if request.method  == "POST":
form = CompanyForm(request.POST)

if form.is_valid():
form.save(commit=True)



return render(request, 'add.html', {'form':form})

-- 
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/CAMtmBS-LUNiBy-ey%2BrpvB1%3DRPo6n9x3GwuSnOswObBRt2OZK1g%40mail.gmail.com.


Re:

2019-11-07 Thread Paras Jain
i registered also not getting it

On Thu, Nov 7, 2019 at 8:29 PM himanshu chouhan 
wrote:

> you need to register ur model as well.
>
> On Thu, 7 Nov, 2019, 8:27 PM Paras Jain,  wrote:
>
>> this is my models.py file i created and migrated but model in not created
>> in my admin page as database please somebody help
>>
>> from django.db import models
>>
>> # Create your models here.
>> class Company(models.Model):
>> email = models.EmailField()
>>
>>
>> def __init__():
>> return self.email
>>
>> --
>> 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/CAMtmBS-msPj-1TNBx%3DP6YOZTZmaEhFp22%3DGa%3DHGC160w77fyEQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAMtmBS-msPj-1TNBx%3DP6YOZTZmaEhFp22%3DGa%3DHGC160w77fyEQ%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/CAFCu%3DVSsN1gm0Ymgo30iF3j_AOrJWjmt%2BfFWy0w_3o_mr41DvA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFCu%3DVSsN1gm0Ymgo30iF3j_AOrJWjmt%2BfFWy0w_3o_mr41DvA%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/CAMtmBS_ZOwwe6dbwo2D43Ldj1xvaUzGiYP_YRdhJYfT8pEKBMQ%40mail.gmail.com.


[no subject]

2019-11-07 Thread Paras Jain
this is my models.py file i created and migrated but model in not created
in my admin page as database please somebody help

from django.db import models

# Create your models here.
class Company(models.Model):
email = models.EmailField()


def __init__():
return self.email

-- 
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/CAMtmBS-msPj-1TNBx%3DP6YOZTZmaEhFp22%3DGa%3DHGC160w77fyEQ%40mail.gmail.com.


Re:

2019-11-05 Thread Paras Jain
bro i was asking the code how to use it to send , email and password  to
particular email

On Tue, Nov 5, 2019 at 6:30 PM Suraj Thapa FC 
wrote:

> Send it then
>
> On Tue, 5 Nov 2019, 5:38 pm Paras Jain,  wrote:
>
>> on hitting submit i have to send email and password to user email id
>> which will be used for login in django
>>
>> --
>> 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/CAMtmBS8KETpX74D8nRpPiDdnb_GYSeHYGgc3c_6TVgA15dKa4g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAMtmBS8KETpX74D8nRpPiDdnb_GYSeHYGgc3c_6TVgA15dKa4g%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/CAPjsHcFZSKeebvqZe7_Eyiz5gJF6dmBv9o-S6ef5rqLVj5SSjw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPjsHcFZSKeebvqZe7_Eyiz5gJF6dmBv9o-S6ef5rqLVj5SSjw%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/CAMtmBS8_j%2BONi43MO1%3DJEjbqktOaedYfV7ZDHtHNLRgvn7Gb7w%40mail.gmail.com.


[no subject]

2019-11-05 Thread Paras Jain
on hitting submit i have to send email and password to user email id which
will be used for login in django

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


[no subject]

2019-11-04 Thread Paras Jain
please somebody tell me what steps should i follow please need help


Create a Django Web App called “Profile Storer” where a company can sign up
using Email.

Once signed up, he can add more people to his team. Every team member can
be either “Normal” type or “Manager” type. When you add a team member, that
particular person gets an email with password, which he/she can use to
login.

When a Manager type user logs in, he sees a list of all users of that
company, he can go and edit any of the profile.

When a Normal user logs in, he sees only his own profile that he can edit.


Questions in Profile:

Name, Phone, Gender, Hobbies, Profile Picture.

-- 
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/CAMtmBS-mWtcx1Z0QFdvDc9F-ApoqHdP_9CkpaQzZUULow%3DHrFg%40mail.gmail.com.


Re: Djangorest framework tutorial

2019-11-04 Thread Paras Jain
 Hi,
just follow this video u will easily know how to make api very easily
link - https://www.youtube.com/watch?v=263xt_4mBNc
Thnks

On Mon, Nov 4, 2019 at 6:17 PM Laura Pérez  wrote:

> Hi!
> I have the task to develop a rest api in python, Can anybody advice me on
> a nice tutorial to use djangorest framework ?
>
> Best!
>
>
> --
> 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/CAF_dEnq90i0zxOgwGANXaFk_eEWJn4N6d544U1r-qwPS1M92jg%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/CAMtmBS_11roQXUzFHb%3Dvus1MnaqqjQV8CmZS5jLrXZDZKvnNAw%40mail.gmail.com.


Re:

2019-11-01 Thread Paras Jain
 Hi, i am given this task can somebody tell what i have to do in this

The Task:

Create a basic rest API that can perform CRUD operations on Users and their
Blog with the following features/constraints.

❏ Use persistent model on database of your choice

❏ Only the creator of the blog should be able to modify it.

❏ Read access should be available to everyone.

❏ Anymore ACLs you might think should be present in it.

❏ Do not hesitate on improvising.

We are not looking for perfection but your willingness and approach to
tackle a problem.

On Fri, Nov 1, 2019 at 7:12 PM Mohammad yunus  wrote:

> Can anyone tell me about how to set mysql database connection,and also
> tell me requirements for this steps,.
> Can someone tell me which database is good for Django framework .I know
> about default database sqlite (is it good for it)
>
> --
> 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/CAEQiGcN2%2BNUnpt5BzBvn5x%2BS%3DcGpKRkOs1jXNM%3DOqeLFxCqWog%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/CAMtmBS-peppqpdAZjH%3D4%2BfaQrdNgJ%3DfSf%2B9yq6%2B_5Q%3DWVh9_9A%40mail.gmail.com.