Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django displayig logged in user's info doesn't work
I'm using django-registration auth_login to logs in on my website. When user login, he redirects to custom profile page. On this custom profile page I need to display his username,last_name and etc. The question is that, {{user.username}}, {{user.get_username}}, {{request.get_username}}, {{request.user}}, {{request.user.username}} doesn't work(It displays nothing) I really have no idea why this is happening. Every information will be usefull. Thx. -
run celery task only once on button click
I created a django app with a celery task that organises database tables. The celery task takes about 8 seconds to do the job ( quite heavy table moves and lookups in over 1 million lines ) This celery starts through a button click by a registered user. I created a task-view in views.py and a separate task-url in urls.py. When navigating to this task-url, the task starts. My Problem: When you refresh the task-url while the task is not finished, you fire up a new task. With this set-up, you navigate to another page or reload the view How do I prevent the task from firing up each time on refresh and prevent navigating to another page. Ideally, a user can only run one task of this particular type. Might this be doable with JQuery/Ajax? Could some hero point me out in the right direction as I am not an expert an have no experience with JQuery/Ajax. Thanks -
How to make a 3 levels filter menu in Django
I have the following models in django: Category, Sub Category and Product. I am trying to understand how could I make a website, with a form in Django that by Selecting the Category it will only shows the SubCategory under that Category, and by Selecting the SubCategory ony shows the Product in that SubCategory, all in drop-down menus. Any suggestions? I am not really finding anything that tells me how to do it. Thanks -
not navigate to line_chart.html page in django using chart.js?
I am new in django, i need to develop chart based application i am creating line chart using chart.js library i have install pip install django-chartjs INSTALLED_APPS settings: INSTALLED_APPS = ('chartjs',) Create the HTML file Create the view with labels and data definition and also add urls.py file and static files. when i run this application it returns only json data but i want to display chart if any mistake my code.its not navigate to html page. reference link http://django-chartjs.readthedocs.io/en/latest/ -
Django - How to properly send a request to server and ask to run a matlab program?
I have a django web project on a server. I want it to run a matlab code to produce some text file(which will be used later). Here is my code: if(request.method == "POST"): run_octave(Dataset,is_multiclass,require_mapper,mapper,require_aspect_ratio,aspect_ratio) return redirect('meta2db.views.meta2db') def run_octave(dataset,is_multiclass,require_mapper,mapper,require_aspect_ratio,aspect_ratio): origWD = os.getcwd() args = ["octave", "dbEval.m",dataset,is_multiclass,require_mapper,\ mapper,require_aspect_ratio,aspect_ratio] os.chdir(os.path.join(os.path.abspath(sys.path[0]), "../scripts/")) process = subprocess.Popen(args, stdout=subprocess.PIPE) #print(os.listdir("../scripts/results/chruch_street/")) time.sleep(5) for line in process.stdout: time.sleep(0.5) Group("eval_status").send({"text": line.decode('utf-8')},immediately=True) if process.poll() is None: process.kill() else: print(process.communicate()) os.chdir(origWD) I ues a post request to run the octave code with subprocess call. However the matlab code take awhile to be finished and always make the client timeout which is not acceptable. My question is how to solve this kind of problem in another way. A post request seems not a good solution. -
CSV Import Challenges
My CSV file have data field with the following record examples: ColumnA C,17.87491.0E , H,09.9745.9B After data import into SQL Management Studio, each record will split creating multiple column: ColumnA (C ,H) ColumbB (17.87491.0E ,09.9745.9B) Please how can I resolve this ? Can anyone help? -
Upgrade Django installation on AWS elasticbeanstalk
I have a Django 1.9.12 project running on EBS. I'd like to upgrade to Django 1.11 which I've done in the dev environment. How can I force EBS to update to 1.11? I hoped it might be a simple case of updating the requirements.txt but that hasn't worked with eb deploy Would it be easier just to create a new EBS project? -
pass ApiKeyAuthentication in tastype
I am new to tastypie and I am receiving 401 unauthorized error. I thought the headers are automatically pass because of the inclusion of the middleware or am I incorrect? My user is logged in via views.py and a key is generated and stored via tastypie's helper function. Once the user logs in, it gets directed to some page. I go check the api page and it shows unauthorized but if I remove ApiKeyAuthentication I can see my user. In my url it shows localhost:8000/api/user_details there's no user and key info. I've tried including this models.signals.post_save.connect(create_api_key, sender=User) in models.py and in api.py. Same error. api.py class MyResource(ModelResource): user = fields.ForeignKey(UserResource, 'user') class Meta: queryset = MyTable.objects.all() resource_name = 'user_details' authorization = DjangoAuthorization() authentication = ApiKeyAuthentication() list_allowed_methods = ['get', 'post'] def authorized_read_list(self, object_list, bundle): return object_list.filter(user=bundle.request.user) -
How to dynamically filter ModelChoice's queryset in a Inlineformset?
I just want to filter select field in a inlineformset. Scenario: Every task has own report.Each task has a booking .Booking has several booked items.I want to display only related bookeditems based on booking in report form.Report form is generated using signals and while editing i'm using inlineformset to populate form with instances. Here is my code : Models.py class Task(models.Model): booking = models.ForeignKey( Booking, blank=False, null=True, related_name='booking_id',) ...... class Report(models.Model): task = models.ForeignKey( Task, blank=True, null=True, related_name='task',) hoarding = models.OneToOneField( BookedItem, blank=True, null=True, related_name='+') status = models.CharField( max_length=32, choices=ReportStatus.CHOICES, blank=True, null=True, default=ReportStatus.INCOMPLETE) views.py def report(request, pk): task_instance = get_object_or_404(Task, pk=pk) booking = task_instance.booking_id #all bookeditems here bookeditems = BookedItem.objects.filter(Booking_id=bookeditem) # inline formsetfactory ReportFormset = inlineformset_factory(Task,Report,form=TaskReportForm,fields=('hoarding','status',), extra=0,can_delete=False,) data = request.POST or None formset = ReportFormset(instance=task_instance) for form in formset: form.fields['hoarding'].queryset = bookeditems.all() if request.method == 'POST': formset = ReportFormset(request.POST,instance=task_instance) if formset.is_valid(): formset.save return redirect('taskreport') else: formset = ReportFormset(instance=task_instance) else: formset = ReportFormset(instance=task_instance) return render(request, 'report.html', {'formset': formset, 'bookeditems': bookeditems, 'task_instance': task_instance}) forms.py class TaskReportForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(TaskReportForm, self).__init__(*args, **kwargs) class Meta: model = PrinterReport fields = ['hoarding','status',] exclude = ['printer_task',] report.html: <form action="." method="POST">{% csrf_token %} {{ formset.management_form }} <section id="account" class="nice-padding active"> <div class="link-formset"> <table class="listing listing-page"> … -
Controlling PolymorphicModel classed object as model in Generic view
I have a PolymorphicModel class named Vehicle, and I derived two class from this: Car and Truck. I use UpdateView to update but it's getting vehicle_id from vehicle_list randomly. And I have to control which type of vehicle is this model. But I couldn't. My classes: class Vehicle(PolymorphicModel): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, verbose_name="ID") class Car(Vehicle): car_license = models.CharField(max_length=32) class Truck(Vehicle): truck_license = models.CharField(max_length=32) In view: class VehicleUpdate(UpdateView): car = object if car.car_license is not None: model = Car else: model = Truck fields = '__all__' def get_success_url(self, **kwargs): return reverse_lazy('person-list') But it's giving this error: AttributeError: type object 'object' has no attribute 'tr_id' By the way, I tried to use "isinstance()" but it didn't work. Maybe it's about being PolymorphicModel, I don't know. class VehicleUpdate(UpdateView): if isinstance(object, Car): model = Car else: model = Truck fields = '__all__' def get_success_url(self, **kwargs): return reverse_lazy('person-list') -
Django: UnicodeEncodeError at /admin/structure/type/add/
I have issues when I enter a string with these french characters: é, è, à, etc... I tried two things: The first thing is adding this at the very top of my views.py file: # -*- coding: utf-8 -*- The second thing is adding this to my settings.py file: DEFAULT_CHARSET = 'utf-8' And I still get this error message whenever I enter a string with a special character: Environment: Request Method: POST Request URL: http://10.0.0.238:8000/admin/structure/type/add/?_to_field=id&_popup=1 Django Version: 1.8 Python Version: 2.7.13 Installed Applications: ('apps.structure', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware') Traceback: File "/home/kaiss/.local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 132. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/kaiss/.local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper 616. return self.admin_site.admin_view(view)(*args, **kwargs) File "/home/kaiss/.local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view 110. response = view_func(request, *args, **kwargs) File "/home/kaiss/.local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func 57. response = view_func(request, *args, **kwargs) File "/home/kaiss/.local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner 233. return view(request, *args, **kwargs) File "/home/kaiss/.local/lib/python2.7/site-packages/django/contrib/admin/options.py" in add_view 1516. return self.changeform_view(request, None, form_url, extra_context) File "/home/kaiss/.local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper 34. return bound_func(*args, **kwargs) File "/home/kaiss/.local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view 110. response = view_func(request, *args, **kwargs) File "/home/kaiss/.local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func 30. return func.__get__(self, type(self))(*args2, **kwargs2) File "/home/kaiss/.local/lib/python2.7/site-packages/django/utils/decorators.py" in inner 145. return func(*args, **kwargs) File "/home/kaiss/.local/lib/python2.7/site-packages/django/contrib/admin/options.py" in changeform_view 1470. self.log_addition(request, new_object) … -
Function Call in another function not working in django shell
I have a file : def fetchArticles(topic): testing() def testing(): print("testing") print("starting") fetchArticles("World") It is present in a app in django and when i run it as a standalone file using python3 xyz.py it runs perfectly fine but when i run it in django shell using python3 manage.py shell < xyz.py it is not able to locate the testing function. It shows this error : starting Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 363, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 355, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python3.5/dist-packages/django/core/management/base.py", line 330, in execute output = self.handle(*args, **options) File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/shell.py", line 101, in handle exec(sys.stdin.read()) File "<string>", line 12, in <module> File "<string>", line 4, in fetchArticles NameError: name 'testing' is not defined Can anyone help me to resolve this issue ? -
"detail : Invalid signature ." in JWT
I have created login/register API using DRF and JWT token. The api works fine, it generates the token. Now I have another app that provides a capability to add notices to authenticated users only. When I try to test, I supply the header as Authorization JWT <token> in postman, but I get the following as the error: "detail : Invalid signature ." I even checked the token here https://jwt.io/, it shows signature verified. Now I am unable to detect the problem. I surfed all through the internet but no luck. Please anyone can help me out with this. For full api you can see it in github here, and suggest me if I am wrong anywhere. views.py class AddNotice(APIView): permission_class = (AllowAny,) serializer_class = AddNoticeSerializer def post(self, request, format=None): data = request.data serializer = AddNoticeSerializer(data=data) if serializer.is_valid(raise_exception=True): new_data = serializer.data return Response(new_data) return Response(serializer.errors, status=HTTP_400_BAD_REQUEST) serializers.py class AddNoticeSerializer(serializers.ModelSerializer): class Meta: model = Api fields = ('id', 'notice_name', 'notice_desc', 'notice_author', 'notice_valid_till', 'notice_publish_date') def create(self, validated_data): return Api.objects.create(**validated_data) def update(self, instance, validated_data): instance.notice_name = validated_data.get('name', instance.notice_name) instance.notice_desc = validated_data.get('category', instance.notice_desc) instance.notice_author = validated_data.get('subcategory', instance.notice_author) instance.notice_valid_till = validated_data.get('subcategory', instance.notice_valid_till) instance.notice_publish_date = validated_data.get('subcategory', instance.notice_publish_date) instance.save() return instance -
how to generate pdf for business card using python?
i enter image description herewant to generate pdf for business ID card using django -
File Uploading Using Alfresco and Django Python
We are developing an application using Django1.11 (Python 3.6) and Angular 4. We want to develop our system in such a way that all types of files, documents etc. will be saved to Alfresco using Alfresco API. We do not have so much knowledge in integrating the alfresco API system. How the API authentication process works etc. And We are little bit confused how to call the API and about the integration process. If anyone can guide us to a proper way, the help will be appreciated. Thank you so much. -
Link ManyToManyFields in django
I have models defined as below: class Subject(models.Model): subject_id = models.IntegerField(primary_key=True) subject_name = models.CharField(max_length=20) class Teacher(models.Model): teacher_id = models.CharField(max_length=10, primary_key=True) teacher_name = models.CharField(max_length=30) teacher_age = models.IntegerField() teacher_doj = models.DateField() subjects = models.ManyToManyField(Subject) class TeacherScores(models.Model): co_id = models.CharField(primary_key = True, max_length=5) internal_score = models.IntegerField() external_score = models.IntegerField() teacher = models.ManyToManyField(Teacher) Here I want to modify the TeacherScores model such that I can include scores for a teacher per subject. I tried inserting subjects via the teacherscores object but I get error. >>> t1 = TeacherScores('C006','23','24',teacher__subject='Math') Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/Django-1.11.5-py2.7.egg/django/db/models/base.py", line 572, in __init__ raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0]) TypeError: 'teacher__subject' is an invalid keyword argument for this function >>> t1 = TeacherScores('1','C006','23','3','4','5',teacher__subjects='Math') Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/Django-1.11.5-py2.7.egg/django/db/models/base.py", line 572, in __init__ raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0]) TypeError: 'teacher__subjects' is an invalid keyword argument for this function How can change my Model- TeacherScores to include the subject field for a teacher provided there is a ManyToMany field defined between teacher and subject, also with TeacherScores and Teacher -
Django oscar product description
I am exploring django oscar ecommerce and I wanted to find out if there was a way to insert images into product description. Under dashboard, it doesn't allow me to insert images or edit it in html mode. Many Thanks! enter image description here -
How to integrate Django authentication with Jinja2 templates properly?
I am trying to use authentication and authorisation system provided by Django and as I can see the default built-in views for login/logout expect Django templates, hence I cannot use my Jinja2 base.html file to extend them as I have already integrated Jinja2 engine. I was able to solve this problem by replicating 'base.html' and changing syntax to Django template, but this approach forces me to rely on two same files in different templating languages. However, now I have other issue, I cannot access the user object in Jinja2 template context, even though I can do that in Django template. By saying 'I cannot access': File "/home/dir/workspace/project/venv/local/lib/python2.7/site-packages/jinja2/environment.py", line 430, in getattr return getattr(obj, attribute) UndefinedError: 'user' is undefined My Jinja2 template: {% if user.is_authenticated %} <li>User: {{ user.get_username }}</li> <li><a href="{% url 'logout'%}?next={{request.path}}">Logout</a></li> {% else %} <li><a href="{% url 'login'%}?next={{request.path}}">Login</a></li> {% endif %} My question is, how can I go around this problem? Should I just switch back Django templates, because this becomes more and more messy. -
Django ORM get jobs with top 3 scores for each model_used
Models.py: class ScoringModel(models.Model): title = models.CharField(max_length=64) class PredictedScore(models.Model): job = models.ForeignKey('Job') candidate = models.ForeignKey('Candidate') model_used = models.ForeignKey('ScoringModel') score = models.FloatField() created_at = models.DateField(auto_now_add=True) modified_at = models.DateTimeField(auto_now=True) serializers.py: class MatchingJobsSerializer(serializers.ModelSerializer): job_title = serializers.CharField(source='job.title', read_only=True) class Meta: model = PredictedScore fields = ('job', 'job_title', 'score', 'model_used', 'candidate') I want to fetch the jobs with top 3 scores for a given candidate for each model used. So, it should return the top 3 matching jobs with each ML model for the given candidate. I read about annotations in django ORM but couldn't get much. I want to use DRF serializers for this operations. This is a read only operation. I am using Postgres as database. What should be the Django ORM query to perform this operation? -
Django static files : use only /static/ directory
I have a Django live version in production and I develop in local with Django manager.py. I'm not able to find the correct configuration settings for my static files. All my static files are on a /static/ on the root of the project, because all the sub-apps use the same stylesheets and so on. STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'staticfiles'), ) STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_URL = '/static/' On my live version : it works because I've got an NGINX rule that allow access to /static/ directly. But when I want to work on local, the static files are 404, with Debug True and False. I don't see the interest for my needings of the staticfiles directory (but I can have a wrong mind here). Is it possible to have all the static files in subdirectories in /static/ (css, img, js, etc.) and to set a workable settings on both local and live production without switching something in settings.py for deployment ? Thanks for your help :) -
Save data in database for a particular column for a particlur value in another coulumn in django
html <form method="post"> {% csrf_token%} <label for="alert_selected">Your name: </label> <input id="alert_selected" type="text" name="alert_selected" value="{{form.as_p }}"> <input type="submit" value="OK"> </form> View.py def do_post(request): try: person=PersonForm(request.POST) print "Inside post" print person,"gghhgghgh" if person.is_valid(): print "Hello",person person.save() #print useralertname #alertnamedictpost = dict.fromkeys(useralertname) return render(request, 'promeditor.html', {'alertnamefile':get_displayalerts()}) except Exception as e: error_string = str(e) print error_string return render_to_response('error.html') modals.py class Person(models.Model): first_name = models.CharField(max_length=30) alert_selected=models.CharField(max_length=3000,null=True) forms.py class PersonForm(ModelForm): class Meta: model=Person fields=['first_name','alert_selected'] //My requirment is that I need to save data for a particular username the details.Like how in views I will point out for this particluar username i have the following details. Now it is throwing an error<tr><th><label for="id_first_name">First name:</label></th><td><ul class="errorlist"><li>This field is required.</li></ul><input type="text" name="first_name" required id="id_first_name" maxlength="30" /></td></tr> -
django allauth signup callback?
I am working on a Django app where after a user registers/signs up, I create a an instance of 'x' on their homepage - like a new file or something. How can I achieve this? For example, I have a function create_instance() which I need to be executed like this: def after_signup_callback(): create_instance(); Should I inherit from the SignupView defined in allauth and add a method of my own? or Should I wait for the user to login and when the user arrives at the homepage (where the created instance is shown), check if its the user's first login, and then call the create_instance() method? -
Saving to related_name name django field?
I have two model classes for shop items so far. class Item(models.Model): title = models.CharField(max_length=250) price = models.DecimalField(max_digits=8, decimal_places=2) url = models.URLField(max_length=250) image = models.CharField(max_length=1000) retailer = models.CharField(max_length=250) category = models.CharField(max_length=100) featured = models.CharField(max_length=10, default='NO') class Stock(models.Model): item = models.ForeignKey(Item, related_name='sizes') size = models.TextField() I have a script that reads a CSV datafeed file and use pandas to parse then input the appropriate results into the database. Via a command like this: try: Item( title=title, price=price, aw_product_id=aw_product_id, url=url, image=image, retailer=retailer, category=category, ).save() except IntegrityError as e: print(e)try: I'm using inlines as there are multiple sizes that I wish to add such as 'XS, S, M, L, XL, XXL'. This is my admin.py class StockInline(admin.StackedInline): model = Stock class ItemAdmin(admin.ModelAdmin): inlines = [ StockInline, ] admin.site.register(Item, ItemAdmin ) admin.site.register(Stock) How can I add to the 'sizes' field on 'Stock'? I've though about something like this: size=Stock.objects.create(size=size) ? -
Cant create new user in Django by form?
In my Django project I have modal with form where superuser can create new user. When superuser submit the form if raise error in browser console. Also here below you can see detailed log. Can someone say where are my mistakes? I am not sure but it seems to me that form is not valid because of password1 and password2 fields. Do you have any ideas? forms.py: from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm class UserCreateForm(UserCreationForm): class Meta: model = User fields = ('username', 'first_name', 'last_name', 'email', 'is_active', 'is_superuser', 'last_login', 'date_joined', 'password1', 'password2') def __init__(self, *args, **kwargs): super(UserCreateForm, self).__init__(*args, **kwargs) self.fields['username'].widget.attrs = { 'class': 'form-control', 'id': 'username', } self.fields['first_name'].widget.attrs = { 'class': 'form-control', 'id': 'first_name', } self.fields['last_name'].widget.attrs = { 'class': 'form-control', 'id': 'last_name', } self.fields['email'].widget.attrs = { 'class': 'form-control', 'id': 'email', } self.fields['password1'].widget.attrs = { 'class': 'form-control', 'id': 'password1', } self.fields['password2'].widget.attrs = { 'class': 'form-control', 'id': 'password2', } self.fields['is_active'].widget.attrs = { 'class': 'form-control', 'id': 'is_active', } self.fields['is_superuser'].widget.attrs = { 'class': 'form-control', 'id': 'is_superuser', } self.fields['last_login'].widget.attrs = { 'class': 'form-control', 'id': 'last_login', 'readonly': 'readonly', } self.fields['date_joined'].widget.attrs = { 'class': 'form-control', 'id': 'date_joined', 'readonly': 'readonly', } views.py: class UserCreateView(CreateView): template_name = 'users/create_user.html' form_class = UserCreateForm def get(self, … -
Django Python application not getting Taggable_friend Permission
I have applied many times to Facebook and asked for taggable_friend permission as I want to display the friend image and then tag them. I tried the sharable dialog, so that I can get the taggable-friend permission but failed. <script> document.getElementById('shareBtn').onclick = function() { FB.ui({ method: 'share_open_graph', action_type: 'og.shares', action_properties: JSON.stringify({ object: { 'og:url': document.location.origin, 'og:title': "{{fb.first_name}}'s Test result", 'og:description': 'Let\'s check yours.', 'og:image': '{{fb.picture.data.url}}', } }) }, function(response){}); } document.getElementById('invite').onclick = function() { FB.ui({ method: 'send', link:"http://website:port/", }, function(response){}); } window.fbAsyncInit = function() { FB.init({ appId : 'xxxxxxxxxxxxx', xfbml : true, version : 'v2.10' }); FB.AppEvents.logPageView(); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> I want to know how I can have access to taggable_friend permission from facebook. What I can do so that I get access to Taggable friend permission. Kindly, let me know your insights.