Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django + PostgreSQL Connection - Cannot use server side cursor
I have a stored procedure in PostgreSQL that returns a refcursor (its name can be passed as an argument): -- Example stored procedure.... CREATE OR REPLACE FUNCTION example_stored_procedure(ref refcursor, gid_number integer) RETURNS refcursor AS $$ DECLARE ref refcursor; BEGIN OPEN $1 for SELECT * FROM lucca_routes where gid = gid_number; RETURN $1; END; $$ LANGUAGE plpgsql; Then, I can get the result set from postgres console with no problems in this way: BEGIN; select example_stored_procedure('customcursor', 1); FETCH ALL IN "customcursor"; COMMIT; But, I need to get the result set from inside a Django app (using its postgreSQL connection). According to this, I tried: from django.db import connections from rest_framework.response import Response from rest_framework.decorators import api_view @api_view(['GET']) def testing_procedure(request): connection = connections['default'] with connection.cursor() as cursor: cursor.execute("BEGIN") cursor.callproc("example_stored_procedure", ['customcursor', 1]) # "steal" the cursor - ERROR HERE! cursor2 = connection.cursor('customcursor') # fetch here the data from cursor2... return Response(result) When I try to "steal" the new cursor (cursor2 creation) returned by callproc(), I have the error: TypeError: cursor() takes 1 positional argument but 2 were given What I'm doing wrong? How can I fetch the data from the refcursor returned by callproc()? I'm using psycopg2 2.7.5 -
django-import-export keyerror, when using OneToOneField
My models.py file is from django.db import models class companyDetail(models.Model): short_code = models.CharField(primary_key=True, max_length=50) title = models.CharField(max_length=50) page_title = models.CharField(max_length=50) class Meta: verbose_name = "companyDetail" verbose_name_plural = "companyDetails" def __str__(self): return self.title class companyDescription(models.Model): comDetail = models.OneToOneField( companyDetail, on_delete=models.CASCADE, related_name='coDetail', primary_key=True, ) description = models.CharField(max_length=5000) add_description = models.CharField(max_length=5000) class Meta: verbose_name = "companyDescription" verbose_name_plural = "companyDescriptions" def __str__(self): return self.comDetail.title I am trying to break my model/table "company" into two diffrent modles "companyDetail" and "companyDescription" and connect them through OneToOneField. It works fine when I am trying to add data via shell. I am importing csv to django-import-export for model "companyDetail" it works fine but I am importing csv for model "companyDescription" it throws error: Traceback (most recent call last): File "/home/abhirajput/testpro/myenv/lib/python3.5/site-packages/import_export/resources.py", line 453, in import_row instance, new = self.get_or_init_instance(instance_loader, row) File "/home/abhirajput/testpro/myenv/lib/python3.5/site-packages/import_export/resources.py", line 267, in get_or_init_instance instance = self.get_instance(instance_loader, row) File "/home/abhirajput/testpro/myenv/lib/python3.5/site-packages/import_export/resources.py", line 261, in get_instance return instance_loader.get_instance(row) File "/home/abhirajput/testpro/myenv/lib/python3.5/site-packages/import_export/instance_loaders.py", line 31, in get_instance field = self.resource.fields[key] KeyError: 'comdetail' Please help me in layman terms, as I am a civil engineer trying to get into web development and breaking tables(Breaking Bad). If you have any other suggestion about breaking model/tables "company" into two models "companyDetail" and "companyDescription" please tell … -
How can I monkey patch model.auth Group __str__ method?
I want to monkey patch Django Group model with new __str__ method. I know how to monkeypatch Group's manager but it doesn't work with __str__ method. That's new method that I want to put in Group model: def __str__(self): return self.name if 'test' not in self.name else self.virtual_group.title virtual_group is related name to another model and I want to take it's title and replace. I will appreciate any help! -
Django Admin Automation to Send Daily Query Activity to Admin
Did a small app for parking and i want to ask your advice/help on how to make an automation that will submit daily report to the admin. Currently use Dango SQL-Explorer 3rd pty plugin to show you this. Basically my SQL query is: SELECT * FROM parcare_parking WHERE parking_on = tomorrow() In the explorer i can see nice this window. I would like each day at 18:00 to receive the snapshot of this query. How can i do that? -
Key error at 'data' in Django class based view
I am getting key error at data!Means data doesnt exists but i am accessing it, but i have given condition for that,if data is None then execute this otherwise pass, still its raising error. Why so? class ApiListView(TemplateView): def get(self, request): list_view = GetList().get_list_data() movie_list= list_view.json() cart_list_view = GetCartList().get_list_data(request).json() print(request.user) print(cart_list_view['data']) total = 0 l = [] if cart_list_view['data'] is not None: for object in cart_list_view['data']: obj = object['cart_id'] l.append(obj) total = len(l) else: pass if self.request.session.session_key: #session = self.request.session_key context = { 'movie_list':movie_list, 'home_status':'Show LoggedIn Page', 'total_items': total, } return render(request,'content-list.html' , context) else: context = {'movie_list':movie_list} return render(request, 'content-list.html', context) TRACEBACK ERROR Environment: Request Method: GET Request URL: http://localhost:8000/ Django Version: 2.1 Python Version: 3.6.5 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'myuser'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] Traceback: File "D:\customuser\venv\lib\site-packages\django\core\handlers\exception.py" in inner 34. response = get_response(request) File "D:\customuser\venv\lib\site-packages\django\core\handlers\base.py" in _get_response 126. response = self.process_exception_by_middleware(e, request) File "D:\customuser\venv\lib\site-packages\django\core\handlers\base.py" in _get_response 124. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "D:\customuser\venv\lib\site-packages\django\views\generic\base.py" in view 68. return self.dispatch(request, *args, **kwargs) File "D:\customuser\venv\lib\site-packages\django\views\generic\base.py" in dispatch 88. return handler(request, *args, **kwargs) File "D:\customuser\venv\signup\myuser\views.py" in get 24. print(cart_list_view['data']) Exception Type: KeyError at / Exception Value: 'data' -
AttributeError: 'PasswordReset' object has no attribute 'username'
Model: class UserInfo(AbstractBaseUser, PermissionsMixin): username = models.EmailField(_('邮件'), max_length=50, default='', unique=True) first_name = models.CharField(_('姓'), max_length=50, default='', blank=True, null=False) last_name = models.CharField(_('名'), max_length=50, default='') mobile = models.CharField(_("手机"), max_length=11, blank=True, null=True) img = models.ImageField(_("头像"), upload_to='static/img/users/', default='/static/img/users/100_1.jpg', null=False, blank=False) department = models.CharField(_("部门"), max_length=50, default='', blank=True) is_active = models.BooleanField(_("有效"), default=True) is_staff = models.BooleanField(_("员工"), default=True) create_date = models.DateTimeField(_('创建日期'), auto_now_add=True) roles = models.ManyToManyField(Role) USERNAME_FIELD = 'username' REQUIRED_FIELDS = ['first_name', 'last_name', 'mobile', 'department', 'is_active', 'is_superuser'] object = UserManager() class Meta: verbose_name_plural = _("User") Form extend from Userinfo: class PasswordReset(forms.ModelForm): error_messages = { 'password_mismatch': _("The two password fields didn't match."), 'password_incorrect': _("Your old password was entered incorrectly. Please enter it again."), } old_password = forms.CharField( label=_("Old password"), strip=False, widget=forms.PasswordInput(attrs={'autofocus': True, 'class': 'form-control m-input'}), required=True, ) new_password1 = forms.CharField( label=_("New password"), widget=forms.PasswordInput(attrs={'autofocus': True, 'class': 'form-control m-input'}), strip=False, help_text=password_validation.password_validators_help_text_html(), required=True, ) new_password2 = forms.CharField( label=_("New password confirmation"), strip=False, widget=forms.PasswordInput(attrs={'autofocus': True, 'class': 'form-control m-input'}), required=True, ) class Meta: model = UserInfo fields = ['username', 'password', 'img', 'first_name', 'last_name'] def clean_new_password2(self): password1 = self.cleaned_data.get('new_password1') password2 = self.cleaned_data.get('new_password2') if password1 and password2: if password1 != password2: raise forms.ValidationError( self.error_messages['password_mismatch'], code='password_mismatch', ) password_validation.validate_password(password2, self.username) return password2 def clean_old_password(self): """ Validate that the old_password field is correct. """ old_password = self.cleaned_data["old_password"] if not self.username.check_password(old_password): raise forms.ValidationError( … -
Django admin actions: generate actions for all choices with only one method
For a model that looks like this: class MyModel(models.Model): my_field = models.CharField(choices=FIELD_CHOICES) where FIELD_CHOICES = [("Update this", "Update this"), ("Update that", "Update that"), ("Update something else", "Update something else"), ] and with the following admin view class MyModelAdmin(admin.ModelAdmin): list_display = ["user", ] If we want to have an action to update the field with any of its values, we add one method for each value in the ModelAdminView, like so: actions = ("update_this", "update_that", "update_something_else") def update_this(self, request, queryset): queryset.update(my_field="Update this") def update_that(self, request, queryset): queryset.update(my_field="Update that") def update_something_else(self, request, queryset): queryset.update(my_field="Update something else") However, all these methods are identical, except some parts that could be retrieved from the field's choices... Does Django provide any way to generate actions for all choices of a field with only one generic method? -
Django redirect to a particular model page directly after login based on user-type
I am a newbie to Django. The project I am working on has a requirement that I am stating below. There will be many users. Each user will belong to a particular group (for this case let us assume that the groups are X,Y,Z). Also, each user group will have a url associated with it. What I want is, whenever a user accesses the sytem, the Django-admin-authentication-system must check the group of the user and according to the user group, the user must be re-directed to a url that is pre-defined for the particular user group. For example if user belonging to group X accesses the system, the user will be redirected to a url abc.xys.df. I was able to successfully do so. But, now I have another requirement. Suppose I have a model named "TEST" in my django-models. Now, what I want is if a user belonging to a particular group accesses the system then, the user will be directly re-directed to the page wherein I will be able to directly view the data inside the model. -
Django Copy model instance and all inherited related objects with multiple level copying
I want to duplicate a model instance and also duplicate all the child related objects. I am using the following code which i find it in a similar post: def duplicate(obj, value=None, field=None, duplicate_order=None): collector = Collector({}) collector.collect([obj]) collector.sort() related_models = collector.data.keys() data_snapshot = {} for key in collector.data.keys(): data_snapshot.update({ key: dict(zip([item.pk for item in collector.data[key]], [item for item in collector.data[key]])) }) root_obj = None # Sometimes it's good enough just to save in reverse deletion order. if duplicate_order is None: duplicate_order = reversed(related_models) for model in duplicate_order: # Find all FKs on model that point to a related_model. fks = [] for f in model._meta.fields: if isinstance(f, ForeignKey) and f.rel.to in related_models: fks.append(f) # Replace each `sub_obj` with a duplicate. if model not in collector.data: continue sub_objects = collector.data[model] for obj in sub_objects: for fk in fks: fk_value = getattr(obj, "%s_id" % fk.name) # If this FK has been duplicated then point to the duplicate. fk_rel_to = data_snapshot[fk.rel.to] if fk_value in fk_rel_to: dupe_obj = fk_rel_to[fk_value] setattr(obj, fk.name, dupe_obj) # Duplicate the object and save it. obj.id = None if field is not None: setattr(obj, field, value) obj.save() if root_obj is None: root_obj = obj return root_obj On the 3d … -
Django summing values over past 10 weeks for each week
Given a date how can you sum the total of the week that date falls in and each of the 10 weeks previous? For each day in the last 30 this can be accomplished by: import datetime as dt from django.db.models import Sum last_30 = dt.date.today() - dt.timedelta(days=30) order_data = Order.objects.filter( date__gt=last_30).extra( select={'day': 'date(date)'}.values('day').annotate( total=Sum('total') ) print(order_data) <OrderQuerySet [{'day': datetime.date(2018, 8, 28), 'total': Decimal('50000.00'), {'day': datetime.date(2018, 8, 29), 'total': Decimal('84000.00'), '...(remaining elements truncated)...']> I guess they could also somehow be grouped into weeks after the fact by looping through order_data but I was wondering if there's another way. Using postgresql if that makes a difference. -
Getting Error While running manage.py ...import Error cannot import name backend
Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/manageme nt/init.py", line 364, in execute_from_command_line utility.execute() File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/manageme nt/init.py", line 338, in execute django.setup() File "/home/devbase/env/local/lib/python2.7/site-packages/django/init.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/registry .py", line 85, in populate app_config = AppConfig.create(entry) File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/config.p y", line 94, in create module = import_module(entry) File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module import(name) File "/home/devbase/env/local/lib/python2.7/site-packages/djorm_pgtrgm/__init_ _.py", line 1, in from django.db import backend ImportError: cannot import name backend -
Django: Issue with a Video file uploader to S3 bucket using Boto3
I want to upload a video file to AWS S3 bucket using Boto3. I've already created a bucket named 'django-test' and given the required permissions. I am using Django and working on Windows 10 machine. I've created a function called store_in_s3 in views.py file in my Django app. The expected file size is lower than 200mbs. I am a bit confused with the several approaches I've tried. Below is the existing code def store_in_s3(request): transfer = S3Transfer(boto3.client( 's3', region_name = settings.AWS_S3_REGION_NAME, aws_access_key_id=settings.AWS_ACCESS_KEY_ID, aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY )) client = boto3.client('s3') bucket = "django-test" file = request.FILES["file"] filename = file.name transfer.upload_file("filename", bucket, "test.mov") At this point, I am getting the following error: [WinError 2] The system cannot find the file specified: 'filename' My code in HTML form is below: <form method="post" enctype="multipart/form-data"> {% csrf_token %} {{ form.file }} <button type="submit">Submit</button> </form> Additional Information: I was successful at uploading the video file at one point in this development process but on S3 its size was ridiculously small - only 28 Bytes. That's why I restarted building the uploader. I'll be greateful for any help. Please feel free if you need any more information on the question. Thank you. -
Django Debbug Toolbar Won't Hide
Clicking on Hide on the Django debug toolbar (version 1.10.1) does not work on my Google Chrome (Version 69.0.3497.100). I'm using Django 1.11.15 and I can confirm that the Hide does indeed work on Firefox. The following is output by the console: Uncaught ReferenceError: djdt is not defined at toolbar.js:305 Line 305 being: })(djdt.jQuery, djdt); Anyone have suggestions on how to fix this or provide a possible workaround? -
nltk download not working inside docker for a django service
I am trying to launch a django service using docker which uses nltk library. In the dockerfile I have called a setup.py which calls nltk.download. According to the logs I see during building the docker image this step runs successfully. But when I run the docker image and try to connect to my django service, I get the error saying that nltk.download hasn't happened yet. Dockerfile code - RUN . ${PYTHON_VIRTUAL_ENV_FOLDER}/bin/activate && python ${PYTHON_APP_FOLDER}/setup.py setup.py code - import nltk import os nltk.download('stopwords', download_dir=os.getcwd() + '/nltk_data/') nltk.download('wordnet', download_dir=os.getcwd() + '/nltk_data/') Any idea what is wrong here? Also, the same code works when I run it without docker. -
How to store csv file to database in django?
In my project I want to enter 300 students every year. so it is not possible using add student form.So I want to create functionality for bulk data entry using csv or excel file. I have tried many things related to this but can't get solution. ** models.py ** class AddStudent(models.Model): enrollment_no = models.BigIntegerField(primary_key=True) student_name = models.CharField(max_length=500,null=True) gender = models.CharField(max_length=1,choices=GENDER_CHOICES) course = models.ForeignKey(CourseMaster, on_delete=models.DO_NOTHING, null=True) category= models.ForeignKey(CatMaster, on_delete=models.DO_NOTHING, null=True) admission_year = models.IntegerField(('year'), choices=YEAR_CHOICES, default=datetime.datetime.now().year) college = models.ForeignKey(CollegeMaster, on_delete=models.DO_NOTHING, null=True) branch = models.ForeignKey(BranchMaster,on_delete=models.DO_NOTHING, null=True) current_semester = models.IntegerField(null=True) address = models.CharField(max_length=1000,null=True) city = models.CharField(max_length=100,null=True) district = models.CharField(max_length=100,null=True) state = models.CharField(max_length=100,null=True) student_contact = models.BigIntegerField() parent_contact = models.BigIntegerField() This is my models.py file and I want to store following fields through csv file. some fields are foreign key related to another models. so how to solve this? ** Views.py ** def upload_csv(request): data = {} if "GET" == request.method: return render(request, "add_student/bulk.html", data) # if not GET, then proceed try: csv_file = request.FILES["csv_file"] if not csv_file.name.endswith('.csv'): messages.error(request,'File is not CSV type') return HttpResponseRedirect(reverse("add_student:upload_csv")) #if file is too large, return if csv_file.multiple_chunks(): messages.error(request,"Uploaded file is too big (%.2f MB)." % (csv_file.size/(1000*1000),)) return HttpResponseRedirect(reverse("add_student:upload_csv")) file_data = csv_file.read().decode("utf-8") lines = file_data.split("\n") #loop over the lines and save … -
Django: request.user.is_authenticated renders True and then False on refresh after authentication on Heroku
After logging in I get logged out after refreshing the page a couple times. If I keep refreshing, it will load the logged in view again and continue this behavior. @login_required def logged_in_view(request): return render(request, "logged_in.html", {}) ... user = authenticate(username=username, password=password) if user is not None: login(request, user) return redirect('logged_in_view') -
Django not cleaning certain form fields
So my form is the following: class Uploaded_Cisco_YML_Configs(forms.Form): uploaded_configs = forms.FileField() goto_model = forms.TextInput() interfaces_migrate = forms.Textarea() The issue I'm having is that the goto_model and interfaces_migrate form fields are defined in the form.data dictionary however their not in the form.cleaned_data so I'm unable to access them properly. Is there any reason why this might be happening?. The HTML is below <form method="post" enctype="multipart/form-data"> {% csrf_token %} <input id="uploaded_configs" name="uploaded_configs" type="file" multiple/> <br> New Model:<br> <input type="text" name="goto_model"> <br>Interfaces to Migrate: <br> <input type="text" name="interfaces_migrate"> <input type="submit" value="Run Script"/> </form> And the views.py is below form = Uploaded_Cisco_YML_Configs(request.POST, request.FILES) if form.is_valid(): rebuild_args = [] if form.goto_model is not None: print("#"*10) print(str(form.data)) print(str(form.cleaned_data)) -
Mezzanine only loads admin pages on debug
I have a Mezzanine blog under development, hosted at Heroku. While I have it on debug mode, by ensuring settings.py has DEBUG = True, everything works like a charm. When I set it to false, any attempt to access admin gives me the generic error message. All other aspects of the site works fine, including blog posts I've made (with DEBUG = True) for testing. I'm looking for any of two forms of help: How could I get better debugging information while having DEBUG = False in settings.py? Any hint or suggestion about what could be the problem. -
I have django rest_framework ListAPIView method which returns me list of users, how I can exclude requesting user from the same user list
serializers.py class UserSerializer(serializers.ModelSerializer): class Meta: model = models.CustomUser fields = ('username', 'email', 'is_active','is_superuser') views.py class UserListView(generics.ListAPIView): queryset = models.CustomUser.objects.all() serializer_class = serializers.UserSerializer I am using auth token for the URLs, so I will have user token in headers from which I can identify and exclude, this is what I wanted to try. -
Django form - SelectMultiple changing the visible value
I'm junior dev. Working on project in Django 1.8, Python 2.7.15. What I want to achieve? I want to change names of groups 'test_X' to another string (payment title), but not in database... only in visible layer of form. (SelectMultiple widget) In groups I have something like this: Super Group Extra Group New Group test_1 test_2 test_3 Great Group test_4 (...) The 'test_x' groups are connected via one to one field to Payments model. Just look on my code: class Payment(models.Model): (...) title = models.CharField(max_length=120, null=False) group = models.ManyToManyField(Group) virtual_group = models.OneToOneField( Group, null=True, related_name='virtual_group', ) class PaymentForm(forms.ModelForm): class Meta: model = Payment fields = ( (...), 'group', ) labels = { (...), 'group': u'Choose specific group', } widgets = { 'group': forms.SelectMultiple(attrs={'class': 'form-control chosen', 'data-placeholder': 'Select group'}), } def __init__(self, *args, **kwargs): super(TournamentForm, self).__init__(*args, **kwargs) prepare() def prepare(self): (...) groups = Group.objects.all() # here I'm changing names of groups 'test_X' to the tournament title using one to one connection list_of_proper_names = [g.name if not 'test' in g.name else g.virtual_group.title for g in groups] # in ok I got proper values (this is list of strings -> group names and Payment titles) # and here I'm trying to pass only … -
Django, Nginx, uwsgi, Kubernetes: unable to connect nginx to uwsgi stream
I have a django container and an Ngix container. they work fine with docker-compose, and now im trying to use the images with kubernetes. Everything works fine, except the fact that the nginx container cannot connect to the uwsgi upstream. No response is being returned. Here are my configuration: # Nginx congifuration upstream django { server admin-api-app:8001 max_fails=20 fail_timeout=10s; # for a web port socket (we'll use this first), } server { # the port your site will be served on listen 80; server_name server localhost my-website-domain.de; charset utf-8; location / { uwsgi_pass django; include /etc/nginx/uwsgi_params; } } # Uwsgi file module = site_module.wsgi master = true processes = 5 socket = :8001 enable-threads = true vacuum=True # Kubernetes # Backend Deployment apiVersion: apps/v1 kind: Deployment metadata: name: container-backend labels: app: backend spec: replicas: 1 selector: matchLabels: app: backend template: metadata: labels: app: backend spec: containers: - name: container-backend image: my-djangoimage:latest command: ["./docker/entrypoint.sh"] ports: - containerPort: 8001 name: uwsgi - name: nginx image: my-nginx-image:latest imagePullPolicy: Always ports: - containerPort: 80 name: http --- # Backend Service kind: Service apiVersion: v1 metadata: name: admin-api-app spec: selector: app: backend ports: - port: 80 targetPort: 80 type: LoadBalancer -
Django Ajax Upvote / Downvote button where JS is in a forloop
Intro: Supposing I have a Quora type app where members can ask any questions and other members can Answer the Questions. Both Questions and Answers can be upvoted or downvoted. Just like it is in StackOverflow. Please See a Screenshot Image below As you can see above each page has 1 Question and multiple Answers to that Question. This page is rendered by a Questions DetailView in Django. So If I do question.title It will print the questions title. Now to access each answer on this page I do {% for answer in question.answers.all %} In the Django Templates. So after that in the forloop of the template till I reach {% endfor %}I can type answer.something ans that something will print on the page The Problem: I have a Question upvote/downvote and Answer upvote/downvote both on the same page The JS for the Question upvote/downvote script works perfect However The Answer upvote/downvote which is inside the forloop is not. If I click Answer Upvote Once The console.log shows I have clicked in 2 times. I click it 2nd time The console.log shows I have clicked in 6 times There are times when the console.log shows I have clicked it … -
Getting django runserver statistics
Got a problem for which google doesn't seem to have an answer. Well, so i have a django based simple rest application running (http://www.django-rest-framework.org/tutorial/quickstart/). Now what i want to achieve is to get the statistics of the server such as total active requests, total GET POST PUT DELETE requests and total requests. I am able to get total requests by adding each API Hit to the DB as a counter, however i have no way of figuring it out if the request is open or closed or waiting. Is there any way i can do this? Thank you in advance -
Angular 6 and DRF Django Social authentication
I'm using Angular 6 for the front-end and for the back-end I have Django. I connect the front-end and back-end with Django Rest Framework. I need to implement social authentication with (Google, Facebook, LinkedIn). right now I'm using angular-6-social-login. But I don't know how to implement it in the back-end. -
Django Showing Error while running manage.py file
while running my .....python manage.py Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 364, in execute_from_command_line utility.execute() File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 338, in execute django.setup() File "/home/devbase/env/local/lib/python2.7/site-packages/django/init.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/config.py", line 94, in create module = import_module(entry) File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module import(name) ImportError: No module named djorm_pgtrgm