Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
AWS S3 collect static taking too long
Recently deployed my first app and had to use S3. I ran collectstatic to get it to the S3 but it has been a 10 mins+ and it is still stuck at Type 'yes' to continue screen. Is this normal that it takes so long? Never had this happen previously -
Media files missing after server updated | Git and Django
I've pushed my files to Heroku via Git, including the media files cause I really needed some photos inside the folder. After that, I included this media folder in the .gitignore file to not affect pushes in the future. For my surprise, the photos added exclusively in the Heroku server were missing and I didn't git commit anything else. It seems they work for a while and them disapear. I tried to git rm -r --cached media but it didn't work either. All the new photos updated in the site haven't been written in the media folder. Here is my updated my git log: Do you guys have any suggestion to get the media in the server running OK and future pushes from my local PC to not affect them? Thank you! -
Need help configuring Django Rest API with Google Oauth and Android
I'm trying to configure my django rest API to authenticate using google sign in OAuth and django-rest-framework-social-oauth2 I've already seen this question but I can't seem to figure out how they retrieved the access_token What I have tried this far following this guide: Started a new project in console.developers.google.com Added to settings.py: SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = '2377[...].apps.googleusercontent.com' SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = '[...]' SOCIAL_AUTH_GOOGLE_OAUTH2_SCOPE = ['email'] INSTALLED_APPS = [ ... # oauth 'oauth2_provider', 'social_django', 'rest_framework_social_oauth2' ] AUTHENTICATION_BACKENDS = ( # Google OAuth2 'social_core.backends.google.GoogleOAuth2', # django-rest-framework-social-oauth2 'rest_framework_social_oauth2.backends.DjangoOAuth2', # Django 'django.contrib.auth.backends.ModelBackend', ) But when I try to exchange my Auth Code, which I got from Google Sign In on Android gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestServerAuthCode(Values.CLIENT_ID_WEB_APP) .requestEmail() .build(); for an access token in my Django Rest API backend using OkHttpClient client = new OkHttpClient(); RequestBody requestBody = new FormEncodingBuilder() .add("grant_type", "convert_token") .add("client_id", Values.CLIENT_ID_REST_APP) .add("client_secret", Values.CLIENT_SECRET_REST_APP) .add("backend", "google-oauth2") .add("token", idToken) .build(); I get a 400 HTTP response from server: {"error":"access_denied","error_description":"Your credentials aren't allowed"} Am I missing something? Thanks in advance! -
Django: page not found 404 error // http://127.0.0.1:8000/Loader/confirm_booking/6/booking
I have model where am using two foreign key. one of them is the logged-in user and one for inheriting the post .but post foreign key is not working or not saving into the database but it should save the particular post chosen by the user or with pk this is my models.py class Booking(models.Model): b_price = models..ManyToManyField(price, related_name='b_price',on_delete=models.CASCADE,null=True) user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, default='') approved_price = models.BooleanField(default=False) pay = models.CharField(max_length=30, default='') mode = models.CharField(max_length=30 ,default='') def __str__(self): return str(self.user) **this is my views.py ** class booking_approve(CreateView, LoginRequiredMixin): form_class = forms.booking_form model = Booking template_name = "confirm_booking.html" success_url = reverse_lazy("Loader:post") def form_valid(self, form): booking = get_object_or_404(Booking, pk=self.kwargs.get('pk')) print(form.cleaned_data) bk = form.save(commit=False) bk.user = self.request.user bk.save() bk.b_price.add(booking) return super().form_valid(form) this is my urls.py path('confirm_booking/<int:pk>/booking',views.booking_approve.as_view(), name="booking_approve"), this is my post pic when clik on tick buuton next form will appear but it should also taken the id of post.. but it wont this is HTML page where I pass pk {% for loader_post in request.user.Loader.all %} {% for price in loader_post.prices.all %} {{loader_post.image_of_load.url }} Post id : {{loader_post.id }} Driver offer : {{price.driver_price }} Offer by : {{price.driver_name }} <a style="margin-right:20px;" href="{% url 'Loader:booking_remove' price.id %}"></a> <a href="{% url 'Loader:booking_approve' pk=price.pk %}"><</a> … -
Heroku and Django: Couldn't find that process type (web)
I know this has been asked a lot of times but none of the solutions seem to work. I am trying to run a Django app in Heroku but am running into issues when I try to scale dynos. ➜ main-website git:(master) heroku ps:scale web=1 Scaling dynos... ! ▸ Couldn't find that process type (web). The issue seems to be related to ProcFile. This is what I have configured in my root directory (same as requirements.txt etc). web: gunicorn main-website.wsgi:application --log-file - What am I missing or doing wrong so I can correct this? Project Structure ➜ main-website git:(master) tree -L 3 . ├── app │ ├── about │ │ ├── admin.py │ │ ├── apps.py │ │ ├── __init__.py │ │ ├── migrations │ │ ├── models.py │ │ ├── __pycache__ │ │ ├── tests.py │ │ ├── urls.py │ │ └── views.py │ ├── app │ │ ├── asgi.py │ │ ├── __init__.py │ │ ├── __pycache__ │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ ├── contact │ │ ├── admin.py │ │ ├── apps.py │ │ ├── __init__.py │ │ ├── migrations │ │ ├── models.py │ │ ├── __pycache__ │ │ … -
How to make a single div scroll down?
I have been trying to make a div block have his own scroll, so basicly a div can scroll down while the others are not in movement. The error is that when I scroll down, the div moves up but the other divs are static and that makes it look ugly because all divs have a space between them, let me know if you need more explanation! html <div class="wrapper"> <div class="side-navbar"> <h1>horse</h1> <h1>horse</h1> <h1>horse</h1> <h1>horse</h1> <h1>horse</h1> </div> <div class="content-right"> <div class="news"> <p>header next to side navbar</p> </div> <div class="user-content"> <p> blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... ..blah blah blah... … -
How to encrypt password in Django from the server side
I am new to Django. I am wondering how I can encrpyt the password I am POST from the REST API. I want my code to do something like this #Users Viewset class UsersViewSet(viewsets.ModelViewSet): queryset = Users.objects.all() m = Users(username=restapibodyusername, email=restapibodyenmail, password=make_password(pwdrestapibodypassword) serializer_class = UsersSerializer I can encrypt it in the client side but I prefer to do it in the serverside. Is this even possible? -
Create users using AWS Cognito and Django
I'm making an application using Django (Backend) and ReactJS (Frontend). The application will be hosted on AWS. I want to use AWS Cognito to allow users to login to the site. I'm trying to find out whether users can create accounts/sign up directly from my app instead of me manually creating one in the AWS User Pool. I know that there is support for this on Android, iOS and JavaScript. Is there a way to do this on Django as well? I am unable to find a library that allows me to do this. If not, is there a recommended similar service like AWS Cognito that can be used with Django? Any suggestions would be appreciated. -
What is Migration?
I'm pretty new to Django. When I start an app and run the server, there was a warning that there are "17 unapplied migrations" but I'm not too sure what they mean. From my research, migration is moving the data between location and app system. When you have a new app installed, it has a new model (which is the way the app interacts with the database). Then you need to apply the difference in models of your previous and new apps to the database structure (database schema). This action is called migration. I don't know if this is correct. Can you explain more of this to me? Also, what does the computer do when it applies a migration? Thank you! -
Django Rest framework - Triggering nested create serializer
I'm new to Django and the Rest Framework and I'm currently trying to create a kind of trigger. Let me explain, I have a three diferent models, User, Project and Project_user, the last one is used to make the many to many relation. I know Django come with a ManyToMany relation that handles all the trouble, but I implemented the Project_user model because is used to represent the role the user has in the project (Leader, Colaborator, etc) here are the models: models.py class Project(models.Model): name = models.CharField(max_length=50) description = models.CharField(max_length=200) start_date = models.DateField('Start date') def __str__(self): return self.nombre class Project_user(models.Model): role = models.CharField(max_length=15, choices=ROL_OPTIONS, default=COLABORATOR) user = models.ForeignKey(User, related_name='user', on_delete=models.DO_NOTHING) project = models.ForeignKey(Project, related_name='project', on_delete=models.DO_NOTHING) def __str__(self): return self.role Everything works nicely, I even managed to get only the relations and the projects from the currently logged in user. serializers.py class ProjectSerializer(serializers.ModelSerializer): class Meta: model = Project fields = ('id', 'name', 'description', 'start_date') def create(self, validated_data): return Project(**validated_data) class ProjectoUserioSerializer(serializers.ModelSerializer): user = serializers.HiddenField(default=serializers.CurrentUserDefault()) class Meta: model = Project_user fields = ('role', 'project', 'user') depth = 1 My goal is that whenever the current user creates a project in a POST request, an instance of the project_user is created too, … -
Adding a Search Bar Django
I need to add a search bar to my realty website that can search for an address, a street, or everything less than a price. I have been trying for hours with no luck. This is what I have so far. If you need to see any other file just let me know. Any help would be much appreciated. Thank you in advance. base.html search.html views.py files list -
Export XML filled-up in form automatilly after filled-up
i'm trying to export a XML to user that fille-up in form in page.html and got 2 problems thats cannot resolve. Little look at view.xml nomeEmpresa = request.GET.get('insi') caminhoXML = 'sistema/templates/paginas/geras-prev/previc/caixa/' file = f'{nomeEmpresa}-{now.now()}' nomeXML = ET.Element('caixa') ET.SubElement(nomeXML, "isininstituicao").text = request.GET.get('insi') ET.SubElement(nomeXML, "tpconta").text = request.GET.get('tipoDeConta') ET.SubElement(nomeXML, "saldo").text = request.GET.get('saldo') ET.SubElement(nomeXML, "nivelrsc").text = request.GET.get('nivelDeRisco') ET.ElementTree(nomeXML).write(f"{caminhoXML}{file}.xml") for file in glob.glob(f'{caminhoXML}*.xml'): if 'None' in file: os.remove(file) download = False else: download = True if download == False: return render(request, 'paginas/geras-prev/previc/caixa/index.html') else: return render(request, 'paginas/geras-prev/previc/caixa/index.html') Questions: Everytime the user access the page.html it generate a null xml, because user doesn't fill the form in index.html, what need i do to doesn't generate it without the if/else ? After user will fill the form, it will generate a right XMl file, but it save in sever. How to export that file download it automatilly after fill the form ? PS: I dont wanna use database, because its a simple XML export without any interation. Thank you guys. -
How to get django password hashing functionality in a modell mid-project
I have a project in django and I am trying to add a new field, password, to an existing model. However, I don't want to make any changes that would break the DB or the backend. All I want to add to the model is just password functionality (with hashing). How would I go about this? -
sending images using by Django Channels
I have a common chat message model in my Django project. The Message model looks like this: class Message(models.Model): writer = ... chatroom = ... body = models.TextField(verbose_name="Body", null=True, blank=True) imagemsg = models.ImageField(upload_to='message/%Y/%m/%d/', blank=True) Then in my consumer i send the body to front end like this: class ChatConsumer(AsyncConsumer): async def websocket_receive(self, event): ... myresponse = { "message": msg, 'username': username, } await self.channel_layer.group_send( self.room_group_name, { "type": "chat_message", "text": json.dumps(myresponse), } ) also this is how front end sends data to backend: socket.onopen = function (e) { formData.submit(function (event) { var finalData = { "text": msg.val() }; socket.send(JSON.stringify(finalData)); }); } so, with this texts can be sent back and forth with no issue, and the realtime behaviours happening ok. Now I want to have same behavior for the images. i.e., send them from socket.onopen and then send them back using async def websocket_receive . Unfortunately I cant find much documentation anywhere. So I was wondering if someone can give me a hint as to how to achieve this. Or even if this is the right approach, Thanks -
Django send email from POST form
I am trying to set up a send email form on my site but am having some issues connecting data filled out on the website to my contact action. I can see in the logs (after I click send) that there is a successful 200 response from a call to contact/send. POST /contact/send/ HTTP/1.1" 200 7665 But I cannot see my debugging print(request) being triggered. Am I implementing this correctly or where do I need to change my config? contact.py def contact(request): print(request) if request.method == 'POST': form = ContactForm(request.POST) if form.is_valid(): name = form.cleaned_data['name'] email = form.cleaned_data['email'] subject = form.cleaned_data['subject'] message = form.cleaned_data['message'] try: send_email(subject, message, email, [f'{os.getenv("EMAIL_ADDRESS")}']) except BadHeaderError: return HttpResponse('Invalid header found.') return redirect('success') else: form = ContactForm() return render(request, 'contact.html', {'form': form}) contact/urls.py from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('send/', views.index, name='contact') ] Contact form {% extends "layout.html" %} {% block content %} <!-- Content ============================================= --> <section id="content"> <div class="content-wrap"> <div class="container clearfix"> <!-- Postcontent ============================================= --> <div class="postcontent nobottommargin"> <h3>Send us an Email</h3> <div class="form-widget"> <div class="form-result"></div> <form class="nobottommargin" id="template-contactform" name="template-contactform" action="send/" method="post"> {% csrf_token %} <div class="form-process"></div> <div class="col_one_third"> <label for="template-contactform-name">Name <small>*</small></label> <input type="text" id="template-contactform-name" … -
Automatically fill in fields that depend on contents of FileField when creating an object from a ModelForm
Supposing I have a model representing a photo. It contains an image file, a description of the photo, and the EXIF data contained within the image file: class Photo(models.Model): photo_file = models.FileField() photo_description = models.TextField() photo_exif = models.TextField() And then I have a form that the user will use to upload a photo. It requires an image file, and the description of the photo. class PhotoForm(forms.ModelForm): class Meta: model = Photo fields = ('photo_file', 'photo_description') It doesn't make sense to ask the user for photo_exif within the form, because it's something the server should automatically fill in when it receives the image file. When creating a Photo object from a form, I cannot simply use photo_object = form.save() since photo_exif is a required field. Instead, I have to set photo_exif before saving the object created from the form: photo_object = form.save(commit=False) photo_object.photo_exif = "..." photo_object.save() But doing it manually like this every time is a buggy process. Is there a way to make the form itself (or the perhaps the object itself) automatically fill in the photo_exif field from the photo file every time, so that I can just use photo_object = form.save()? -
Serving Static files on AWS Django application
I know that this isn't the first time the question has been asked, so I'm apologizing up front. I've been working on this for a few days and still have no clue how to proceed. I followed this tutorial to the tee: https://aws.amazon.com/getting-started/hands-on/deploy-python-application/ The website is up and running, but of course the static files won't load. Here's where I'm at. In settings.py, I've set my STATIC_ROOT and STATIC_URL to the following: STATIC_ROOT = os.path.join(BASE_DIR, 'mysite', 'static') STATIC_URL = '/static/' I ran collectstatic and gathered all my static files into the mysite app directory. It looks like this: -mysite - mysite (app) - static - base - base.css - settings.py - urls.py - wsgi.py Unfortunately, the static files still fail to load on the website. Here are my questions: Suppose I wanted to view the base.css text file on the web. Would I go to www.mysite.com/static/base/base.css? If no, what would the URL be? If yes, why is it not appearing given the current set up? Per the AWS tutorial, I ran edited the httpd-app.conf file to include the following Alias /mysite/static /opt/bitnami/apps/django/lib/python3.7/site-packages/Django-2.2.9-py3.7.egg/django/contrib/admin/static What was the purpose of the edit? How does it impact how the static files are served on … -
Django: Redirect logged in users from reset password page
I want to restrict access to reset_password page if the user is logged in and redirect it to home page! I try to use another a class like this but it s not working #views.py class MyPasswordResetView(UserPassesTestMixin, PasswordResetView): template_name = 'security/reset_password.html' def test_func(self): if self.request.user.is_authenticated: return redirect("home-page") return self.request.user.is_anonymous But its not working! #urls.py urlpatterns = [ path('register/', register_page, name = "register-page"), path('home/', home, name = "home-page"), path('logout/', logout_view, name = "logout"), path('login/', login_page, name = "login"), path('account/', account_view, name = "account"), path('change_password/', auth_views.PasswordChangeView.as_view(template_name = "security/change_password.html"), name = "password_change"), path('change_password/done/', auth_views.PasswordChangeDoneView.as_view(template_name = "security/change_password_succes.html"), name = "password_change_done"), path('reset_password/', MyPasswordResetView.as_view(subject_template_name = "security/password_reset_subject.txt", email_template_name = "security/password_reset_email.html", template_name = "security/reset_password.html"), name = "password_reset"), path('reset_password/done/', auth_views.PasswordResetDoneView.as_view(template_name = "security/password_reset_done.html"), name = "password_reset_done"), path('reset_password_din_mail_venita/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name = "security/ajunge_din_mail_aici.html"), name='password_reset_confirm'), path('reset_password/complete/', auth_views.PasswordResetCompleteView.as_view(template_name = "security/password_reset_complete.html"), name = "password_reset_complete"), ] -
Favicon Image not showing in base.html
I am trying to add an image in the favicon but it is not showing for some reason in the template base.html and it is showing only in another template only called: who_we_are.html I have also written its views.py below. I want it in the base to show in all pages I have written the models.py with function as following: class Setting(models.Model): title = models.CharField(max_length=60) favicon = models.ImageField( blank=True, upload_to='Marketing', verbose_name="Pages Icon") def __str__(self): return self.title def get_favicon(self): return "%s/%s" % (settings.MEDIA_URL, self.favicon) Here is the views.py def base(request): setting = Setting.objects.get() template = 'base.html' context = {'setting': setting} return render(request, template, context) def who_we_are(request): setting = Setting.objects.get() template = 'who_we_are.html' context = {'setting': setting} return render(request, template, context) here is the base.html <head> <link rel="icon" class="rounded-circle" href="{{ setting.get_favicon }}" type="image/jpg" sizes="16x16"> Thank you -
Django channels with azure web app and storage
I've been trying to setup a production enviornment with Azure web app and azure redis cache, for my django app. In my browser I get this error in the console: (index):157 WebSocket connection to 'wss://<mysite>.azurewebsites.net/ws/chat/hey/' failed: Error during WebSocket handshake: Unexpected response code: 404 in my settings.py I have the following: CHANNEL_LAYERS = { 'default': { 'BACKEND': 'channels_redis.core.RedisChannelLayer', 'CONFIG': { 'HOST': '<my_azure_redis>.redis.cache.windows.net', 'PORT': '6379', 'PASSWORD': '<mypassword>', 'SSL' : False, } } } javascript: const socket = new WebSocket( 'wss://' + window.location.host + '/ws/chat/' + 'hey' + '/' ); routing.py: websocket_urlpatterns = [ re_path(r'ws/chat/hey/', consumer.ChatConsumer), ] asgi.py import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_azure_demo.settings') application = get_asgi_application() This all works in development. I had followed https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-python-get-started to get started with redis. And I were able to set and retrieve a variable from my redis storage. I also opened for the 6379 port in azure cache for redis, to allow non SSL. I'm at a blank here, and not sure where to go next. Thanks for any input! -
a Href and buttons not responsive in header
I'm making a django project and after adding my header when I try adding a clickable button or link to it its unresponsive. I've pasted other buttons that i have on my site onto header and it seems something wrong is with my code for my header or i'm not adding something. My navbar works perfectly fine. https://codepen.io/Religion/pen/pojBzea CSS: .header-container{ width:100%; height:900px; border-left:none; border-right:none; position:relative; padding:20px; } .video-container{ position:absolute; top:0%; left:0%; height:100%; width:100%; overflow:hidden; } video{ position:absolute; z-index:-1; opacity:0.78; width:100%; } .head-section { z-index:1; text-align:center; margin-right:auto; margin-left:auto; margin-top:15%; width:700px; } .head-title { color:white; letter-spacing:3px; font-size:50px; font-family: "Josefin Sans", sans-serif; } .btn1 { border-radius: 50%; } .button { z-index:1; padding: 0.5em 10em; text-decoration: none; color: white; border: double 4px white; border-radius: 3px; transition: .4s; cursor:pointer; } .button:hover { background:white; opacity:50%; } .button { padding: 0.5em 10em; text-decoration: none; color: white; border: double 4px white; border-radius: 3px; transition: .4s; } HTML: <div class = "header-container"> <div class = "video-container"> <video preload = "true" autoplay = "autoplay" loop = "loop" muted = "muted" > <source src="https://d9nqqwcssctr8.cloudfront.net/wp-content/uploads/2020/03/26054225/VS20-DotCom-Header.mp4.mp4" type="video/mp4"/> <source src="https://d9nqqwcssctr8.cloudfront.net/wp-content/uploads/2020/03/26054238/VS20-DotCom-Header.webmhd.webm" type="video/webm"/> </video> </div> <div class = "head-section"> <h2 class = "head-title">Ejad worship</h2> <a href="#" class="button btn1">Get to Know us better!</a> </div> </div> -
Django Wagtail Display children from parent inside another template page
I have a model that looks like this class StoryLinePage(ContentPage): body = StreamField([ ('related_reports', blocks.PageChooserBlock( 'content.ReportPage', icon='form', template='content/blocks/report_block.html') ), ], blank=True) In that model I can render related reports with HTML, I would like to render related_reports but from the ReportPage model class ReportPage(ContentPage): body = StreamField([ ('heading', blocks.CharBlock(classname="full title")), ('paragraph', blocks.RichTextBlock()), ('image', ImageChooserBlock()), ('dashboard', blocks.PageChooserBlock( 'content.DashboardPage', icon='code', template='content/blocks/dashboard_block.html') ), ('table', TableBlock()), ], blank=True) search_fields = ContentPage.search_fields + [ index.SearchField('body'), ] content_panels = ContentPage.content_panels + [ StreamFieldPanel('body', classname="full"), HelpPanel("", classname="edit-spacer"), ] In report_page.html I have access to StoryLinePage through django template tags {% if page.related_storyline.all%} {% for story in page.related_storyline.all %} <div id='storylines'> <h4 class='storyline-header'>{{story.page.specific.title}}</h4> </div> {% endfor %} {% endif %} I am trying to access related_reports within ReportPage but not sure where I am going wrong {% if page.related_storyline.all%} {% for story in page.related_storyline.all %} <div id='storylines'> <h4 class='storyline-header'>{{story.page.specific.title}}</h4> <div class="header-bar"></div> {% if page.related_storyline.related_reports.all%} {% for report in page.related_storyline.related_reports %} <a href={% pageurl story.page %} class="report-block-container"> <div class="report-block-text"> <p> {{report.page.specific.title}}</p> </div> </a> {% endfor %} {% endif %} </div> {% endfor %} {% endif %} </div> At the moment, all that is rendering is the storyline.page.title, would appreciate any help Thanks -
Django permission and authorization
I am working on Django project and I want to make model-based permission, my question is if I have an app named order, the default permissions are add_order,change_order,delete_order and view_order, so are those permission exists only for the admin side? I mean if try to delete a model object from order app in my view, not in the admin, what will happen, and if so I want to know if it will cause any errors? thanks -
Why function-based views and class-based views?
I'm a beginner to web development in django, and I'm wondering why views needed to be rendered with functions and classes? Can't the urls module just link the url to the HTML template directly rather than indirectly through a function-based view? -
Modifying django-taggit contents and deploying changes to to heroku
I'm using django-taggit in my site covigapyears.com to help match students to people on a gap year, but am experiencing this problem: that the package has an issue where calling .similar_objects in some contexts leads to a Django KeyError. I looked at some dirty fixes other people used to get it working, and implemented one, and it worked. The problem is that it involved modifying Library/frameworks...taggit/managers.py locally to get it to work locally, and the site is deployed on Heroku, with a remote Postgres DB. I'm not sure how to change the local version of a file that is part of the django-taggit package code to get the .similar_objects functionality working on the live server. Seems like an incredible amount of pain to go through for a common function in a common package that, really, should just work. Please help!