The Inspired
Usually vacancies having in their requirements “Django”, also require DRF They go together as a rule That’s why if you specialize on django, you also need to have some skills in drf
wait, what really? Damn. Back when I got a job as a Django Developer, they didn't require me to have any DRF knowledge, and also I had none. I had to learn it on the job... guess things are getting worse now, huh?
The Inspired
welp.
Denis
TBH, I believe building a website from scratch, including SEO and contextual ads, is more important than simply having a website. Good reviews on your page are also important. This is especially true when seeking freelance clients.
I'm not interested in frontend in large doses, but I spend 90% of my time on frontend, otherwise my site will be crooked, although it is already crooked
Pablo
I'm not interested in frontend in large doses, but I spend 90% of my time on frontend, otherwise my site will be crooked, although it is already crooked
A simple way is just search up templates online and make use of them. You can search up free front end templates. For example, if you want to build an e-commerce website, just search up “free e-commerce html and css templates” and you’ll see a good number. So you don’t have to write the front end yourself.
Denis
and again: you can't make a site without frontend, anyway
Yes but it's more complicated than the backend.
Pablo
I'm interested in creating a website myself, but right now I'm having constant difficulties with the frontend.
Well, you kind of have to deal with it and manage if you want to create it all yourself. Perhaps take some time to learn the front end concepts first
Даниил
🐾S
I am trying to write a view that generates 6 digit unique code when a user enters some input or method is POST. How will i go about about it
🐾S
The input form and the unique code are on different tables
🐾S
DRF or just Django?
Won't it be the same?
🐾S
DRF or just Django?
If they are different explain how I will achieve it or if they are materials that will point me to the right direction
Eric
Won't it be the same?
No, in once case you're returning the 6 digit code as probably the value in a key/value pair in a JSON object. And in the other case you might be returning it as a string in a template. My assumption was that everything was built, and you just need a solution to that one thing, but now it sounds like nothing is built.
Eric
The input form and the unique code are on different tables
How is your input form on a table? Do you mean DB table? or something else?
🐾S
The app is pass mgt system that generates a unique code for every guest that comes to the building.
🐾S
How is your input form on a table? Do you mean DB table? or something else?
So when a user(the host) enters the details of the guest, the system generates a unique 6 digit code attach to me guest
Kh_Iran
hi i need manage oracle database with django. how can i do plz?
Charly
hi i need manage oracle database with django. how can i do plz?
How manage? Django is not a database management system
Haleem
My shared hosting having limited access. Which is the best pdf generating library for django. I tried weeasyprint and xhtml2pdf. weeasyprint requires other dependencies which cannot be added in shared hosting and xhtml2pdf cannot use the new css.
Praveen
For that you can do like once you get an input field whatever the user enters store the entered value with 6 digit unique code then validate it with it. Also you can do like django signals to do that.
Charly
Try with reportlab though
Charly
Haleem
Then no option available
There should be some option, there are millions of user in shared hosting. What do they all do ?
Haleem
There is hacks we can work through to use weeasyprint?
Charly
There is hacks we can work through to use weeasyprint?
No, even if there was one your hosting provider would kick you because that would be a security issue
Haleem
No, even if there was one your hosting provider would kick you because that would be a security issue
No, i dont think. If its complies the policy than no issue and they cant kick. There should be a way. Just have to bypass the dependencies. Ill update you.. i am working on it
Charly
Like if a vps would be very expensive
cj
No, i dont think. If its complies the policy than no issue and they cant kick. There should be a way. Just have to bypass the dependencies. Ill update you.. i am working on it
Nothing related to "hack" or "bypass" TOS on providers will "comply" their policies
Haleem
Nothing related to "hack" or "bypass" TOS on providers will "comply" their policies
I am not about the server side. All I am talking about editing the libraries to bypass the dependencies. I am sure someone has done it. And its not a violation
cj
I am not about the server side. All I am talking about editing the libraries to bypass the dependencies. I am sure someone has done it. And its not a violation
I'm sure it's really a violation, you'd better read the TOS of your provider, and by this time, this thread is offtopic now
R
Hello guys, I am setting up celery ,can anyone help me with boilerplate code?
Charly
Hello guys, I am setting up celery ,can anyone help me with boilerplate code?
Have you checked the documentation? It already has an example
Sina
(; •_• )
Hello friends, can you please help me understand what I'm doing wrong? I need to create a team model that will include users. Each user should display which team they belong to. In my current implementation, I encounter an error when trying to create a team if I select specific users. Additionally, for some reason, the user selection field is mandatory. Can you please help me? Thank you very much to everyone! "<Team: First Team>" needs to have a value for field "id" before this many-to-many relationship can be used. Teams class Team(models.Model): name = models.CharField(max_length=100, verbose_name='Team Name') rating = models.IntegerField(default=0, verbose_name='Rating') strength = models.IntegerField(default=0, verbose_name='Strength') members = models.ManyToManyField(User, related_name='teams', verbose_name='Members') def save(self, *args, **kwargs): if self.members.exists(): self.strength = sum(member.userprofile.rating for member in self.members.all()) else: self.strength = 0 super().save(*args, **kwargs) def __str__(self): return self.name class Meta: verbose_name = 'Team' verbose_name_plural = 'Teams' Users class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) avatar = models.ImageField(upload_to='images/users', verbose_name='Image', blank=True) rating = models.IntegerField(default=0, verbose_name='Rating') team = models.ForeignKey(Team, on_delete=models.SET_NULL, null=True, blank=True, verbose_name='Team') def __str__(self): return self.user.username class Meta: verbose_name = 'Profile' verbose_name_plural = 'Profiles'
Nikita Goncharov
Hello friends, can you please help me understand what I'm doing wrong? I need to create a team model that will include users. Each user should display which team they belong to. In my current implementation, I encounter an error when trying to create a team if I select specific users. Additionally, for some reason, the user selection field is mandatory. Can you please help me? Thank you very much to everyone! "<Team: First Team>" needs to have a value for field "id" before this many-to-many relationship can be used. Teams class Team(models.Model): name = models.CharField(max_length=100, verbose_name='Team Name') rating = models.IntegerField(default=0, verbose_name='Rating') strength = models.IntegerField(default=0, verbose_name='Strength') members = models.ManyToManyField(User, related_name='teams', verbose_name='Members') def save(self, *args, **kwargs): if self.members.exists(): self.strength = sum(member.userprofile.rating for member in self.members.all()) else: self.strength = 0 super().save(*args, **kwargs) def __str__(self): return self.name class Meta: verbose_name = 'Team' verbose_name_plural = 'Teams' Users class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) avatar = models.ImageField(upload_to='images/users', verbose_name='Image', blank=True) rating = models.IntegerField(default=0, verbose_name='Rating') team = models.ForeignKey(Team, on_delete=models.SET_NULL, null=True, blank=True, verbose_name='Team') def __str__(self): return self.user.username class Meta: verbose_name = 'Profile' verbose_name_plural = 'Profiles'
You need to save instance of team before using m2m relationship, try to move super().save(*args, **kwargs) to top of your .save() rewritten method. To make field optional in admin panel you can use blank=True
(; •_• )
You need to save instance of team before using m2m relationship, try to move super().save(*args, **kwargs) to top of your .save() rewritten method. To make field optional in admin panel you can use blank=True
Thank you, that helped me create a team. However, something seems to be wrong with the models.ManyToManyField. I don't quite understand how it works. In the admin panel, I simply select several users from the list, but the overall list doesn't change. It seems like all users are always displayed. It looks like the team power is calculated after selecting users, but first, the team is not displayed for the users after this selection, and second, the team name does not appear in the user's team selection field. So, something is not working correctly.
(; •_• )
You need to save instance of team before using m2m relationship, try to move super().save(*args, **kwargs) to top of your .save() rewritten method. To make field optional in admin panel you can use blank=True
I checked the database, and it seems to be correct. I think there might be an issue with the display specifically at the admin panel level.
(; •_• )
read about relationships, especially implementation in django
Thank you, I saw the problem and added auto-update for the team field when changes are made to the teams.
Sirojiddin
Hi all! I created API via DRF. I am using JWT authentication right now. I am considering to use CSRF token to protect against XSRF. Is it right way? Which one is more secure or more convenient?
Kiến
You can update this in file setting.py REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.BasicAuthentication', 'rest_framework.authentication.SessionAuthentication', ] }
.terrri
Any django beginner here
Doragonsureiyā
Any django beginner here
Please don't ask meta questions like: - Any user of $x here? - Anyone used technology $y? - Hello, I need help on $z! Just ask about your problem directly! If you don't know what to ask, please read: http://catb.org/~esr/faqs/smart-questions.html
Ahmad
Hello raise NoReverseMatch(msg) django.urls.exceptions.NoReverseMatch: Reverse for 'account_confirm_email' not found. 'account_confirm_email' is not a valid view function or pattern name. HTTP POST /auth/registration/ 500 [1.09, 127.0.0.1:49791] How I can solve this I am using all auth and dj _rest_auth?
Pablo
Hello raise NoReverseMatch(msg) django.urls.exceptions.NoReverseMatch: Reverse for 'account_confirm_email' not found. 'account_confirm_email' is not a valid view function or pattern name. HTTP POST /auth/registration/ 500 [1.09, 127.0.0.1:49791] How I can solve this I am using all auth and dj _rest_auth?
The error says that no url with a name of 'account_confirm_email' could be found in all url.py files in your project. Perhaps check to make sure you are passing in the correct url name to the reverse function or make sure that you are passing in url parameters if any are needed
Shawna
Hi, any one knows how to make sigin in with apple using dj_rest_auth? I made sign in with google it was easy but apple is a little complicated
Ahmad
share url.py code
from django.urls import path, include from dj_rest_auth.views import PasswordResetView, PasswordResetConfirmView app_name='profiles' urlpatterns = [ path('accounts/', include('allauth.urls')), path('auth/', include('dj_rest_auth.urls')), path('auth/password-reset/', PasswordResetView.as_view(), name='password_reset'), path('auth/password-reset-confirm/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'), path('auth/registration/', include('dj_rest_auth.registration.urls')), ]
❥︎ 𝓔𝓻𝓯𝓪𝓷
Hello, What are the safest authentication methods? Is JWT a good option in Django?
Pablo
Hello, What are the safest authentication methods? Is JWT a good option in Django?
Yes, JWT is a pretty good option and is recommended in Django rest framework docs.
❥︎ 𝓔𝓻𝓯𝓪𝓷
Thank you, friends.❤️
Blablabla
Guys do u know about django ninja
Eric
Guys do u know about django ninja
yeah, it's the second best framework to build REST APIs in Django
Charly
Guys do u know about django ninja
Of course there a people thak know about it, better ask your real question
Eric
Which one is the first 🤔
Did you have an actual question about Django Ninja?
hamid
hi everybody I'm using django-ckeditor-5 My question is how can i change text direction in ckeditor in admin panel?
Ivan
And rtl for right to left
hamid
'textDirection': 'ltr' In ckeditor config
no it's not working i've tried thing and in 5v this would work: 'contentLanguageDirection': 'rtl',
S
Anybody knows pdf editing (private pdf)
S
I meant scanned pdf