Mr Moha
How do i manage multi branch management system in django ? Do i have to use different domain and hosting or i can use only one ?
Ысаков Марсел
who faced the deployment to the VPS server of the project on django and react? I have problems with pagination, the page returns 404 if I reload the browser. Has anyone worked with nginx.conf?
.
class LoginSerializer(TokenObtainPairSerializer): def validate(self, attrs): data = super().validate(attrs) email = attrs.get('email') password = attrs.pop('password') if not User.objects.filter(email=email).exists(): raise serializers.ValidationError('Not found user, try again') user = authenticate(email=email, password=password) if user and user.is_active: refresh = RefreshToken.for_user(user) data['refresh'] = str(refresh) data['access'] = str(refresh.access_token) else: raise serializers.ValidationError('Activate account') return data Why doesnt work refresh token?
Idi alamin
(web) C:\Users\User\OneDrive\Desktop\Applied Data Science Forward School\Week2\Django\forward>python manage.py makemigrations SystemCheckError: System check identified some issues: ERRORS: book.Book.picture: (fields.E210) Cannot use ImageField because Pillow is not installed. HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
Idi alamin
I received the error that mentioned book.Book.picture: (fields.E210) Cannot use ImageField because Pillow is not installed whenever want to perform makemigrations
Idi alamin
ive already unistall and re install pillow but still not working
Idi alamin
is there anyone got any idea on how can I fix this
0x01
activate virtual env and install
Neeraj
TypeError:Field.init() got an unexpected keyword argument 'attrs'
Doragonsureiyā
How to solve this
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
Mr Moha
which sharedhosting provider is good for django postgresql proj
Raunak
Heroku is paid!
Sopan
Heroku is bad if you are from India. They have payment issues with Indian Credit cards.
cnt
Hi guys, I made a page that only authorized users can access. Everything works as intended, but I have doubts about the correctness of such a decision. can someone correct me? it's my view.py file https://nekobin.com/werepudusa
İremsultan
How can i solve MultiValueDictKeyError in a website i am making that will sell stuff? I can send the error picture if needed
Riad
Is class based view preferred or function based?
Mirco
Is class based view preferred or function based?
No preferences, up to u based on use case
Riad
No preferences, up to u based on use case
I'm perplexed to choose. Can you elaborate when to choose class over function?
Mirco
I'm perplexed to choose. Can you elaborate when to choose class over function?
When you have common stuff that is already covered by Django, use CBVs An example are CreateView or UpdateView etc, basically every CRUD and save tons of code Otherwise you can still stick with function based views If you are starting now learning Django, start with function based
Harshavardhan Reddy
Hello guys, Can anyone tell how to integrate bikes and cars details on Django
Kamal
Hi there, can anybody assist me with how to get the value of the radio button in views.py file thanks in advance
Mirco
Yeah I just started learning Django
So start with function based Class based views later
Bodisof
Hi there, can anybody assist me with how to get the value of the radio button in views.py file thanks in advance
Which name do you give to your radio input field?? The value will be a boolean. True or False.
ask
Is class based view preferred or function based?
Class based views are very powerful but before start using them, oops concepts should be clear to use full potential of class based views.
Smile
Hello! I use unittests. and want to make a configuration file in paycharm. Tests finds but shows such error. I can't figure out what's wrong. How to solve? RuntimeError: Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. and this one at once ImportError: Failed to import test module: projects.tests.test_models
Cheshtaaaaaaa
Harshavardhan Reddy
What ?
I am doing automobile retail website on that how to keep the bikes and cars details on that using Django
oti
I have a django project that I would wish to modify. Can someone help me please? ..
The Inspired
I am doing automobile retail website on that how to keep the bikes and cars details on that using Django
Bikes and Cars are just vehicles... So you can make a single model called 'vehicle'
Harshavardhan Reddy
The Inspired
then make the vehicle model
oti
modify meaning?
Change parts of the codes
The Inspired
okay...?
The Inspired
what do you want to change?
oti
On creating a new user account there is this RegxValidator that I don't understand how to change it to accept my phone number
The Inspired
ok?
The Inspired
and you want to remove the validator?
The Inspired
then go to views.py and remove it?
oti
If I comment it, can it still be same as removing?
The Inspired
yes
The Inspired
restart your server after commenting it out
oti
Ok.
Georg
Is there a way to do something like this Q(Q(...) , Q(...), .... ) but for OrderBy ?
Georg
now I used this: orders = [OrderBy(...) , OrderBy(...)], and then Model.objects.order_by(*orders) ... But something is bothering me...
Shohbek
who has the django4 book
Shohbek
pdf
Doragonsureiyā
who has the django4 book
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Ageev
I'm tasting django views, and check invalid url adress, and self.clent.get print "Not found" in test report. How i can remove this messages from report?
The Inspired
yep
then what's bothering you?
cnt
If you get username and password with request.POST.get() that would be better
thanks, but I think there will be some problems with sessions
Georg
then what's bothering you?
It seems that something is wrong 🤣
The Inspired
Georg
well, what is it?
feeling that I'm doing wrong))
Влад
How to make autocomplete for two fields on one page? How to determine by field where to get data for filling?
Stanislav
verbose_name="Имя" vs verbose_name=_("Name") Should I use native language for verbose name or use i18n? if all users speek only in native language?
verbose_name="Имя" vs verbose_name=_("Name") Should I use native language for verbose name or use i18n? if all users speek only in native language?
In Django and its third party packages for the static strings like verbose_name they use i18n (gettext_lazy) But at last, It totally depend on your project and what you want
but what is a "best practice"?
I don't think we have a best practice for using gettext in our project.
Mr Moha
Who have used htmx