Admin
you just need to create them as super user
They all in super user status
Charly
Admin
user is enabled?
Thank you very much, problem is solved.I enabled user and could log in to admin site
OmarHafiz87
@TRAXCUTTER Thanks 👍
❤AGh❤
Hello everyone,when i try to create custom user ,i get an integrity error ,how to fix it?
❤AGh❤
Type error:integrity error Foreignkey constraint failed
Shahram
i have a problem
Shahram
i get this error
Shahram
NoReverseMatch at / Reverse for 'single' with no arguments not found. 1 pattern(s) tried: ['blog/post/(?P<pid>[0-9]+)/\\Z']
arad
Define an app_name for the app in which you defined your url
arad
And then use this code inside the html
Shahram
my urls: path('post/<int:pid>/',single, name="single"), my views :def single(request, pid): date_time = timezone.now() post = get_object_or_404(Post, status=1, id=pid, published_date__lte=date_time) context ={"post":post} return render(request, 'blog/blog_single.html', context) and my html link each post href={% url "blog:single" pid=post.id%}>
Shahram
And then use this code inside the html
my blog has app name but agein i have this error
arad
Do you have another app?
Shahram
Do you have another app?
ja in my app blog
arad
ja in my app blog
Did you define a name for it too?
Doragonsureiyā
ja
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://dpaste.org, https://hastebin.com, https://bin.kv2.dev or your favorite one!
arad
ja
I'm sorry bro, I don't know anymore
arad
ok thank you very much
you're welcome
Shahram
https://dpaste.org/5gxwf
sanchit
Forbidden: /assessor/save-qa/ "GET /assessor/save-qa/ HTTP/1.1" 403 58 can anyone help me to fix this issue .
Priyanka
does any one have django project
Mirco
does any one have django project
internet is full, Github is full
Priyanka
A lot of errors occur if the internet or github is taken
Priyanka
I have created the project and it is getting an error
Priyanka
Value error AES length is incorrect
Maxim
does any one have django project
this is not a project sharing group
Kumar Shreyansh
Value error AES length is incorrect
Can you paste the full traceback using a pasting service?
Ibrohim
I want to register, or expand the standard user model, what is the best way to do so that this project can be immediately inserted into some project?
Mirco
I want to register, or expand the standard user model, what is the best way to do so that this project can be immediately inserted into some project?
Extend user model should be the first thing in a project Otherwise later is more complicated For registration etc etc the best way is to rely on django-allauth
Ibrohim
Extend user model should be the first thing in a project Otherwise later is more complicated For registration etc etc the best way is to rely on django-allauth
look at what I want to do, standard registration or authorization will be through my model, the 3-party side will be through django-allauth, but what I can’t understand is how can I make it so that after registering through Google or something else I can change fields my model
nizzer
I have the table that contain item of the same name with different price but I need to get the average price in my model.... Can anyone help me
Ibrohim
Django Allauth docs is well done
Views Social Connections URL name: socialaccount_connections The allauth.socialaccount.views.ConnectionsView view over at /accounts/social/connections/ (URL name socialaccount_connections) allows users to manage the social accounts tied to their local account.
Mirco
i didn’t find it
https://docs.allauth.org/en/latest/socialaccount/advanced.html
Ibrohim
Customizing providers When an existing provider doesn’t quite meet your needs, you might find yourself needing to customize a provider. This can be achieved by subclassing an existing provider and making your changes there. Providers are defined as django applications, so typically customizing one will mean creating a django application in your project. This application will contain your customized urls.py, views.py and provider.py files. The behaviour that can be customized is beyond the scope of this documentation. Warning In your provider.py file, you will need to expose the provider class by having a module level attribute called provider_classes with your custom classes in a list. This allows your custom provider to be registered properly on the basis of the INSTALLED_APPS setting. Be sure to use a custom id property on your provider class such that its default URLs do not clash with the provider you are subclassing. class GoogleNoDefaultScopeProvider(GoogleProvider): id = 'google_no_scope' def get_default_scope(self): return [] provider_classes = [GoogleNoDefaultScopeProvider] This part, isn't it?
Tim
Hello everyone! Please tell me if it is possible to do this. My script collects data from forms entered by the user, 3 and 4. And in response I need to return 3 + 4 = 7. On a new page of the site. To do this, do you have to write the data to the database or can you process it and return the response right away?
Ibrohim
Nope, the adapter is the class Django Allauth uses to populate and save user model
https://stackoverflow.com/questions/64293242/how-to-link-django-custom-user-model-and-django-allauth-package
Kajal
ValueError: Field 'id' expected a number but got '4/'. [14/Jun/2024 21:07:59] "GET /add-to-cart/?prod_id=4%2F HTTP/1.1" 500 132206 Can anyone help me to fix this issue
Kajal
path('add-to-cart/',v.add_to_cart,name='add-to-cart'),
Anonymous
But how to remove it
You opened url in web browser. Right?
Anonymous
Yes
Please give me that url.
Kajal
<form action="/add-to-cart" class="d-inline">
Anonymous
Please show me form.py content
Anonymous
Then please show me views.py content
Anonymous
which is related to add-to-cart
Kajal
Then please show me views.py content
thank you to hlep me error is solved
Uk
I have idea, We can build our website community
Doragonsureiyā
Rule 5️⃣: Never post walls of text or screen photos. Use paste bins like https://dpaste.org, https://hastebin.com, https://bin.kv2.dev or your favorite one!
Sam
this is my view to filter my courses: class CourseFilterView(APIView, PageNumberPagination): def get(self, request): paid = request.GET.get("paid") sort = request.GET.get("sort") size = request.GET.get("size", 1) self.page_size = int(size) q = request.GET.get("q") courses = Course.objects.all().order_by("-created_at").distinct() # Filtering Starts from here if q: courses = courses.filter(title__icontains=q) if paid: courses = courses.filter(costly=True) if sort = 'new': courses = courses.order_by("-id") paginated_queryset = self.paginate_queryset(courses, request=request) serializer = serializers.CourseSerializer(paginated_queryset, many=True) total_results = courses.count() return Response(serializer.data) and i have another view to clear my filters, except the q, page and sort parameters: class ClearFilterView(APIView): def get(self, request): url_path = request.GET.get("url_path") parsed_url = parse.urlparse(url_path) # query_params is not cleared query_params = parse.parse_qs(parsed_url.query) # we have to keep only the parameters which are needed like page, q and sort cleared_queries = {k: v for k, v in query_params.items() if k in ["page", "q", "sort"]} # After that we must request to the CourseFilterView class to filter the courses again, So # We have to change the cleared_queries which is a dictionary to a query because HTTP GET queries do not # accept dictionary, like: {'page': ['1'], 'q': ['python']} = ?page=1&q=python. # queries is cleared queries = parse.urlencode(cleared_queries, doseq=True) new_url = f"/course/filter-data?{queries}" now my problem is i don`t know how can i pass this get parameters to my CourseFilterView to filter the products again!
Sam
this is my view to filter my courses: class CourseFilterView(APIView, PageNumberPagination): def get(self, request): paid = request.GET.get("paid") sort = request.GET.get("sort") size = request.GET.get("size", 1) self.page_size = int(size) q = request.GET.get("q") courses = Course.objects.all().order_by("-created_at").distinct() # Filtering Starts from here if q: courses = courses.filter(title__icontains=q) if paid: courses = courses.filter(costly=True) if sort = 'new': courses = courses.order_by("-id") paginated_queryset = self.paginate_queryset(courses, request=request) serializer = serializers.CourseSerializer(paginated_queryset, many=True) total_results = courses.count() return Response(serializer.data) and i have another view to clear my filters, except the q, page and sort parameters: class ClearFilterView(APIView): def get(self, request): url_path = request.GET.get("url_path") parsed_url = parse.urlparse(url_path) # query_params is not cleared query_params = parse.parse_qs(parsed_url.query) # we have to keep only the parameters which are needed like page, q and sort cleared_queries = {k: v for k, v in query_params.items() if k in ["page", "q", "sort"]} # After that we must request to the CourseFilterView class to filter the courses again, So # We have to change the cleared_queries which is a dictionary to a query because HTTP GET queries do not # accept dictionary, like: {'page': ['1'], 'q': ['python']} = ?page=1&q=python. # queries is cleared queries = parse.urlencode(cleared_queries, doseq=True) new_url = f"/course/filter-data?{queries}" now my problem is i don`t know how can i pass this get parameters to my CourseFilterView to filter the products again!
I did fix it
Kanji
Hy can I able to add the multipel image in one time if possible send the forms.py file code
Kanji
I want to add the multiple image so I make the two model first for product and second for image
Nicolas
Hi guys, I need help with something stupid. I need to delete from my admin panel in Django, a few options
Nicolas
How can I delete them? (I don’t want to have them in my search toolbar) I don’t know if I explain correctly my issue