Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django update "extended user profile" model field from webhook paramater
I am getting a webhook from our billing processor after a user makes a payment. So far I have successfully saved the webhook in models for record keeping. However, now I need to update the User account_paid field to the appropriate status. I believe I've outlined the steps properly but I am stuck on implementing the code. How do I update account_paid and make sure it's the right user ID? views.py #@require_POST def webhook(request): template_name = 'payment/index.html' hook = Webhook() hook.user = request.GET.get('clientAccnum') hook.clientSubacc = request.GET.get('clientSubacc') hook.eventType = request.GET.get('eventType') hook.eventGroupType = request.GET.get('eventGroupType') hook.subscriptionId = request.GET.get('subscriptionId') hook.timestamp = request.GET.get('timestamp') hook.timestamplocal = timezone.now() hook.save() print (hook.user, hook.clientSubacc, hook.timestamplocal) if hook.eventType == 'RenewalSuccess': #Update user account_level to Paid Account Profile.account_paid.update(True) else: #Update user account_level to Free Profile.account_paid.update(False) models.py class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) bio = models.TextField(max_length=500, blank=True) birth_date = models.DateField(null=True, blank=True) account_level = models.BooleanField(default=False) There are no error messages yet because I'm trying to figure out the structure right now. The goal is to finish this question with a working solution. *Side note: I know webhooks are delivered to URL as POST but for now I am using get purely for debugging purposes. -
You're accessing the development server over HTTPS, but it only supports HTTP
I've developed my own website on Django for a while, and today I started to learn how to deploy it. In the middle of the deployment work, I tried to host again locally, which seemingly went fine, BUT when I tried to access the site through my browser, the server printed this: [13/Jan/2018 16:56:49] code 400, message Bad request syntax ('\x16\x03\x01\x00À\x01\x00\x00¼\x03\x03ßà\x84¼+Jnßþn-ñ\x88ý©vAþK\x83¤²êT\x86\x0b.\x8em\x0b:â\x00\x00\x1cÚÚÀ+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00') [13/Jan/2018 16:56:49] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x00À\x01\x00\x00¼\x03\x03\x87') [13/Jan/2018 16:56:49] You're accessing the development server over HTTPS, but it only supports HTTP. [13/Jan/2018 16:56:49] You're accessing the development server over HTTPS, but it only supports HTTP. [13/Jan/2018 16:56:49] code 400, message Bad request version ('JJÀ+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00') [13/Jan/2018 16:56:49] You're accessing the development server over HTTPS, but it only supports HTTP. I don't know what I've done for this to happen. Here are some of the things I've done to the project that could have caused it. But of course, there could be other reasons too. 1.Added this is the settings.py: SECURE_CONTENT_TYPE_NOSNIFF = True SECURE_BROWSER_XSS_FILTER = True SECURE_SSL_REDIRECT = True SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True X_FRAME_OPTIONS = 'DENY' # Heroku: Update database configuration from $DATABASE_URL. import dj_database_url db_from_env = dj_database_url.config(conn_max_age=500) DATABASES['default'].update(db_from_env) # Static files (CSS, JavaScript, Images) # … -
Django: weird behavior of foreign key lookup and annotate F expression
class Sentence(Model): name = CharField() class Tokens(Model): token = CharField() sentence = ForeignKey(Sentence, related_name='tokens') Sentence.objects.annotate(n=Count('tokens', distinct=True)).filter(n=5).filter(tokens__name__in=['se']).annotate(n0=F('tokens')).filter(tokens__name__in=['faire']).annotate(n1=F('tokens')).filter(tokens__name__in=['faire']).annotate(n2=F('tokens')).filter(tokens__name__in=['un']).annotate(n3=F('tokens')).filter(tokens__name__in=['avoir']).annotate(n4=F('tokens')) Above code generates the following query: SELECT "sentence"."id", "sentence"."name" COUNT(DISTINCT "token"."id") AS "n", T3."id" AS "n0", T4."id" AS "n1", T4."id" AS "n2", T6."id" AS "n3", T6."id" AS "n4" FROM "sentence" LEFT OUTER JOIN "token" ON ("sentence"."id" = "token"."sentence_id") INNER JOIN "token" T3 ON ("sentence"."id" = T3."sentence_id") INNER JOIN "token" T4 ON ("sentence"."id" = T4."sentence_id") INNER JOIN "token" T5 ON ("sentence"."id" = T5."sentence_id") INNER JOIN "token" T6 ON ("sentence"."id" = T6."sentence_id") INNER JOIN "token" T7 ON ("sentence"."id" = T7."sentence_id") WHERE (T3."name" IN (se) AND T4."name" IN (faire) AND T5."name" IN (un) AND T6."name" IN (avoir) AND T7."name" IN (faire)) GROUP BY "word_frword"."id", T3."id", T4."id", T6."id" HAVING COUNT(DISTINCT "token"."id") = 5 Why is numbering so strange (starts with T3)? But moreover why n2 is assigned to T4, not T5? Same for n4 and T6. Looks like numbers go by 2. What I want to accomplish is capture token id on each step of inner join. It works when there are one join, but then it breaks. Any suggestions? -
QuerySet in Django 2.0. doesnt work
I had a little break in Django and today I decided to come back to this framework. But now I have a problem with elementary thinks. I want to complete one of the guides in polish language. I've install Django 2.0 and I created some things like this: models.py from django.db import models from django.utils import timezone class Post(models.Model): author = models.ForeignKey('auth.User', on_delete=models.CASCADE, ) title = models.CharField(max_length=200) text = models.TextField() created_date = models.DateTimeField( default=timezone.now ) published_date = models.DateTimeField( blank = True, null = True ) def publish(self): self.published_date = timezone.now() self.save def __str__(self): return self.title project urls.py from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path(r'', include('blogs.urls')), ] app urls.py from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.post_list, name='post_list'),] views.py from django.shortcuts import render from django.utils import timezone from .models import Post def post_list(request): posts = Post.objects.order_by('title','published_date').first() return render(request, 'blogs/post_list.html', {}) and post_list.html <div> <h1><a href="/">My blog</a></h1> </div> {% for post in posts %} <div> <p>published: {{ post.published_date }}</p> <h1><a href="">{{ post.title }}</a></h1> <p>{{ post.text|linebreaksbr }}</p> </div> {% endfor %} Prompt do not receive any errors, but when I checking the localhost:8000 I have only a <h1> text. I … -
Modify one ForeignKey of a ModelForm get IntegrityError
I am want to creat a very simple commenting system for a basic django website. Each comment has a ForeignKey of the Article it is about. Obviously the ForeignKey should be initialised directly to the ForeignKey of the article the user is on. I don't understand why this is not working. I get an integrity error but if I change in the Model of the Comment, null=True then it does not save the article. When I print form1.articleRef I get the right thing def lire_article(request, slug): """ Affiche un article complet, sélectionné en fonction du slug fourni en paramètre """ article = get_object_or_404(Article, slug=slug) comments=Comment.objects.filter(articleRef=article) form1 = CommentForm(request.POST or None) if form1.is_valid(): form1.save(commit=False) form1.articleRef = article form1.save() envoi = True return render(request, 'blog/lire_article.html', {'article': article,'comments': comments,'form1':form1}) -
why doesn't pip freeze > requirements.txt output Django?
I'm trying to deploy my Django site on Heroku, and thus, I need a requirements.txt file with the necessary packages that Heroku needs to install for me. I understand Django is a necessary package to be installed. Unfortunately, Django isn't included in the file when I run pip freeze > requirements.txt. Why is this? I'm not sure what to show you so you can tell me what's going wrong. Let me know and I'll add it. FYI the site hosts just fine on my local computer, so Django is definitely installed. -
Render view of Django FormSet inside a Bootstrap Modal
I want to put a Django FormSet inside of a Bootstrap 4 modal, just like is done here. However, the big difference is that tutorial (and every other one I've found) is only using Forms, whereas I want to use a FormSet. Where the approach breaks down for me is here: return JsonResponse({'html_form': html_form}). JsonReponse can convert a form to Json, but it cannot convert a formset to Json. So I am wondering, is there another approach. Should I 1) Convert the formset to a dictionary and just return the dictionary? if so, how best to convert a formset to a dictionary? I am not the biggest fan of this approach because I have several customizations in the formset that I suspect I will lose. 2) Pass the entire Formset View into the Modal as html? is this even possible? 3) is there some 3rd approach that might work, perhaps using AngularJS? I will really appreciate any insight on this. -
Django Error - TemplateSyntaxError at / Could not parse the remainder: '['userType']' from '['userType']'
{% if 'is_logged_in' in request.session %} {% if request.session['userType'] == 0 %} {% include 'headersuccess.html' %} {% else %}dfgh {% endif %} This is my code. I am checking two conditions But I am getting the above error . Can anybody please help me to solve the same? My views.py is @csrf_exempt def index(request): if('is_logged_in' in request.session): id = request.session['authToken']; return render(request,"index.html",{'uid':id}); else: return render(request,"index.html",{}); -
How to declare a function in JavaScript?
I have a problem - I declared a function, but it execute incompletly: some of the instructions within execute, some not. I guess it happens, because DOM content hadn't loaded yet. But when I declare it inside of jQuery's $(document).ready() function I can't call it anywhere. How to declare function in JavaScript, to use it anywhere in the code? Here is my code: script.js (loaded at the end of body): function setSearchableColumns() { $('#data thead').prepend('<tr class="searching-row"></tr>'); $('#data thead th').each(function(){ var title = $(this).text(); $('.searching-row').each(function() { $(this).append('<th><input type="text" class="form-control form-control-sm" id="search_' + title + '" placeholder="Szukaj ' + title + '"/></th>'); }) }); table.columns().every(function(index) { var tableColumn = this; $('#data thead').find('input').eq(index).on('keyup change', function (e) { tableColumn.search(this.value).draw(); }) }); $('#search_\\#').remove(); //THIS DON'T EXEC $('#search_Operacje').remove(); //THIS DON'T EXEC } Written at the end of actually rendered template in django: $(document).ready(function(){ var table = $('#data').DataTable({ "ordering": true, "language": { "url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Polish.json" }, "columns": [ null, { "width": "35%" }, null, null, null, { "width": "75px" }, ] }); setSearchableColumns(); }); -
Change primary key on manytomany field Django
Is it possible to change primary key of many to many field from default to uuid? Table is already populated. What is the best way for migration? -
Loading Image in a React+Django app
So I have a little project written in python/django for the backend and react for the frontend. I followed the tutorial from: http://geezhawk.github.io/using-react-with-django-rest-framework I want to show an image for the logo of the project, the webpack build was success, but however, the image could not load up when I see the page, I suppose that is because the compiled URL of the image could not be resolved from the django's urls, and also accessing the url for it just load the same index page.... At this point I'm not sure how I can fix it, but I would be more than grateful if anyone can point me to an example code of how to do this, how to load image in a react + django project. -
Django Views Parameters
I have made a Django Model like this: Student Class, Subject Class - foreign key to Student Class Grade Class - foreign key to Subject Class In my understanding, I have set it up so that: Multiple Students can have multiple Subjects, and each Subject that students are in will have different Grades. I am trying to make a separate page for each student, so each page will display the Student name, Subjects the student is taking, and the Grade for each Subject. This is my views.py file for the page (I have set the url as /(student_pk)/ for each student's page) from django.shortcuts import render from .models import Student, Subject, Grade def detail(request, student_pk, subject_pk): stud = Student.objects.get(pk=student_pk) subject = stud.subject_set.all() sub = Subject.objects.get(pk=subject_pk) grade = subject.grade_set.all() context = { 'student_pk':student_pk, 'subject':subject, 'grade':grade, } return render(request, 'studentinfo/detail.html', context) The views parameter to my knowledge can only take 2. Is this the right way to do so? I have a feeling it is not and that my models itself is setup wrong for my purpose. Thank you. -
Receiving the error "Struct() argument 1 must be string, not unicode" when using Django
I am receiving the error "Struct() argument 1 must be string, not unicode" when running a script in Django but it runs OK in python. I'm trying to translate the hex version of a SID from Active Directory to the string version. The error says argument 1 is unicode but from what I can tell it's not. From what I can tell argument 1 is the sliced value of SID. Any help is appreciated. Here is the code: result = con.search_s(ldap_base, ldap.SCOPE_SUBTREE, criteria, attributes) sid = result[0][1]["objectSid"][0] if sys.version_info.major < 3: revision = ord(sid[0]) else: revision = sid[0] if sys.version_info.major < 3: number_of_sub_ids = ord(sid[1]) else: number_of_sub_ids = sid[1] iav = struct.unpack('>Q', b'\x00\x00' + sid[2:8])[0] sub_ids = [struct.unpack('<I', sid[8 + 4 * i:12 + 4 * i])[0] for i in range(number_of_sub_ids)] sid = 'S-{0}-{1}-{2}'.format(revision, iav, '-'.join([str(sub_id) for sub_id in sub_ids])) [Error part 1][1] [Error part 2][2] [sid value][3] [1]: https://i.stack.imgur.com/GV0yb.png [2]: https://i.stack.imgur.com/rxhW7.png [3]: https://i.stack.imgur.com/4lzed.png -
django rest api with jwt authentication is asking for csrf token
I am new to django rest api framework. I am using JWT token based authentication for the rest api with the following setting - REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_jwt.authentication.JSONWebTokenAuthentication', 'rest_framework.authentication.TokenAuthentication', 'rest_framework.authentication.BasicAuthentication', 'rest_framework.authentication.SessionAuthentication', ), 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ) } AND JWT_AUTH = { 'JWT_ENCODE_HANDLER': 'rest_framework_jwt.utils.jwt_encode_handler', 'JWT_DECODE_HANDLER': 'rest_framework_jwt.utils.jwt_decode_handler', 'JWT_PAYLOAD_HANDLER': 'rest_framework_jwt.utils.jwt_payload_handler', 'JWT_PAYLOAD_GET_USER_ID_HANDLER': 'rest_framework_jwt.utils.jwt_get_user_id_from_payload_handler', 'JWT_RESPONSE_PAYLOAD_HANDLER': 'rest_framework_jwt.utils.jwt_response_payload_handler', 'JWT_SECRET_KEY': SECRET_KEY, 'JWT_GET_USER_SECRET_KEY': None, 'JWT_PUBLIC_KEY': None, 'JWT_PRIVATE_KEY': None, 'JWT_ALGORITHM': 'HS256', 'JWT_VERIFY': True, 'JWT_VERIFY_EXPIRATION': True, 'JWT_LEEWAY': 0, 'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=300), 'JWT_AUDIENCE': None, 'JWT_ISSUER': None, 'JWT_ALLOW_REFRESH': True, 'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7), 'JWT_AUTH_HEADER_PREFIX': ('JWT','Bearer'), 'JWT_AUTH_COOKIE': None, } Now based on this, I have used postman plugin inside chrome and tried to test my web api for authentication using the steps below - I used the url http://127.0.0.1:8000/webs/auth-jwt/ with the credentials to obtain the token. I used the url http://127.0.0.1:8000/webs/testspsearch/ and passed the token generated in step 1 as Authorization Bearer . This is defined as POST method but when I do this, I get the error -> CSRF verification failed. Request aborted. HTTP 403 error. Can you please let me know what am I doing wrong in this? -
Django exact match of ForeignKey Values
class Sentence(Model): name = CharField() class Tokens(Model): token = CharField() sentence = ForeignKey(Sentence, related_name='tokens') I want to implement two cases: Sentence consists exactly of three tokens ['I', 'like', 'apples']. So list of sentence.tokens.all() is exactly ['I', 'like', 'apples']. Same as above, but contains tokens (part of sentence). Sentence.objects.annotate(n=Count('tokens',distinct=True)).filter(n=3).filter(tokens__name='I').filter(tokens__name='like').filter(tokens__name='apples') doesn't work, since it matches I I I as well. Is there any way to filter on exact set of values in ForeignKey? -
Django Admin "Inline and Parent's Inline" Custom Validations
I'm trying to create two validations in one Django Admin page; an Inline's validation and the Inline's Parent Validation. Let me show you my code first: models.py class Rule(models.Model): disease = models.ForeignKey(Disease,related_name="diseases") measure_of_belief = models.PositiveIntegerField( \ help_text="The measure of belief (percentage) that a disease is present given this evidence exists", \ default=0,validators=[MinValueValidator(0), MaxValueValidator(100)]) measure_of_disbelief = models.PositiveIntegerField( \ help_text="The measure of disbelief (percentage) that a disease is present given an evidence does not exists", \ default=0,validators=[MinValueValidator(0), MaxValueValidator(100)]) Condition_Order = models.CharField(\ help_text="This field will be the basis of the condition's hierarchy/order, If two or more evidence exists in a rule." + \ "<br/> This statement only accepts the corresponding 'evidence number', an 'or' (disjunction), and an 'and' (conjuction)." + "<br/> e.g. 24 and 34" \ ,max_length=500,default=None,blank=True, null=True) archived = models.BooleanField(default=False) def __str__(self): return "{}-{}".format(self.id,self.disease) class Meta: verbose_name = "Rule" verbose_name_plural = "Rules" class Rules_Evidence(models.Model): rule = models.ForeignKey(Rule,related_name="rules") evidence = models.ForeignKey(Evidence,related_name="evidences") class Meta: verbose_name = "Rules Evidence" verbose_name_plural = "Rules Evidences" def __str__(self): return "{}".format(self.id) Here's my models. What I'm trying to achieve is to create a validation for the "condition order" field. admin.py class BaseEvidenceAdminInlineSet(BaseInlineFormSet): # 'Rules_Evidence' Validation def clean(self): super(BaseEvidenceAdminInlineSet, self).clean() repetition = [] for form in self.forms: string_error = "Please … -
Django insert permission in migration
I need to populate auth_group_permission table in a migration. I've created a migration with this code: # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-12-05 10:07 from __future__ import unicode_literals from django.db import migrations from django.contrib.auth.models import Group, Permission from django.contrib.auth.management import create_permissions def add_group_permissions(apps, schema_editor): for app_config in apps.get_app_configs(): create_permissions(app_config, apps=apps, verbosity=0) #Workers group, created = Group.objects.get_or_create(name='Workers') can_add_worker_task = Permission.objects.get(codename='add_worker_task') group.permissions.add(can_add_worker_task) group.save() class Migration(migrations.Migration): dependencies = [ ('crowdsourcing', '0005_add_view_permission'), ('auth', '0001_initial'), ] operations = [ migrations.RunPython(add_group_permissions), ] But when I execute "python manage.py migrate" commando I received this error: "django.contrib.auth.models.DoesNotExist: Permission matching query does not exist". I think the problem is that the "auth_permission" table is still empty. Can i solve? -
Django test doesnt update model
Probably something simple but its bugging me that one of my tests is failing. I have a view that handles a POST request from a form to edit a model. I cant see why this test is failing (name does not change): def test_edit_club_view(self): """ Test changes can be made to an existing club through a post request to the edit_club view. """ new_club = Club.objects.create( name = "new club name unique" ) self.client.post("/clubs/edit/{}/".format(new_club.pk), data = {"name": "edited_club_name"}) self.assertEqual(new_club.name, "edited_club_name") The test for the form passes: def test_club_can_be_changed_through_form(self): """ Test the ClubForm can make changes to an existing club in the database. """ form_data = { "name": "new club name" } add_club_form = ClubForm(data = form_data, instance = self.existing_club) add_club_form.save() self.assertEqual(self.existing_club.name, "new club name") Also, if I print the values for the name field in the view, it appears to be changed there, but not reflected in the test case. AssertionError: 'new club name unique' != 'edited_club_name' -
Patch Method with Extend User Model in Django Rest Framework
I'm confusing to create a Patch method with Extend User Model in Django Rest Framework. Hope your guys helps. My Extend User Model: class Profile(models.Model): user = models.OneToOneField(User, unique=True) bio = models.CharField My serializers: class UserEditSerializer(ModelSerializer): username = serializers.CharField(source='user.username') first_name = serializers.CharField(source='user.first_name') last_name = serializers.CharField(source='user.last_name') email = serializers.CharField(source='user.email') class Meta: model = Profile fields = [ 'username', 'email', 'first_name', 'last_name', 'bio', ] My Viewsets: class UserUpdateAPIView(ReadOnlyModelViewSet): queryset = Profile.objects.all() serializer_class = UserEditSerializer @detail_route(methods=['PATCH']) def edit(self, request): user_obj = User.objects.get(id=request.user.id) serializer = UserEditSerializer(user_obj, data=request.data, partial=True) print(request.data) if serializer.is_valid(): serializer.save() return Response(serializer.data) return Response(status=status.HTTP_400_BAD_REQUEST) Error: AttributeError at /api/v1/users/account/edit/ Got AttributeError when attempting to get a value for field `username` on serializer `UserEditSerializer`. The serializer field might be named incorrectly and not match any attribute or key on the `User` instance. Original exception text was: 'RelatedManager' object has no attribute 'username'. -
Hostname showing different page to IP Address
I'm creating my Django website via Digital Ocean using Nginx/Gunicorn via this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04 In my Django settings I have: ALLOWED_HOSTS = ['venvor.com', '174.138.62.249'] The first is my hostname, and second is the corresponding IP Address. Here's the networking tab in my Digital Ocean showing that: https://i.imgur.com/YTu6wIW.png However these 2 pages show 2 different things. If you click here my hostname shows this Nginx page : http://venvor.com/ but the IP Address shows the initial Django page: http://174.138.62.249/ Any idea why they are different? -
Basic: How to use PATCH Method User Model in Django Rest Framework
I have problem with using PATCH Method User Model in Django Rest Framework. Hope your guy helps and save my time. Urls.py urlpatterns = [ url(r'^account/edit/$', UserDetailAPIView.as_view({'patch': 'edit'})) ] Views.py: class UserDetailAPIView(ReadOnlyModelViewSet): queryset = User.objects.all() serializer_class = UserSerializer @detail_route(methods=['PATCH']) def edit(self, request): user_obj = User.objects.get(id=request.user.id) serializer = UserRegisterSerializer(user_obj, data=request.data, partial=True) if serializer.is_valid(): serializer.save() return Response(serializer.data) return Response(status=status.HTTP_400_BAD_REQUEST) Serializer: class UserRegisterSerializer(ModelSerializer): class Meta: model = User fields = [ 'email', 'first_name', 'last_name' ] Error: It's not partial update. It update all fields with let it blank. -
In what cases should I use UUID as primary key in Django models
What are advantages and disadvantages of UUID field? When should I use it as a primary key? When should I use default primary key? My table has many rows. Is it possible that max value of default primary key will be exceeded? I use PostgreSQL. -
Django app: on modelse.py any kind of def is not working
here my code, last two function is not working i am also trying more function but still they are not working. from django.db import models # Create your models here. class Article(models.Model): title = models.CharField(max_length=100) slug = models.SlugField() body = models.TextField() date = models.DateTimeField(auto_now_add=True) # nothing to show def __str__(self): return self.title def snippet(self): return self.body[0:50] -
How do I retrieve informations from my facebook user token using python in a django web app?
I just created a web application using django. It has a login page where a user can login using facebook or twitter or github and I did that using django_social_auth2. In my settings.py, I added the required authentication backends: AUTHENTICATION_BACKENDS = ( 'social_core.backends.github.GithubOAuth2', 'social_core.backends.twitter.TwitterOAuth', 'social_core.backends.facebook.FacebookOAuth2', 'django.contrib.auth.backends.ModelBackend',) added social_django in my installed apps and ask for the following informations: SOCIAL_AUTH_FACEBOOK_SCOPE = [ 'email', 'user_posts', 'user_location',] A user who wants to login, gets the following message: And in the admin page, I get a token with the granted informations. Now, what I want to do is extract the user's informations without having to paste the token in the facebook graph API explorer. How can I do this in python and integrate it in my Django app ? I have read the documentation regarding the granted informations and the users will only be me and my teaching assistant. Thanks -
Using mysql and mongodb together for Django
Can I use both relational-database(eg : mysql) and non-relational database(eg : mongodb) together as bacekend dbs for a Django project? If possible then how? I use Django version 1.11