Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Eurodns + Django + Dynamic Ip
I bought an domain from Eurodns and wanted connect it with my first website on my computer at home. (I'm a noob - just starting to understand how programming works.) Long story short, when I write my URL it doesn't reach my website, nor if I type www.site.com nor if I type only site.com. (when I type with www. it shows me some kind of default page by eurodns I think. The none www. shows this site can't be reached) What I have tried. I installed a VM ubuntu server on a proxmox with django project and apache2. Then as a first test I used an free domain from noip with their dynamic-Ip tool. It worked just fine without doing any special setup (I might changed a port in apache settings but don't remember for sure). I portforwarded port 80 and 443 from router to my port from the webhost. Then I tried to make the website be rendered by accessing my custom domain bought from Eurodns, via a ddclient/Dynamic DNS offered by Eurodns. For some reason this doesn't work at all. I tried in the meantime to solve the SSL certificate - did this screw things up? Also activated … -
How to access a Django UpdateView with using a uuid as slag
I'm wondering on how I can access a UpdateView by using a uuid as slug. So my goal is an URL like http://myapp.example.de/edit/7efdbb03-bdcf-4b8a-85dd-eb96ac9954fd I have defined the the view like this: class DeviceEventUploadView(UpdateView): model = Event slug_url_kwarg = 'uuid_slug' slug_field = 'unique_id' and urls.py like this: url(r"^edit/<uuid:uuid_slug", DeviceEventUploadView.as_view(), name="event_update" ), Here I'm getting: Using the URLconf defined in myproject.urls, Django tried these URL patterns, in this order: admin/ ^edit/<uuid:uuid_slug [name='event_update'] The current path, 7efdbb03-bdcf-4b8a-85dd-eb96ac9954fd/, didn’t match any of these. Where is my failure in thinking? -
How to sort list in DRF?
I've got two models with onetoone relation user and blog. While listing users I want to have users with blog on top. How to order users so that users with blog is on first of list and secondary order by users id? My Models: class User(BaseModel): name = models.CharField(max_length=100) class Blog(BaseModel): user = models.OneToOneField(Asset, related_name='blog', null=True) title = models.CharField(max_length=100) My view: class UserAPIView(ListAPIView): queryset = User.objects.all() serializer_class = UserSerializer -
Why is celery task not pulling all the records from the database?
I am using celery tasks to pull records from a different database to my local database.Yes when i start celery worker and apply the tasks,the records are pulled and updated into my localdb.The problem is,the task does not pull all the records.I only get 20records while there are more than 1000 records.Who might be knowing the issue? here is my code. @shared_task() def customer_task(): customerdata =Customer.objects.using('my_db').values('customer_no') print(customerdata.count()) for item in customerdata.iterator(): cust_no = item['customer_no'] obj, created = Customer.objects.filter(customerNo=customer_no).update_or_create(customerNo=customer_no) print("customer created or updated in db") -
How can I use custom arguments with Django globally?
I'm trying to use django custom commands(arguments). Also, I want to use it globally to take hyper-parameters of deep-learning model like, toolkits.initialize_GPU(args) So, I've already made custom commands on management/commands from django.core.management.base import BaseCommand, CommandError import argparse class Command(BaseCommand): def add_arguments(self, parser): # set up training configuration. parser.add_argument('--gpu', default='', type=str) ''' something more ''' def handle(self, *args, **options): # I don't know what to do here. print(" ") However, I've got 'manage.py: error: unrecognized arguments: runserver' error. How should I do? -
i want to print "hello!!!!!" from home.html in django but it says TemplateDoesNotExist
i want to print "hello!!!!!" from home.html in django but it says TemplateDoesNotExist. code of all the pages home.html <h1>hello!!!!!!!!!</h1> urls.py from django.urls import path from . import views urlpatterns = [ path('', views.home , name='home') ] views.py from django.http import request from django.shortcuts import render def home(requests): return render(request , 'home.html') setting.py DIRS': [os.path.join(BASE_DIR,'templates')], -
maximum recursion depth exceeded while calling a Python object error for property of a model
There is a problem with my project . I have a total price in my model and its going to sum all the products inside toyr cart and here is the property for model : @property def total(self): total = sum( i.price() for i in self.order_item.all()) if self.discount: discount_price = (self.discount / 100) * total return int(total - discount_price) return self.total self.discount is the discount of the order if it had and self.order_item is the related name for the items inside the order. so the problem is when i try to get the total from this model , it give me an error : maximum recursion depth exceeded while calling a Python object And my code to get the total from the model is : i = order_id amount = get_object_or_404(Order , id = i) Also i get the order_id from the url ! So what os wrong here . Hepl me please . -
Where to write server code for stripe payment?
I am working on React JS to implement stripe payment gateway. I am using Django as a backend Server. In stripe documentation. https://stripe.com/docs/checkout/integration-builder?server=python there is following code given for implementation code for react App.js import React, { useState, useEffect } from "react"; import "./App.css"; const ProductDisplay = () => ( <section> <div className="product"> <img src="https://i.imgur.com/EHyR2nP.png" alt="The cover of Stubborn Attachments" /> <div className="description"> <h3>Stubborn Attachments</h3> <h5>$20.00</h5> </div> </div> <form action="/create-checkout-session" method="POST"> <button type="submit"> Checkout </button> </form> </section> ); const Message = ({ message }) => ( <section> <p>{message}</p> </section> ); export default function App() { const [message, setMessage] = useState(""); useEffect(() => { // Check to see if this is a redirect back from Checkout const query = new URLSearchParams(window.location.search); if (query.get("success")) { setMessage("Order placed! You will receive an email confirmation."); } if (query.get("canceled")) { setMessage( "Order canceled -- continue to shop around and checkout when you're ready." ); } }, []); return message ? ( <Message message={message} /> ) : ( <ProductDisplay /> ); } code for python server.py #! /usr/bin/env python3.6 """ server.py Stripe Sample. Python 3.6 or newer required. """ import os from flask import Flask, redirect, request import stripe # This is your real test secret … -
JavaScript addEventListner Django question
I have a Django website that has a Form made up of multiple fields. Within this form, I am adding two new fields that I like to be able to keep adding values to which get submitted to the database. The primary form is used to populate a city name, address, etc. the new fields are used to populate event names and dates. For example, I add Machester as the city and then I'd like to add as many events to Manchester as I like. At the moment I have a JavaScript addEventListener setup for the submit button of the primary form which will POST all fo the fields i specify, but this refreshes the page everytime i SUBMIT I need to keep the city name field populated so that each event added will contain the city name and the additional event name and event date fields. Ultimately I want a table with City, EventName and EventDate and a table with the city details. So im wondering how i do this with JavaScript to only submit the city, event name and event date? I tried to create a new form within a form and reference that with a different js … -
unexpected password field in django rest framework
I'm creating a registration system with django REST framework so i can use it with React js. Here is my serializer: from rest_framework import serializers from backApp.models import Client class RegistrationSerializer(serializers.ModelSerializer): password2 = serializers.CharField(style={'input_type': 'password'}, write_only=True) class Meta: model = Client fields = ['username', 'email', 'password', 'password2'] extra_kwargs = { 'password': {'write_only': True} } def save(self): client = Client( email = self.validated_data['email'], username = self.validated_data['username'], ) password = self.validated_data['password'] password2 = self.validated_data['password2'] if password != password2: raise serializers.ValidationError({'password': 'Passwords must match'}) client.set_password(password) client.save() return client and here is my views.py file: from rest_framework import status from rest_framework.response import Response from rest_framework.decorators import api_view, permission_classes from rest_framework import permissions from authentication.api.serializers import RegistrationSerializer @api_view(['POST',]) @permission_classes((permissions.AllowAny,)) def registration_view(request): if request.method == "POST": serializer = RegistrationSerializer(data=request.data) data = {} if serializer.is_valid(): client = serializer.save() data['response'] = "successfully registred!" data['email'] = client.email data['username'] = client.username else: data = serializer.errors return Response(data) whenever i make a POST request with POSTMAN (look at the image ) I get the following error: TypeError: Client() got an unexpected keyword argument 'password2' How can i fix this please ? thanks in advance -
Creating two objects inside is_valid not working django
I have this HTML <input type="text" name="maca-fee"> <input type="text" name="maca-name"> <input type="text" name="maca-percentage"> <input type="text" name="maca-fee"> <input type="text" name="maca-name"> <input type="text" name="maca-percentage"> if maca.is_valid(): for i in range(len(list(request.POST.getlist("maca-fee")))): maca_object= maca.save(commit=False) maca_object.name = request.POST.getlist("maca-name")[i] maca_object.fee = request.POST.getlist("maca-fee")[i] maca_object.percentage_coverage = request.POST.getlist("maca-percentage")[i] maca_object.save() return redirect("maca:maca") The range(len(list(request.POST.getlist("maca-fee")))) == (0, 2) I'm trying to create two objects in database within the same form. Can someone help me? -
Form create and update related record
I have just started learning django, so I hope for your help. The second day I struggle with the problem. I want to create a form on the card page for creating and updating records collection. has made it possible to create, but the record cannot be updated in any way. code in model class Card(models.Model): id = models.CharField(max_length=256, primary_key=True) oracle_id = models.CharField(max_length=256) name = models.CharField(max_length=256) class Collection(models.Model): card = models.ForeignKey('Card', on_delete=models.CASCADE) owner = models.ForeignKey(User, verbose_name='User', on_delete=models.CASCADE) count = models.IntegerField() foil = models.BooleanField() class Meta: unique_together = [['card','owner', 'foil']] code in forms class CollectionAddForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) class Meta: model = Collection fields = '__all__' # [ # 'count', # 'foil', # 'card', # 'owner', # ] widgets = {'card': forms.HiddenInput(), 'owner': forms.HiddenInput()} code in views class CardDetailView( FormMixin, DataMixin, generic.DetailView): model = Card template_name = 'catalog/card_detail.html' form_class = CollectionAddForm def get_context_data(self, **kwargs): context = super(CardDetailView, self).get_context_data(**kwargs) # Количество записей в колекции if self.request.user: collectionsFoil = Collection.objects.filter(card=self.object.pk, owner=self.request.user, foil=True) if collectionsFoil: context['collectionsFoil'] = Collection.objects.get(card=self.object.pk, owner=self.request.user, foil=True).id coolectObj = get_object_or_404(Collection, id=context['collectionsFoil']) context['collection_non_foil'] = CollectionAddForm(instance=coolectObj) else: context['collection_non_foil'] = CollectionAddForm(initial={ 'card': self.object.pk, 'owner': self.request.user, 'foil': True }) collectionsNotFoil = Collection.objects.filter(card=self.object.pk, owner=self.request.user, foil=False) if collectionsNotFoil: context['collectionsNotFoil'] = Collection.objects.get(card=self.object.pk, owner=self.request.user, foil=False).id coolectObj … -
image url redirect Django
Is there any way of redirecting an image's URL via views, so that Django isn't having to serve the image directly? The background to my questions has to do with image tracking, which for obvious reasons requires a trip to the Django server. For example, I have a webpage with, say, <img src="https://mydjangoserver.com/image-url/image.jpg"> Which is passed to views at which point the src url is redirected to, say, https://my-nginx-server.com/image.jpg and the image is then loaded within the original html page. I've seen code for forcing a file download using X-Accel-Redirect, but I cannot get it to work. Here is a view that I've been playing around with, but without success: def image_url(request): file_name = 'image.jpg' path_to_file = 'https://my-nginx-server.com/' response = HttpResponse(content_type="image/jpg") response['Content-Disposition'] = f'inline; filename={smart_str(file_name)}' % response['X-Accel-Redirect'] = smart_str(path_to_file) return response Any advice on how to redirect the images url would be very much appreciated. -
My current session_key is getting changed when spotify after authentication redirecting me back to homepage, how to retain same session_key?
I am using Django-rest-framework with React.JS hooks and what I am doing is creating a room with a session_key(suppose 'A') and then room has got created then spotify OAuth page pops up and as soon as i authenticate myself spotify redirects me back to homepage but with different session_key(suppose 'B' which i don't want it to be changed) and room has been created successfully but what i want is that spotify retains that same session_key('A') after redirecting and same room details should be shown after redirecting not the homepage.Please Help me guys. You can check all my files on this github link: enter link description here You can see these images that how session_key is changing given below-: enter image description here enter image description here enter image description here enter image description here enter image description here -
Vue axios not sending headers to server (django simplejwt)
It works well in postman. But I have this error when I do a axios request from Vue. : 'Authentication credentials were not provided.' If I write some custom header in postman, I can see it in request.headers. But there is no header infomation in it if I construct headers in axios. component.vue test_auth: function(){ var accessToken = this.$store.state.accessToken; console.log(accessToken); axios.get('http://django:8000/api/uvs/',{headers:{ 'Authorization':`Bearer ${accessToken}`, }} ) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error.response.data); }); }, and my server settings CORS_ALLOWED_ORIGINS = [ "http://django:8080", "http://django", "http://127.0.0.1", "http://vue:8080", "http://vue", ] CORS_ALLOW_ALL_ORIGINS = True CORS_ALLOW_CREDENTIALS = True REST_FRAMEWORK = { 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' ], 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_simplejwt.authentication.JWTAuthentication', ) } SIMPLE_JWT = { 'AUTH_HEADER_TYPES': ('Bearer',), } and views.py class UserSerializer(serializers.Serializer): class Meta: model = User fields = ('id', 'username', 'email', 'is_staff') class UserViewSet(viewsets.ModelViewSet): serializer_class = UserSerializer queryset = User.objects.all() permission_classes = [IsAuthenticated] -
django :Where can I put server side code django
I could not really explain it in the title of this question . I need to get the profile image of a user in django allauth. In this question : how to display image from google account: django-allauth , a answer was to use user.socialaccount_set.filter(provider='google')[0].extra_data['picture'] in the server side . Where is server side ? -
DataError at /freshleadaction value too long for type character varying(20)
I am working on a django web app. everything is working fine on my local machine and then pushed the code live on Heroku. but it doesn't work on the live server. it gives the following error when I try to post a .csv file: DataError at /freshleadaction value too long for type character varying(20) I have PostgreSQL database integrated. I deleted the migrations and then migrated the whole schema again. I think the problem is either PostgreSQL or heroku? I have two models which are as follows: class fresh_leads_model(models.Model): fname = models.CharField(max_length=250) lname = models.CharField(max_length=250) street_number = models.CharField(max_length=250) street_name = models.CharField(max_length=250) state = models.CharField(max_length=250) zip_code = models.CharField(max_length=250) bedrooms = models.CharField(max_length=250) legal_description = models.CharField(max_length=250) sq_ft = models.CharField(max_length=250) address = models.CharField(max_length=250) orign_ln_amt = models.CharField(max_length=250) prop_value = models.CharField(max_length=250) equity = models.CharField(max_length=250) email = models.CharField(max_length=250) cell = models.CharField(max_length=250) submitted_date = models.DateField(auto_now_add=True) updated_date = models.DateField(auto_now_add=True) deleted_date = models.DateField(auto_now_add=True) class cash_buyer_model(models.Model): fname = models.CharField(max_length=255) lname = models.CharField(max_length=255) email = models.CharField(max_length=255) city = models.CharField(max_length=255) state = models.CharField(max_length=255) submitted_date = models.DateField(auto_now_add=True) updated_date = models.DateField(auto_now_add=True) deleted_date = models.DateField(auto_now_add=True) my views.py function: def upload_fresh_leads(request): get_type = request.GET['type'] lst = [] if request.method == 'POST': leads = Fresh_leads_Form(request.POST, request.FILES) data = request.FILES.getlist('csv') # data = Fresh_leads_Form(request.FILES) # csv_file = request.GET['csv'] … -
Updating fields jQuery + Django
При обработке события JQuery данные не передаются в поле формы. На стороне Django формируется список типа ['RUS', 'USA']. На самой странице после выбора страны поле Activity становится пустым. Как это исправить. Template: {% extends "base.html" %} {% block content %} <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> </head> <body> <section class="site_filter"> <div class="container-fluid"> <div class="row"> <div class="col-sm-2 col-2"> <div class="form-group"> <label for="country">Country</label> <select class="form-control" id="country"> {% for obj in country %} <option value='{{obj}}'>{{obj}}</option> {% endfor %} </select> </div> </div> <div class="col-sm-2 col-2"> <div class="form-group"> <label for="Activity">Activity</label> <select class="form-control" id="activity"> {% for obj in activity %} <option value='{{obj}}'>{{obj}}</option> {% endfor %} </select> </div> </div> </div> </div> </section> <script> /* jshint esversion: 6 */ $('#country').on('change', function(){ $.ajax({ type : "GET", url: "{% url 'info:get_cr_map' %}", data: { "country" : $(this).val(), "csrfmiddlewaretoken": '{{ csrf_token }}', "dataType": "json", }, success: function(response){ let activity_option = ''; $.each(response["activity"], function (a, b) { activity_option += `<option value=${b}>` + b + "</option>"; }); $("#activity").html(activity_option); }, error: function(response){ console.log(response); } }); }); </script> </body> </html> {% endblock %} views.py def cr_map(request): countries = Map.objects.exclude(country__isnull=True).\ exclude(country__exact='').order_by('country').values_list('country').distinct() countries = [i[0] for i in list(countries)] activity = Map.objects.exclude(activity__isnull=True).\ exclude(activity__exact='').order_by('activity').values_list('activity').distinct() activity = [i[0] for i in list(activity)] return render(request, "info/cr_map.html", {"country": countries, 'activity': activity}) … -
Logout redirect url can't find a view
So, here are my files: settings.py LOGOUT_REDIRECT_URL = 'refresh' views.py def about(request): return render(request, 'about.html', {}) def refresh(request): return HttpResponseRedirect(request.META.get("HTTP_REFERER")) The problem: If I set LOGOUT_REDIRECT_URL = 'about', it works fine. Also if I add the code from refresh view to about view, it works fine too. However, when I set LOGOUT_REDIRECT_URL = 'refresh' I'll get the error 'View name was wrong'. I don't understand why I get this error. -
Why does my time countdown return NaN when i format time in django template
I have been working on this app where i have a time countdown to event date, having a challenge working around the time format in django when i format the start datetime in django format{{ event.start|date:'D d M Y' }}" it return NaN in template, but when i format datetime like this "date: 2021-11-11T08:32:06+11:11" it works, I have search on here for a solution, but somehow the solution didn't work in my case. HTML #This works <div class="items-center space-x-2 text-center grid grid-cols-4" uk-countdown="date: 2021-11-11T08:32:06+11:11"> #but this does not work, It returns NaN <div class="items-center space-x-2 text-center grid grid-cols-4" uk-countdown="{{ event.start|date:'D d M Y' }}""> Here is my model for event class Event(models.Model): title = models.CharField(max_length=220) description = models.TextField(_('description'), blank=True) image = models.ImageField(upload_to='events/',blank=True) url = models.URLField(blank=True) country = models.CharField(max_length=200,blank=True) city = models.CharField(max_length=200, blank=True) start = models.DateTimeField(_('start'),db_index=True,default=datetime.now().replace(microsecond=0)) end = models.DateTimeField(_('end'), db_index=True,default=datetime.now().replace(microsecond=0)) creator = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='create') interested = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name='interest') going = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name="going") created_on = models.DateTimeField(auto_now_add=True) updated_on = models.DateTimeField(auto_now=True) service = models.CharField(_("service"), blank=True, max_length=200) My view for event def event_main(request,pk): event = get_object_or_404(Event, pk=pk) posts = Post.objects.filter(event=pk).prefetch_related('event_comment').order_by('-date_posted') related = Event.objects.filter(creator=request.user) liked = [i for i in Post.objects.all() \ if Like.objects.filter(username = request.user, post=i)] friend_list = FriendList.objects.get(user=request.user) friends = friend_list.friends.all() groups = … -
show fixed cell empty table in django template and then populate it with session items cell by cell
as I am trying to get the functionality of clicking an item from product catalogue populate that item at the fixed cells tables say a table of 4 cells - this is to achieve make-your-box kind of functionality with assorted items - the problem is first showing empty table of 4 cells and then populating the cells one by one on the click by a buyer. What I have achieved is to be able to keep clicking the items and they will appear at the top without any table structure. {% for product_id, item in b_data.items %} {% for i in item.numItems %} <div class="col-md-4 mb-4"> <div class="card" style="width: 18rem;"> <img src="/media/{{item.image}}" class="card-img-top" alt="..."> <div class="card-body"> <h5 class="card-title">{{item.title}}</h5> <p class="card-text">{{product_id}} {{item.qty}}</p> <div class="card-footer"> <a href="#" class="btn btn-primary"><i class="bi bi-cart2"></i></a> </div> </div> </div> </div> {% endfor %} {% endfor %} above template works but now if I want that - say i have a box of 4 selected by buyer then - box of 4 will appear empty and then on the click of item fro the product-catalogue appearing below the fixed table of 4 - the session will keep the information of the clicked product and each time the above … -
In Django why the error "TypeError at / string indices must be integers"?
I am trying to learn how to save in Django part of a json content coming from a kraken api. Going through several examples here on stackoverflow i came up with this code: views.py from django.shortcuts import render from meal_app.models import Kraken import requests def get_krakens(request): all_krakens = {} url ='https://api.kraken.com/0/public/Assets' response = requests.get(url) data = response.json() for i in data: kraken_data = Kraken( name = i['altname'] ) kraken_data.save() all_krakens = Kraken.objects.all().order_by('-id') return render (request, 'krakens/kraken.html', { "all_krakens": all_krakens} ) When i try to run it appears: How can i solve this error? My json is visible in my console but i cannot access the value 'altname'. Your help would be really appreciated. /Users/davidmoreira/Documents/crypto/djangokrakenapi/meal_project/meal_app/views.py, line 14, in get_krakens name = i['altname'] -
Recieving SQLDecodeError for djongo migration
I'm trying to use djongo module for mongodb support with django, after I made migration and trying to apply it. But after trying to migrate I'm receiving: djongo.exceptions.SQLDecodeError: Keyword: None Sub SQL: None FAILED SQL: ('SELECT "openwisp_users_organizationuser"."created", "openwisp_users_organizationuser"."modified", "openwi sp_users_organizationuser"."is_admin", "openwisp_users_organizationuser"."id", "openwisp_users_organizationuser"."organization_ id", "openwisp_users_organizationuser"."user_id" FROM "openwisp_users_organizationuser" WHERE ("openwisp_users_organizationuser "."is_admin" AND "openwisp_users_organizationuser"."organization_id" = %(0)s) ORDER BY "openwisp_users_organizationuser"."creat ed" ASC LIMIT 1',) Params: ((UUID('ba052935-7bd6-4262-9860-593d33f1934c'),),) Version: 1.3.6 Also for createsuperuser I recieve: djongo.exceptions.SQLDecodeError: Keyword: None Sub SQL: None FAILED SQL: ('SELECT COUNT(*) AS "__count" FROM "account_emailaddress" WHERE ("account_emailaddress"."primary" AND "acc ount_emailaddress"."user_id" = %(0)s)',) Params: ((UUID('d4d66e84-4a91-49eb-ad86-d35ad8556e41'),),) Version: 1.3.6 Versions used: Django: 3.11.2 Djongo: 1.3.6 sqlparser: 0.2.4 Is there anyway to bypass that and make the migration work? -
Django Template tag in {% if %} block does not show
I'm making a bulletin board with Django. How can I express it with the letters I want instead of the type number? my bulletin board HTML template(board.html) {% for p in postlist %} <tr> <td> {% if p.p_type == '1' %} 'cloud' {% elif p.p_type == '2' %} 'wind' {% endif %} </td> </tr> {% endfor %} output (EMPTY) expected cloud wind Vies.py def board(request, p_type=None): current_type = None p_types = PostType.objects.all() postlist = Post.objects.all() page = request.GET.get('page', '1') if p_type: current_type = get_object_or_404(PostType, p_type=p_type) postlist = postlist.filter(p_type=current_type) paginator = Paginator(postlist, 10) # Showing 20 posts. page_obj = paginator.get_page(page) return render(request, 'board/board.html', {'current_type':current_type, 'p_types': p_types, 'postlist': page_obj}) -
Get list of the functions that used a decorator (in Django)
I have a Django project that I used a decorator for some functions in project (in different apps) Now I want to get list of all functions that used the decorator (I want to get this list when project starts [in app ready()], I want to call those functions. Also I wrote the decorator, I can change it if needed. How can I do it?