Son
b
I have problem, and it is when I overfill my django project in github and heroku, my database also overfill , what to do for not overfilling database
Anonymous
Hello
Can anyone will explain this code?
from django.shortcuts import render, HttpResponse, HttpResponseRedirect, redirect
from django.contrib import messages
# Create your views here.
from signup.models import signup
def signupview(request):
if request.method == 'GET':
return render(request, 'register.html')
else:
postData = request.POST
fullname = postData.get('fullname')
email = postData.get('email')
pass1 = postData.get('password1')
pass2 = postData.get('password2')
utype = postData.get('select_type')
if fullname == '' or email == '' or pass1 == '' or pass2 == '' or utype == '':
messages.warning(request, 'Please Fill All Inputs ')
return redirect('signup')
elif pass1 == pass2:
if signup.objects.filter(fullname=fullname).exists() and signup.objects.filter(email=email):
messages.info(request, 'Username and Email already taken')
return redirect('signup')
else:
signup.objects.create(fullname=fullname, email=email, password1=pass1, password2=pass2, type=utype)
# register.save()
messages.success(request, 'registration Completed...!')
return redirect('signup')
else:
messages.error(request, 'Pasword Dose not Match...!')
return redirect('signup')
Anonymous
i got an error in Auth token
detail: Authentication credentials were not provided
Mirco
Anonymous
i done it headers content type application json and Authorization :Token${this.state.token}
Mirco
Anonymous
i got an error invalid token header.Token string should not contain spaces
Mirco
Anonymous
dont understand
Mirco
anyway the Authorization you showed me must be wrapped by ' ' , like Content-Type
Anonymous
yes
John
Heyy guys I got my images like in this format when sterilizing it
"picture_name_1": "/media/product_images/2020-08-05_2_SMMFeSM.png"
John
But I want my image field to be like in this format so I can view the images
John
"picture_name_1": "http://127.0.0.1:8000/media/product_images/2020-08-05_2_SMMFeSM.png",
John
I got to know the I issue is with the serilizer
class ProductVarientSerializer(serializers.ModelSerializer):
image = serializers.SerializerMethodField()
orders = serializers.IntegerField(default=22,read_only=True,required=False)
class Meta:
model = Product
fields = ('product_name','orders','views','image')
depth = 1
def get_image(self, obj):
request = self.context.get("request")
image = Variants.objects.filter(product_id=obj.id).first()
serialiser = Serializervariant(image, context={'request': request}).data
return serialiser
John
John
Please help
Anonymous
Anonymous
imagefield
Mirco
yes
in your photo it was not
Mirco
Mirco
Anonymous
ok
Anonymous
We are looking for a DJango Developer on contract basis work for our client for his platform BimaExpress.
If interested, please signup at www.wiraa.com n contact him directly.
.
I have two models , Question and Option , i want to filter the QuerySet to only return Questions with more than two Option . How to filter this?
Anonymous
Mirco
Anonymous
Okayy
Sai
Sai
Sai
.
Sai
Doragonsureiyā
Thanks.
You're welcome! 😊
Артем
def contacts(request):
form1 = Callback()
form2 = Callback_doc()
if form2.is_valid():
function(request, 'Отравлено с вкладки: контакты.')
elif form1.is_valid():
function2(request, 'Отравлено с вкладки: контакты.')
else:
return render(request, 'contacts.html', {'form1': form1, 'form2': form2})
so anytime i see render contacts.html
Why is it so?
Артем
?
Anonymous
import numpy
ModuleNotFoundError: No module named 'numpy'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
! Push rejected, failed to compile Python app.
! Push failed
Anonymous
This error is showing while deploying django on heroku
Anonymous
https://github.com/Taranjeet105/TextAnalyzer
Anonymous
Here is code
Anonymous
Plz help I have one more site to deploy but same errors are showing again and again
Pratik
Plz guide me how can I make multiple and different databases such MySQL ,SQL and Oracle in one django project
Anonymous
https://books.agiliq.com/projects/django-orm-cookbook/en/latest/multiple_databases.html
AB
Hello guys
I’m facing issues in Django
Can anyone help ?
Adrian
What are your issues?
AB
Can we discuss on private chat
AB
I’m not able to text u
Adrian
Is not the idea of the group
AB
I’m trying to deploy Drowsiness detection model in Django... it’s not detecting but it’s working well in Jupyter...
Adrian
Ups, I'm not familiar with Drowsiness, sorry
AB
Can u please check my code if it’s correct
Adrian
Sure, send me the link
AB
Should I share it hear?
Doragonsureiyā
Should I share it hear?
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like:
- https://del.dog
- https://dpaste.org
- https://linkode.org
- https://hastebin.com
- https://bin.kv2.dev
If you posted a wall of text, go back and delete it.
AB
Code
Complex_101
Hey I deployed my django site using heroku. Now when I create a new user in the website it gets added to the admin and then if I update my code on GitHub and re deploy the website that user is deleted. How to solve this issue?
Kamran
Hello guys,
How to login with the email instead of username using AuthenticationForm
Please help me
Droll55
Hi. I need a small help. I m trying to to move context logic in to manager. It is TextChoices. I stuck here is what i'm doing https://dpaste.org/QSo4
Anonymous
Any one send django note please
Anonymous
Hello everyone
We are looking for a DJango Student ambassador If interested, please contact me. www.zujo.co
more info https://link.medium.com/yKH8ZL5K0gb
Jor
Hi, does anyone used django-webpush? It works great for me but it won't redirect to the URI passed in the payload 😩
Gbenga
Please is there a way to use different "CRISPY_TEMPLATE_PACK" for different applications in the same project?
Anonymous
https://instagram.com/oo_coder_girl_?utm_medium=copy_link
@LSR
Hy everyone can anyone help me
One person name "x" created two orders and i wanto show both the orders in that customer "x" profile how can i do that
Luis
Hi guys! I'm creating a testcase to test some functions. I'm extending the testcase class from Django and overwriting the setup method to create some records into my test database. The main issue is a date field with auto_now_add because it's saving the current date and not my mocked date obj instead.
Luis
I'm trying to mock django.utils.timezone.now function with mock.patch but it's not working...
Luis
Any suggestion?
Евгений
How to dynamically change the mail sender in Django? I use send mail. Now the sender is always one - specified in settings in EMAIL_HOST_USER = 'test@gmail.com'
Michael ✨
You need add others configurations
Евгений
Michael ✨
Yes
Michael ✨
give me a moment please