Yusuf
Thankd
Yusuf
S*
Anonymous
Hi
Anonymous
how many characters does this regex have
Anonymous
(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$'
Anonymous
if I have this in my tokens.py
Anonymous
str(user.pk) + str(timestamp) +
str(user.is_active)
Yusuf
Can anyone send his work here?
Yusuf
Website which you created
Yusuf
?
Hussein
Work in a special site for schools
Allow each student to choose subjects to excel in. The second student will go out to post a question and specify the topic. While sending a notification to students interested in the topic, so they can come up with a solution
Hussein
notification sistem
Hussein
If it is possible to share a useful link or suggest a solution
Xavier
solves notification system problem
Xavier
Xavier
so only thing left is to start
Hussein
Wouldn't it be annoying to send many e-mails?
Xavier
Hussein
Like the view on social media
Anonymous
How to override default admin template in django??
Anonymous
Anyone can help me out.
Doragonsureiyā
How to override default admin template in django??
Step 1: Open a browser
Step 2: Write down https://google.com or https://duck.com and press Enter
Step 3: In the search box write down the same words you asked here
Step 4: Read the firsts results
Anonymous
I have tried to do that but I am unable to solve my problem
Anonymous
Anonymous
Give it the same details as the one you want to override
ROG 💻
Why could it be the following error in the save function?
ROG 💻
'SignupForm' object has no attribute 'save'
Batman
Hello, I need a lil help I have been trying to create fixtures of a database, and I have a one to one field in one of my models, but the fixture doesn't contain that field under the said model's objects, I've tried to research about this but couldn't find anything, does anyone know how to export one to one field data or is this information represented in some other way. pls help
ROG 💻
The 'SignupForm' class is declared as follows
ROG 💻
class SignupForm(forms.Form)
Anonymous
Hi
class Audit(models.Model):
create_date = models.DateTimeField(auto_now_add=True)
last_modify_date = models.DateTimeField(auto_now=True)
create_by = models.CharField(null=True, max_length=50)
last_modify_by = models.CharField(null=True, max_length=50)
class Meta:
abstract: True
from general.AuditableModel import Audit
class Province(Audit):
name = models.CharField(max_length=30)
class Meta:
db_table = 'province_v2'
verbose_name_plural = _('provinces')
verbose_name = _('province')
class City(Audit):
province = models.ForeignKey(Province, on_delete=models.CASCADE, related_name='cities')
name = models.CharField(max_length=30)
class Meta:
db_table = 'city_v2'
verbose_name_plural = _('cities')
verbose_name = _('city')
Anonymous
Hi I have 30 models and I want all of them inherit from audit
Anonymous
But with independent id, not part of primary key,
Now if I make a province it get id 1 and then insert a city it get id 2, but I want city can have id 1
Anonymous
ROG 💻
Forms.ModelForm
I followed an example and use it like this, is this correct?
ROG 💻
def save(self):
"""Create user and profile."""
data = self.cleaned_data
data.pop('password_confirmation')
user = User.objects.create_user(**data)
profile = Profile(user=user)
profile.save()
ROG 💻
uses it inheriting only the Form class
Yash pal
Hello guys
Can anyone tell me about how to use DO_NOTHING option in on_delete foriegn_key field without violet the rule of foreign key.
Yash pal
In django's model
SNIR
what is the best angluar+ django or react +django ?
SNIR
yea? for mobile and desktip applications ?
SNIR
what make it the best fit ? why not angualr or react ?
Yash pal
I want the foriegn key relation in a model but when i delete the user then its reference do not delete in another model
Anonymous
how can i use sass in my django project?
file extension like .css load perfect but when i use sass src it throws an error "can load ...... from {% load sass_tags %}
i need help
Alberto
Hi, I've already created some celery tasks, is there any possibility to continue the tasks even if the user leave the page?
cj
cj
cj
Alberto
Can I program emails to be sent at a specific time with Django send_email?
cj
Shubham
Hello guys I have created user model and manager
Shubham
https://dpaste.org/jHc3
Shubham
On creating super user it's giving message on admin
Shubham
Please enter the correct email address and password for a staff account. Note that both fields may be case-sensitive.
AM
Can i ues a django app as dashboard??? Thanks in advance
Anonymous
AM
What is the process
AM
How can I restrict them from normal user
AM
I want only admin can open that app not the normal user
Anonymous
AM
Logic thanks a lot
Nonverbis
I can coupe with Django but I can't create a decent html+css. Could you tell me whether there are ready made layouts for a blog sites. I know that there are such layouts for Bootstrap. And googling "bootstrap 4 free themes" really shows some. But I'd rather not use Bootstrap. I want to use grid css. Namely I'd like to find a suit for: home page, a post, a page for tagged posts etc. Full suit for a real blog. Do they exist in nature?
Firdaus
Firdaus
there is also pypi for that https://pypi.org/project/django-bulma/ but it's a bit behind
Code
📱 𝐿𝒶𝓈𝑒𝓇𝑔𝒶𝓂𝑒𝓇
And import views in your appname/urls.py
📱 𝐿𝒶𝓈𝑒𝓇𝑔𝒶𝓂𝑒𝓇
📱 𝐿𝒶𝓈𝑒𝓇𝑔𝒶𝓂𝑒𝓇
And then python manage.py makemigrations
📱 𝐿𝒶𝓈𝑒𝓇𝑔𝒶𝓂𝑒𝓇
python manage.py migrate —run-syncdb
AM
And now i use @superuser_only decorator
AM
@subham yep! And also thanks
Damron
Hi!
I am using DRF + Django filter
# filters.py
from django_filters import rest_framework as filters
from blog.models import Post
class PostFilter(filters.FilterSet):
title = filters.CharFilter(lookup_expr='icontains')
class Meta:
model = Post
fields = ['author']
# views.py
from django_filters import rest_framework as filters
from rest_framework import viewsets
from blog.api.filters import PostFilter
from blog.api.serializers import PostSerializer
from blog.models import Post
class PostViewSet(viewsets.ModelViewSet):
queryset = Post.objects.all()
serializer_class = PostSerializer
filter_backends = (filters.DjangoFilterBackend,)
# filterset_fields = ('author', 'title')
filterset_class = PostFilter
So url like
http://127.0.0.1:8000/api/posts/?title=qw - is working
But I wanna get kwargs from url in backend and put filter-fields in PostSerializer, but using PostFilter - I mean using PostFilter's settings
How should I write the code?
Pandu
Django with redis any ideas about this?