Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to use Django in a Python script?
Is it possible to use Django in a python script? I think I saw something about it in the past, but I can't find any reference to it now. So, basically, I want to build a python script and access Django ORM. Thanks for any help -
How can I always keep a time panel up to date?
I made a small web app with django (version 3.0) and I added a panel that is supposed to show date and time. My only problem is that the time only refreshes when the page is reloaded. The HTML code (in combination with DTL) for the panel is as follows: <div class="today_info"> <table> <caption>Datum & Uhrzeit</caption> <tr> <td>Datum: </td> <td>{% now 'D, d. F Y' %}</td> </tr> <tr> <td>Uhrzeit: </td> <td>{% now 'H:i' %}</td> </tr> </table> -
Get values from Django model to Javascript GETJSON
My question is very basic but cannot find the answer I'm importing values from django models to js thanks to json. code seems to work as when I go to the all_json_count url the model is well appeared I just dont know how to get the entire data and the each column of the model in javascript to work with does anyone know ? thank you ! views.py def all_json_count(request): pie = counttype.objects.all() json_models = serializers.serialize("json", pie) return HttpResponse(json_models, content_type="application/javascript") template $(document).ready(function() { var url = "all_json_count/"; $.getJSON(url, function(pie) { var data = "{{pie}}" var transaction = "{{pie.transaction_type}}"; var count_type = "{{pie.count}}"; alert(transaction + count_type); }); }); models.py class counttype(models.Model): transaction_type = models.CharField(max_length=40) count = models.IntegerField(null=True) -
Getting Wagtail go live at date
I'm trying to make a queryset that returns pages that are scheduled to be published in the future. I tried using the Page model's go_live_at attribute, but I get the following error: NameError: name 'go_live_at' is not defined. Why isn't it defined, and is there a better way of doing this? Thanks. -
Custom django middleware calling only on pages that are related to allauth
I'm trying to get a login form on all of my pages if a user is not logged in. To do this I'm using middleware to always be able to access the allauth LoginForm and embedding the login form in my base template. The issue is that the middleware is only getting called on pages that are related to allauth e.g. the /accounts/signup/ page. Navigating to a url that is in my app, the middleware is not calling. So all the allauth pages show the login form properly but any pages in my app don't have the login form. Middleware (myapp/middleware/template.py) from allauth.account.forms import LoginForm class LoginFormMiddleware(object): def __init__(self, get_response): self.get_response = get_response def __call__(self, request): response = self.get_response(request) return response def process_template_response(self, request, response): response.context_data['global_login_form'] = LoginForm() return response Template (templates/base.html) Inside the template is this code: {{ global_login_form.as_p }} settings.py MIDDLEWARE = [ ... 'myapp.middleware.template.LoginFormMiddleware', ... ] On allauth pages On myapp -
Font Awesome 4.7 Icons Not Showing in Django S3 Project
Font Awesome 4.7 icons are showing squares in my Django project when using Amazon S3. Question I'm trying to answer is: Why is my CSS working but not my Font Awesome icons? Locally, when DEBUG = True The Font Awesome Icons work: When I set DEBUG = False: My settings.py uses Amazon S3 bucket settings: if DEBUG: STATIC_URL = '/static/' STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static_cdn') STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static') ] MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'media_cdn') else: AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID'] AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY'] AWS_FILE_EXPIRE = 200 AWS_PRELOAD_METADATA = True AWS_QUERYSTRING_AUTH = True DEFAULT_FILE_STORAGE = 'helloworld.storage_utils.MediaRootS3BotoStorage' STATICFILES_STORAGE = 'helloworld.storage_utils.StaticRootS3BotoStorage' AWS_STORAGE_BUCKET_NAME = os.environ['AWS_STORAGE_BUCKET_NAME'] S3DIRECT_REGION = 'us-west-2' S3_URL = '//%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME MEDIA_URL = '//%s.s3.amazonaws.com/media/' % AWS_STORAGE_BUCKET_NAME MEDIA_ROOT = MEDIA_URL STATIC_URL = S3_URL + 'static/' ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static') ] import datetime two_months = datetime.timedelta(days=61) date_two_months_later = datetime.date.today() + two_months expires = date_two_months_later.strftime("%A, %d %B %Y 20:00:00 GMT") AWS_HEADERS = { 'Expires': expires, 'Cache-Control': 'max-age=%d' % (int(two_months.total_seconds()),), } Font Awesome 4.7 icons don't work (shows squares): In my S3 bucket, I have my CSS directory setup the same as locally: I also have the fonts directory setup (same as locally) When referencing the files in my … -
django: running "python main.py" gives ERROR:root:'REQUEST_METHOD'
When i run "python main.py" i get the following errors that i do not know how to debug. I am running django version 1.2 and python 2.7. What i have been attempting to do is try to run the Django project in the local host to no effect ERROR:root:'PATH_INFO' Traceback (most recent call last): File "/home/vicktree/.local/lib/python2.7/site-packages/webapp2.py", line 1535, in __call__ rv = self.handle_exception(request, response, e) File "/home/vicktree/.local/lib/python2.7/site-packages/webapp2.py", line 1595, in handle_exception return handler(request, response, e) File "/home/vicktree/Desktop/noah/web/noahs-app/handlers/hoptoad_handler.py", line 82, in handle_500_error notify_hoptoad(exception, request, False, False) File "/home/vicktree/Desktop/noah/web/noahs-app/handlers/hoptoad_handler.py", line 76, in notify_hoptoad send_to_hoptoad(generate_xml(exn, request, debug_mode), use_ssl) File "/home/vicktree/Desktop/noah/web/noahs-app/handlers/hoptoad_handler.py", line 34, in generate_xml xml << ('url', request.url) File "/home/vicktree/.local/lib/python2.7/site-packages/webob/request.py", line 495, in url url = self.path_url File "/home/vicktree/.local/lib/python2.7/site-packages/webob/request.py", line 467, in path_url bpath_info = bytes_(self.path_info, self.url_encoding) File "/home/vicktree/.local/lib/python2.7/site-packages/webob/descriptors.py", line 70, in fget return req.encget(key, encattr=encattr) File "/home/vicktree/.local/lib/python2.7/site-packages/webob/request.py", line 153, in encget raise KeyError(key) KeyError: 'PATH_INFO' ERROR:root:'REQUEST_METHOD' Traceback (most recent call last): File "/home/vicktree/.local/lib/python2.7/site-packages/webapp2.py", line 1546, in __call__ return response(environ, start_response) File "/home/vicktree/.local/lib/python2.7/site-packages/webob/exc.py", line 358, in __call__ is_head = environ['REQUEST_METHOD'] == 'HEAD' KeyError: 'REQUEST_METHOD' Traceback (most recent call last): File "main.py", line 1424, in <module> main() File "main.py", line 1421, in main run_wsgi_app(application) File "/home/vicktree/.local/lib/python2.7/site-packages/google_appengine/google/appengine/ext/webapp/util.py", line 101, in run_wsgi_app run_bare_wsgi_app(add_wsgi_middleware(application)) File "/home/vicktree/.local/lib/python2.7/site-packages/google_appengine/google/appengine/ext/webapp/util.py", line … -
Django Url Path for web app is duplicated. Can't figure out how it is doing that
I ran into a issue with my URL patterns in Django 2.2.5. I cannot navigate to the proper URL patterns for my apps. When I run my server I able to navigate to the base url ":8000/" as defined in APP1/url.py and views.py. When I enter :8000/signin I get the following error: Using the URLconf defined in modmagazine_base.urls, Django tried these URL patterns, in this order: admin/ [name='homepage'] signup/ signin/ coffeetable/ crafttable/ The current path, signin, didn't match any of these. However, if I add a "/" to the URL (:8000/signin/) I receive this error: Using the URLconf defined in modmagazine_base.urls, Django tried these URL patterns, in this order: admin/ [name='homepage'] signup/ signin/ signup/ [name='signup'] signin/ signin/ [name='signin'] signin/ coffeetable/ [name='coffeetable'] coffeetable/ crafttable/ The current path, signin/, didn't match any of these. The only way I can get to the views I defined is to duplicate the URL (:8000/signin/signin). If you look at my project files below this is not how I defined my URL patterns. I'm not sure where my error is. If you can help me thank you in advance! My project structure is as follows: PROJECT BASE APP1 APP2 APP3 manage.py BASE/SETTINGS INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', … -
Using SumoSelect with Datatables
Currently attempting to use SumoSelect Multiple Select with datatables filter. See below datatables code along with the sumoselect; $(document).ready(function() { $('#table-tasks').DataTable( { "dom":' <"search"f><"top"l>rt<"bottom"ip><"clear">', 'ordering': false, 'iDisplayLength': 25, initComplete: function () { var api = this.api(); api.columns([1, 2, 3, 4, 5, 6, 7, 8]).indexes().flatten().each( function ( i ) { var column = api.column( i ); var title = $('#table-tasks thead th').eq(i).text(); var select = $('<select multiple="multiple"><option value="">'+title+'</option></select>') .appendTo( $(column.header()).empty() ) .on( 'change', function () { var val = $.fn.dataTable.util.escapeRegex( $(this).val() ); column .search( val ? '^'+val+'$' : '', true, false ) .draw(); } ).on("click", function(e){ e.stopPropagation(); }); column.data().unique().sort().each( function ( d, j ) { select.append( '<option value="'+d+'">'+d+'</option>' ) } ); } ); } } ); } ); $(document).ready(function () { $('select').SumoSelect({ placeholder: 'Placeholder', }); }); Can't seem to pass the selected values into the datatables filter. All help on this is appreciated. -
How can i get right URL?
when I try this django tutorial(https://rk.edu.pl/en/capturing-images-webcam-django-jpegcam/), i get this error Not Found: /main/cap/webcam.swf i try like this in webcam.js swf_url: 'media/jpegcam/webcam.swf', shutter_url : 'media/jpegcam/shutter.mp3', in ex.html <script type="text/javascript" src="/media/jpegcam/webcam.js"></script> <script language=JavaScript> webcam.set_api_url('/main/save'); ... in settings.py, MEDIA_URL = '/media/' MEDIA_ROOT= os.path.join(BASE_DIR, 'media') If this is url problem, why this url can't find .swf file? -
Django connecting to existing postgressql database
I have a legacy web2py application which connects as an admin application to an RDS Postgresql instance in the backend. This databse serves as backend for other applications I am working on a django project to replace this web2py app. What is the best strategy for replacing the web2py app with a django one? Is it possible to keep the current live db that serves the other applications? -
How do I check whether username stored as a ForeignKey field and request.user.username are equal in Django?
I am making a personal diary app in Django. Over there I have made an app 'note'. The models.py of note app looks like this: from django.db import models from datetime import datetime from django.contrib.auth.models import User class Note(models.Model): image=models.ImageField(upload_to='images/') title=models.CharField(default="",max_length=20) body=models.TextField(default="",max_length=800) date=models.DateField(default=datetime.now()) publisher=models.ForeignKey(User,on_delete=models.CASCADE,default="") def __str__(self): return self.title Now when a user logs in, in his home page I want to show the note entries made by him only. The views.py and home.html are given below: views.py: @login_required def home(request): notes=Note.objects return render(request,'home.html',{'notes':notes}) home.html: {% extends 'basic.html' %} {% load static %} {% block content %} {% if error %} {{error}} {% endif %} {% for n in notes.all %} {% ifequal request.user.username %} <div class="container"> <a href="{% url 'note_app:detail' n.id %}"><h3>{{n.title}}</h3></a> <p>{{n.body}}</p> <footer>{{n.date}}</footer> </div> {% endifequal %} {% endfor %} {% endblock %} As you can see in my home.html I am iterating through all the objects of class Note. When the ifequal statement is not there it is showing all the entries of all users but when I am putting the ifequal statement to make sure that entries made by the logged in user is only shown it is not showing anything. Can somebody tell me how to … -
Don't understand when/why to use custom template tags
I am reading a book on django, and it had me create the following custom tag( this is a blog project): from django import template from .. models import Post register = template.Library() @register.simple_tag def total_posts(): return Post.published.count() Note I have 4 Post objects saved in my db, so now in a template, I can say something like: {% load blog_tags %} <p>This is my blog. I've written {% total_posts %} posts so far.</p> and it will return: "This is my blog. I've written 4 posts so far." I just don't understand why I would try and achieve this using a custom template tag. Why not just count the number of Post objects in a view and pass it to a template using a context variable? I.e: from .models import Post def index(request): numPosts = Post.objects.count() return render(request, 'index.html', {'numPosts': numPosts}) Thanks in advance for any replies. -
collectstatic command fails while deploying to elastic beanstalk | using django-storages for storing static files on S3
The deployment fails with the following error Traceback (most recent call last): File "/opt/python/ondeck/app/manage.py", line 21, in <module> main() File "/opt/python/ondeck/app/manage.py", line 17, in main execute_from_command_line(sys.argv) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv self.execute(*args, **cmd_options) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute output = self.handle(*args, **options) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 188, in handle collected = self.collect() File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect handler(path, prefixed_path, storage) File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 342, in copy_file if not self.delete_file(path, prefixed_path, source_storage): File "/opt/python/run/venv/local/lib/python3.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 249, in delete_file if self.storage.exists(prefixed_path): File "/opt/python/run/venv/local/lib/python3.6/site-packages/storages/backends/s3boto3.py", line 524, in exists self.connection.meta.client.head_object(Bucket=self.bucket_name, Key=name) File "/opt/python/run/venv/local/lib/python3.6/site-packages/botocore/client.py", line 272, in _api_call return self._make_api_call(operation_name, kwargs) File "/opt/python/run/venv/local/lib/python3.6/site-packages/botocore/client.py", line 549, in _make_api_call api_params, operation_model, context=request_context) File "/opt/python/run/venv/local/lib/python3.6/site-packages/botocore/client.py", line 595, in _convert_to_request_dict api_params, operation_model, context) File "/opt/python/run/venv/local/lib/python3.6/site-packages/botocore/client.py", line 627, in _emit_api_params params=api_params, model=operation_model, context=context) File "/opt/python/run/venv/local/lib/python3.6/site-packages/botocore/hooks.py", line 356, in emit return self._emitter.emit(aliased_event_name, **kwargs) File "/opt/python/run/venv/local/lib/python3.6/site-packages/botocore/hooks.py", line 228, in emit return self._emit(event_name, kwargs) File "/opt/python/run/venv/local/lib/python3.6/site-packages/botocore/hooks.py", line 211, in _emit response = handler(**kwargs) File "/opt/python/run/venv/local/lib/python3.6/site-packages/botocore/handlers.py", line 223, in validate_bucket_name if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket): TypeError: expected string or bytes-like object (ElasticBeanstalk::ExternalInvocationError) error trace isn't helping me figure out what exactly the problem here is settings.py AWS_STORAGE_BUCKET_NAME … -
Docker Djano can't translate hostname to adress
I want to deploy my django w postgres thanks to docker and i get an error like: django.db.utils.OperationalError: could not translate host name "db" to address: Name or service not known This is my docker-compose : version: '3' services: db: image: postgres environment: POSTGRES_USER: alban POSTGRES_PASSWORD: *** POSTGRES_DB: plateforme restart: always ports: - "5432:5432" web: build: ./plateforme_v2_1 volumes: - .:/code ports: - "8000:8000" depends_on: - db This is my setting.py : DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'plateforme', 'USER': 'alban', 'PASSWORD': '***', 'HOST': 'db', 'PORT': '5432', } } Does anyone here already get this problem ? Thx -
DJANGO unexpected keyword required
models.CharField(max_length=50, required=True) Using Django 3.0.1 and Python 3.6.8, I get unexpected keyword argument required.Why is that?How to fix it? -
SQL command from Django not reading table columns
I'm trying to run raw SQL commands in my Django code but when it runs it says the 'No such column..' for any of my properties. I run the same sql command in DB Browser and it runs just fine. Am I suppose to reference or import the data base a specific way to have access to it from my code? Here's what I got for my view: from django.db import connection class AllData(APIView): permission_classes = [IsOwnerOrReadOnly] def get(self, request, profile_id=None): with connection.cursor() as cursor: cursor.execute( "SELECT authapi_user.id AS profile_id, authapi_user.first_name, authapi_user.last_name, authapi_tweet.tweet_text") cursor.execute( "FROM authapi_tweet INNER JOIN authapi_user ON authapi_user.id=authapi_tweet.author_id") table = cursor.fetchone() table = AllDataSerializer(table, many=True).table return Response(table) -
Pass variable from template to views after click on map
I'm learning Django and have a problem with one task. This is not a full task, it's just for me to understand the process (I tried to read documentation, but It didn't help). So, I have a map (Leaflet) and function onMapClick. # urls.py urlpatterns = [path('map/', mapper)] I created a model to save data from template # models.py from django.db import models class MapHello(models.Model): p = models.CharField(max_length=250) def __str__(self): return self.p I want to pass some data to views.py from template after clicking on map (after using onMapClick(e)) and add It to database. As I understand, I should use AJAX. For now I have something that doesn't work. I tried to use AJAX: # part of map_in.html function onMapClick(e) { popup .setLatLng(e.latlng) .setContent("You clicked the map at " + e.latlng.toString()) .openOn(mymap); var lat_lng = e.latlng $.ajax({ url: "/map/", type: "get", data: {msg: "HELLO!!!!"}, success: function(data) { alert(data.result);; }}); So I'm trying to send do views.py message "HELLO!!!!" after every click on the map. # views.py from django.shortcuts import render from .models import MapHello def mapper(request): if request.method == "GET": value = request.GET.get('msg') if value: MapHello.objects.create(p=value) return render(request, 'map_in.html') But, as I can see, mapper don't get any data from … -
Editing a generic foreign key in Django admin
I have a Django model Invoice which has a generic foreign key client which can be either a User or an Organization. I'm looking for a way to edit the client in the Django admin somehow, but I keep getting stuck on how to define the GenericTabularInline for my InvoiceAdmin class. I'm not sure I understand what the purpose of the inline is exactly, but I'm getting the feeling that I'm trying to use it in "reverse"? This is roughly what I have to work with (lots of code elided for clarity): class Invoice(models.Model): client_type = models.ForeignKey( "contenttypes.ContentType", on_delete=models.SET_NULL, blank=True, null=True, limit_choices_to=( models.Q(app_label="users", model="user") | models.Q(app_label="organizations", model="organization") ), ) client_id = models.PositiveIntegerField(blank=True, null=True) client = GenericForeignKey("client_type", "client_id") class InvoiceClientInlineAdmin(GenericTabularInline): model = "???" # in my mind, this would be User or Organization? ct_field = "client_type" ct_fk_field = "client_id" class InvoiceAdmin(admin.ModelAdmin): inlines = (InvoiceClientInlineAdmin,) -
Django: 'UNIQUE constraint failed'
I have change and refactored my project and have an error I did not have before (and did not run my tests between to know when changes/refactoring make the error...) I have added a global 'clean' validation on ran_num in my RandomisationForm (randomisation_edit view) and switch database update from 'confirmation' view to 'randomisation_edit' view I understand the error: in my models Randomization ran_num field is UNIQUE and when I try to save a form when I call randomisation_edit view with the same ran_num it raise error but before refactoring, this error was manage by Django itself I try to add validation as below but raise another error: 'RandomisationForm' object has no attribute 'clean_data' -> I do the same for other field without this error... def clean_ran_num(self): data = self.clean_data['ran_num'] if data == 'CIV-CO-001': raise forms.validationError('test') return data I try to add validation in the global 'clean' method but it do not apply... I am lost... models.py class Randomisation(models.Model): # ran_num = models.CharField("Patient code", max_length=10, unique=True, null=True, blank=True,validators=[validate_patient_code]) ran_ide = models.AutoField(primary_key=True) ran_num = models.CharField("Patient code", max_length=10, unique=True, null=True, blank=True) ran_dat = models.DateField("Date of randomization", null=True, blank=True) ran_inv = models.CharField("Investigator", max_length=20, null=True, blank=True) ran_pro = models.IntegerField("Procedure used to randomized", null=True, blank=True) ran_pro_per … -
How do I update my created view using UpdateView
This is my view which I want to update (school_update.html) {% extends "base.html" %} {% block content %} <div class="jumbotron"> <h1>School Details :</h1> <br> <ul> <h3><li>Name: {{school_detail.name}}</li></h3> <h3><li>Principal: {{school_detail.principal}}</li></h3> <h3><li>Location: {{school_detail.location}}</li></h3> </ul> </div> <p><a href=" ">Update</a></p> {% endblock %} As I have shown above in the code I want to use this button to update this view <p><a href=" ">Update</a></p> but what I am not getting is what should I write in (href) tag to link it to my urls.py file, and then what path should I give in my urls.py file to link it to my SchoolUpdate class in my view.py file. (in short how should I get my primary key from school_update.html -> urls.py -> views.py (SchoolUpdate class)) urls.py from django.urls import path from . import views app_name = 'form' urlpatterns = [ path('index', views.IndexView.as_view(), name='home'), path('list',views.SchoolListView.as_view(), name='list'), path('<int:pk>/', views.SchoolDetailView.as_view(), name='detail'), path('create', views.SchoolCreateView.as_view(), name = 'create'), path('update/<int:pk>/', views.SchoolUpdateView.as_view(), name = 'update') ] views.py (UpdateView) class SchoolUpdateView(UpdateView): context_object_name = 'school_update' model = models.School fields = ['name','principal'] template_name = "school_update.html" -
DRF: Serializing two Foreignkeys on one model
I have following model with two Foreignkeys, pointing to the same model. Anyone got an idea, how to serialize the model? class Ta0200Object(models.Model): clientlfn = models.ForeignKey(Ta0100District, models.DO_NOTHING, related_name='+', db_column='ClientLFN') disctrictlfn = models.ForeignKey(Ta0100District, models.DO_NOTHING, related_name='+', db_column='DistrictLFN') objectnr = models.IntegerField(db_column='ObjectNR', unique=True) objectlfn = models.AutoField(db_column='ObjectLFN', unique=True, primary_key=True) class Meta: managed = False app_label = 'test' db_table = 'TA0200_Object' unique_together = (('clientlfn', 'districtlfn', 'objectlfn'),) -
Django filter query if filter parameter exists
I'm trying to create a django filter with multiple filter parameters (ex. name, age, height). However, I only want to filter by a parameter if it exists... In my init: def __init__(self, name=None, age=None, height=None): self.name = name self.age = age self.height = height in my query: Person.objects.filter(name=self.name, age=self.age, height=self.height) However, the problem is since the parameters are optional in the constructor, there is a chance that the filter is looking for None values, which I don't want. If name='mike', age=25, height=None, I only want the filter to use the name and age parameters and exclude the height. Something like: Person.objects.filter(if self.name: name=self.name, if self.age: age=self.age, if self.height: height=self.height) Is this possible? Or would I need to first check if every variable exists and have different cases for each possible filter query? Thanks! -
Django 1.2 migrating from Google+ API to Google authenticate
Until recently, i have been using google+ APi to login users as shown below: plus_service = discovery.build('plus', 'v2') google_user = plus_service.people().get(userId='me').execute(http=http) the problem is that google+ API has been deprecated and they now want me to use google authentication. Does anyone know perhaps a quick work around for this problem. -
from registration.signals import user_activated
I am trying to using django 3.0.1 and python 3.1, I am getting red error when I type that.Why is that? How to fix it? http://www.trevorhenke.com/posts/12/django-registration-and-signals