Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Display a picture via Django saved on mysql database
I want to display a picture with Django, which is already saved on a mysql database. In all Methods I found people used models.Imagefield(upload_to='path'), but I think this will save the file into this directory and people from other computers won´t have access later. So the question is, how do I access the database directly and display the picture without saving it in between? I already managed to do this in python, but I am not quite sure how to implement the code into the models.py. Something like this was my approach : class mysqlpicture(models.Model): #mysqlpic=something? def openpic(): connection = pymysql.connect(user='root', passwd='***', host='localhost', database='db') cursor = connection.cursor() sql1='select * from Pictures' cursor.execute(sql1) data=cursor.fetchall() mysqlpic=io.BytesIO(data[1][0])#one means second element of column zero #img=Image.open(mysqlpic) #img.show() cursor.close() return mysqlpic and then I tried in the views.py to give mysqlpicdirectly to the httpresponse like this: def MysqlView(request): query_results = mysqlpicture.objects.all() template = loader.get_template('polls/pic.html') context = { 'query_results': query_results, } return HttpResponse(template.render(context, request)) using a template pic.htmlto insert a picture like: {% for n in query_results %} <mysqlpic src="{{ n.mysqlpic.url }}" /> {% endfor %} Has someone an idea how to to this in the right way? -
Access date_subscribed from a many to many field on a for loop template Django
I have these models, class Place(models.Model): name = models.CharField(max_length=200) user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='places', default=1) subscribers = models.ManyToManyField(AppUser, through='PlaceSubscriber') def __str__(self): # __unicode__ on Python return self.name class PlaceSubscriber(models.Model): place = models.ForeignKey(Place, on_delete=models.CASCADE) user = models.ForeignKey(AppUser, on_delete=models.CASCADE) date_subscribed = models.DateTimeField(editable=False, default=timezone.now) class Meta: unique_together = ('place', 'user') I want to access the date_subscribed fields on this for loop inside my template {% for o in place.subscribers.all %} <a href="#" class="list-group-item clearfix"> <span class="pull-left"> {{ forloop.counter }}. &emsp; </span> <span class="pull-left"> <strong>{{ o.full_name }}</strong> <p>Email: <i>{{ o.email }}</i> | Date Subscribed: <i> {{ o.place__placesubscriber__date_subscribed }} </i> </p> </span> <span class="pull-right"> <span class="btn btn-xs btn-primary" onclick="sendPushNotificationToUser('{{ o.ionic_id }}'); return false;">Send Message</span> <span class="btn btn-xs btn-danger" onclick="deletePlaceUser({{ place.id }}, {{ o.id }}); return false; "> Unsubscribe </span> </button> </span> </a> {% endfor %} I can access the date_subscribed field outside this foorloop like this: {% for each in place.placesubscriber_set.all %} {{ each.date_subscribed }} {% endfor %} But haven´t figure out how to it access inside the other one. -
Trying to build quiz format in Django, questions are listing properly but not able to get the options listed
Hi i am quite new to django and python was trying to build some quiz pattern i am not able to map options to questions and list them. models.py from __future__ import unicode_literals from django.db import models # Create your models here. class Date_list(models.Model): date_gk = models.CharField(max_length=20) CA_BGimage = models.CharField(max_length=20) def __str__(self): return 'Daily Current Affair and GK quiz: ' + self.date_gk class Questions(models.Model): date_list = models.ForeignKey(Date_list, on_delete=models.CASCADE, default=None) question = models.CharField(max_length=500) def __str__(self): return self.question class Options(models.Model): questions = models.ForeignKey(Questions, on_delete=models.CASCADE, default=None) option = models.CharField(max_length=50) correct_answer =models.CharField(max_length=100) def __str__(self): return self.option **views.py** from django.shortcuts import render from django.http import HttpResponse from .models import Date_list, Questions from django.template import loader from django.shortcuts import render, get_object_or_404 # Create your views here. def index(request): all_dates = Date_list.objects.all() context = {'all_dates': all_dates,} return render(request, 'Current_Affair/index.html', context) def detail(request, date_list_id, questions_id): date_list = get_object_or_404(Date_list, pk=date_list_id) questions = get_object_or_404(Questions, pk=questions_id) return render(request, 'Current_Affair/detail.html', {'date_list':date_list}, {'questions':questions}) **urls.py** from django.conf.urls import url from . import views app_name = 'Current_Affair' urlpatterns = [ #Current_Affair url(r'^$', views.index, name='index'), #/Current_Affair/32 url(r'^(?P<date_list_id>[0-9]+)/$', views.detail, name='detail'), ] **index.html** <!-- Loads the path to your static files --> {% load staticfiles %} <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/> <link rel="stylesheet" type="text/css" href="{% static 'Current_Affair/style.css' %}" /> <h1> … -
Django with MongoDB can't get django admin panel?
Is it true that it's a bad choice python with non-relational database like MongoDB ? I heard if i use mongoDB as my database in my djanog project i can't use default admin panel of django in my projects as it's designed with Relational database m ethology ? -
Djando with django smart selects plugin
I have integrated the smart selects plugin to my project and it works fine. How I can change the dropdown list for all the chained fields to a radio select button or a select box. I tried with the usual django way but it didn't work. Is there any way to make it as radio select? Thank you. -
Django, Django Dynamic Scraper, Djcelery and Scrapyd - Not Sending Tasks in Production
I'm using Django Dynamic Scraper to build a basic web scraper. I have it 99% of the way finished. It works perfectly in development alongside Celery and Scrapyd. Tasks are sent and fulfilled perfectly. As for production I'm pretty sure I have things set up correctly: I'm using Supervisor to run Scrapyd and Celery on my VPS. They are both pointing at the correct virtualenv installations etc... Here's how I know they're both set up fine for the project: When I SSH into my server and use the manage.py shell to execute a celery task, it returns an Async task which is then executed. The results appear in the database and both my scrapyd and celery log show the tasks being processed. The issue is that my scheduled tasks are not being fired automatically - despite working perfectly find in development. # django-celery settings import djcelery djcelery.setup_loader() BROKER_URL = 'django://' CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler' I have followed the docs as close as I could and used the recommended tools for deployment (eg. scrapyd-deploy etc...). Additionally, when I run celery and scrapyd manually on the server (as one would in development) things work fine. It's just when the two are run using … -
How to join 2 tables in django
I have 2 models which i wanna join class CollectionBook(models.Model): collection = models.ForeignKey('Collection') book = models.ForeignKey('Book') class Meta: unique_together = (('collection', 'book')) class Book(models.Model): main_author = models.ForeignKey('Author', verbose_name=u'Главный автор') publisher = models.ForeignKey('Publisher', verbose_name=u'Издатель') title = models.CharField(unique=False, max_length=255, verbose_name=u'Название') text = models.TextField(verbose_name=u'Текст книги', max_length=523000) I tried to do it this way book = Book.objects.extra( select = {'id':'mainapp_collectionbook.book_id'}) book.query.join((None,'mainapp_collectionbook',None,None)) connection = ( Book._meta.db_table, CollectionBook.book.field, ) book.query.join(connection, promote=True) But it didn't work out and gave me error Could you offer me another pythonic solutions of this problem or improve my way of doing it, I don't wanna write sql query, I hope that there are better django orm functions for this -
Django admin sort on custom function
I suppose it's trivial - how to sort a column in Django admin by some simple custom method? (All the answers I got through was by using annotateing but I don't know how to use it my case). Say I have a model class Shots(models.Model): hits = models.PositiveIntegerField() all = models.PositiveIntegerField() In admin site I would like to sort by hits to all ratio: class ShotAdmin(admin.ModelAdmin): list_display = ['ratio'] def ratio(self, obj): return obj.hits / obj.all * 100 I know the ratio is not a field in DB thus simple ratio.admin_order_field = 'ratio' won't work and I need to somehow append this as a field but I have no idea how. -
NoReverseMatch at /colorsets/new/ Reverse for 'user_logout' not found. 'user_logout' is not a valid view function or pattern name
I'm getting this error when trying to click on the "New Color Set" button: NoReverseMatch at /colorsets/new/ Reverse for 'user_logout' not found. 'user_logout' is not a valid view function or pattern name. I've looked extensively through StackOverflow and elsewhere on other sites and can't seem to find what the issue is. As far a I can tell all my code is right but clearly there is an issue. base.html <!DOCTYPE html> <html lang="en"> <head> <title>Colors</title> <meta name"viewport" content="width=device-width, initial-scale=1"> <meta charset="uft-8"> <link rel="shortcut icon" href="/images/favicon.ico"> <link rel="stylesheet" href="/style.css"> </head> <body> <nav> <div class="container"> <a class="btn" href="{% url 'index' %}">Home</a> {% if user.is_authenticated %} <a class="btn" href="{% url 'colorsets:new_color' %}">New Color Set</a> <a class="btn" href="{% url 'accounts:user_logout' %}">Logout</a> {% else %} <a class="btn" href="{% url 'accounts:user_login' %}">Login</a> <a class="btn" href="{% url 'accounts:register' %}">Register</a> {% endif %} </div> </nav> <div class="container"> {% block content %} {% endblock %} </div> </body> </html> Views.py from django.shortcuts import render from colorsets.forms import ColorForm from colorsets.models import ColorSet from django.contrib.auth import authenticate,login,logout from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import (TemplateView,ListView, DetailView,CreateView, UpdateView,DeleteView) # Create your views here. def index(request): return render(request,'index.html') class CreateColorSetView(LoginRequiredMixin,CreateView): … -
setting up Django app to work on google app engine GAE (app.yaml & main.py)
I have a working Django app that I was able to get functioning on Heroku. The structure is project named 'untitled' and an app named 'web' such that the structure is: project_root static templates untitled --->init.py --->settings.py --->urls.py --->wsgi.py web --->init.py --->admin.py --->apps.py --->models.py --->tests.py --->urls.py --->views.py This is a fairly basic app that I can get working outside of GAE (local and on Heroku), however, I'm getting stuck on the app.yaml and main.py requirements for GAE. My app.yaml is: application: seismic-interpretation-institute-py27 version: 1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /.* script: main.app libraries: - name: django version: "latest" and my main.py (generated from PyCharm) is import os,sys import django.core.handlers.wsgi import django.core.signals import django.db import django.dispatch.dispatcher # Google App Engine imports. from google.appengine.ext.webapp import util # Force Django to reload its settings. from django.conf import settings settings._target = None os.environ['DJANGO_SETTINGS_MODULE'] = 'untitled.settings' # Unregister the rollback event handler. django.dispatch.dispatcher.disconnect( django.db._rollback_on_exception, django.core.signals.got_request_exception) def main(): # Create a Django application for WSGI. application = django.core.handlers.wsgi.WSGIHandler() # Run the WSGI CGI handler with that application. util.run_wsgi_app(application) if __name__ == '__main__': main() Finally, the output that is reported when running locally is It seems that the error, ImportError: Settings cannot be … -
Django migration issue.
I created a django application so along the line I wanted to reset the entire database so I deleted the database and deleted all migration files. it is not the first time I have done such which I assume is not a bad way of doing it. so I ran the command like python manage.py makemigrations and I got this error in my terminal django.db.migrations.exceptions.NodeNotFoundError: Migration auth.0009_user_following dependencies reference nonexistent parent node (u'profiles', u'0001_initial') I am totally confused and I dont have any idea on what to do next. HELP -
How can I get rid of legacy tasks still in the Celery / RabbitMQ queue?
I am running Django + Celery + RabbitMQ. After modifying some task names I started getting "unregistered task" KeyErrors, even after removing tasks with this key from the Periodic tasks table in Django Celery Beat and restarting the Celery worker. They persist even after running with the --purge option. How can I get rid of them? -
Second aldryn-newsblog instance use different categories
I have created a second aldryn-NewsBlog App (as described in the documentation) and attached it to a page. Both App-instances use the same aldryn-categories data. Is there a way to split them up. So they don't use the same categories? To have independent categories for both blog instances. -
model method added to fieldsets throws FieldError
I have added a model method that successfully displays the images in admin, but only in list_display, if I add it to a fieldsets with the goal of also make it display when editing or adding. It throws an error. Exception Value: Unknown field(s) (thumbnail) specified for Image. Check fields/fieldsets/exclude attributes of class ImageAdmin. I'm sure that I am doing something "illegal". Or trying to do something that doesn't make sense. Because if I go and add an image that doesn't exist yet, it can't show the image either. I am clearly missing how this all tie together. Can someone explain? Thank you In my models.py from django.utils.html import format_html class Image(models.Model): image = models.ImageField(blank=True, upload_to=_image_upload) def thumbnail(self): return format_html( '<img src="{}" width="auto" height="250">'.format(self.image.url) ) admin.py @admin.register(Image) class ImageAdmin(admin.ModelAdmin): fieldsets = ( ('Edit or upload image', { 'fields': ('thumbnail','...',) #throws a FieldError }), ) list_display = ('thumbnail', '...') #works -
Python - Inherit from class which inherit Model
Here is my problem: I try to create layer under models.Model My Model - class MainModel(models.Model): @staticmethod def getIf(condition): results = __class__.objects.filter(condition) if results.count() > 0: return results.first() else: return None And that's a model class User(MainModel): id = models.AutoField(primary_key=True) name = models.CharField(max_length=256) date_create = models.DateTimeField(auto_now_add=True) date_last_login = models.DateTimeField(null=True) But my project is crushed with error - django.core.exceptions.FieldError: Local field 'id' in class 'User' clashes with field of the same name from base class 'MainModel'. What am I doing wrong? -
get the username from user ID in django models
My models.py is as below, id = models.AutoField(primary_key=True) user = AutoOneToOneField(User, primary_key=False,default=1) member_name = models.CharField(max_length=25, blank=False, default='') ph_no = models.CharField(max_length=25, blank=False, default='') My views.py for GET & POST request is below, Class MemberList(generics.ListAPIView): queryset = members.objects.all() serializer_class = MemberSerializer permission_classes = (permissions.IsAuthenticatedOrReadOnly,) class MemberCreate(generics.CreateAPIView): queryset = members.objects.all() serializer_class = MemberSerializer permission_classes = (permissions.IsAdminUser,) Now while creating a Data POST request works fine and I am providing user value as "1 or 2 or 3 etc" depending upon django default User module and these users are already created. Now when I do GET request , it returns me again only the number 1 or 2 etc of user ID. Is there any way I can use some method to override and get the username instead of user ID in my GET request -
Django ModelChoiceField model formset creating form for every object
I am trying to setup a model formset with a ModelChoiceField so that the user can create several forms and in each form they select one item from the queryset. However, when I render my formset, it is creating a form for each object in the queryset. This is not desirable, I only want one form and I will create them dynamically with JS. Basically I am nesting the applications formset inside of the rulerequest form. class ApplicationForm(BootstrapMixin, forms.ModelForm): name = forms.ModelChoiceField( queryset=Application.objects.all(), to_field_name='name', help_text='Application name', error_messages={ 'invalid_choice': 'Application not found.', } ) class Meta: model = Application fields = [ 'name' ] help_texts = { 'name': "Application name", } class RuleRequestForm(BootstrapMixin, forms.ModelForm): class Meta: model = RuleRequest fields = [ 'name', 'description', ] help_texts = { 'name': 'Short name for the request', 'description': "Buisness case and summary.", } def __init__(self, *args, **kwargs): super(RuleRequestForm, self).__init__(*args, **kwargs) data = kwargs.get('data') initial = kwargs.get('initial') application_formset = modelformset_factory(Application, form=ApplicationForm, extra=0, min_num=1) self.applications = application_formset(data=data, initial=initial, prefix='applications') -
How use gettext in JS code correctly?
In my Django project I have JS file with text with I need to translate. I use next code below. With the help of makemessages and compilemessages commands I created djangojs.po and djangojs.mo files. The problem is JS code dont work correctly after adding gettext. It raise error in browser console. How to fix this problem? urls.py: from django.views.i18n import javascript_catalog js_info_dict = { 'domain': 'djangojs', 'packages': ('slider',), # my app name } urlpatterns = [ [OTHER URLs] # Internationalization in Javascript Code url(r'^jsi18n/$', javascript_catalog, js_info_dict, name='javascript-catalog'), ] JS: $("#slideModalBox").on("click", "#imageFieldClearBtn", function() { $('#imageFieldFileName').val(""); $('#imageFieldClearBtn').hide(); $('#imageFieldInput input:file').val(""); $("#imageFieldInputTitle").text(gettext("Add new image");); }); $("#slideModalBox").on("change", "#imageFieldInput input:file", function() { var file = this.files[0]; var reader = new FileReader(); reader.onload = function (e) { $("#imageFieldInputTitle").text(gettext("Change Image")); <-- This place raise error $("#imageFieldClearBtn").show(); $("#imageFieldFileName").val(file.name); } reader.readAsDataURL(file); }); ERROR in browser console: ReferenceError: gettext is not defined reader.onload http://127.0.0.1:8000/static/js/slider/image_field.js:12:9 -
How can you pull HATEOAS API with Python?
I need to pull data from API with pagination. I have sent them a support email but no reply just yet. Here is the answer from their first email to me. The API has “pagination” implemented where results are segmented into blocks of 20 per response. In order to navigate through the pages HATEOAS links are provided in the “Link” header. These headers display the full endpoints required to go to the pages you want. If there are more pages of the result, header will contain custom String field - Link, which will contain URLs where other pages of the results can be reached. If there are more pages of the result, header will contain custom String field - Link, which will contain URLs where other pages of the results can be reached. For example: Link: <https://api.com:123/public/cook> ; rel="first", < https://api.com:123/public/cook?page=10> rel="last", < https://api.com:123/public/cook?page=3> rel="next", < https://api.com:123/public/cook?page=1> rel="prev" Searching through "hateoas python" with Google only comes with how to create it and not how to pull the data. So, how can I get the link from the header from this HATEOAS API? I am using the Python 3 with latest stable Django. -
BootstrapError at /polls/1/vote
I am making a web site by seeing Django tutorial.But BootstrapError at /polls/1/vote Parameter "form" should contain a valid Django Form. error happens. Traceback is Traceback: File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/utils/datastructures.py" in __getitem__ 83. list_ = super(MultiValueDict, self).__getitem__(key) During handling of the above exception ('choice'), another exception occurred: File "/Users/XXX/djangostudy/polls/views.py" in vote 26. selected_choice = question.choice_set.get(pk=request.POST['choice']) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/utils/datastructures.py" in __getitem__ 85. raise MultiValueDictKeyError(repr(key)) During handling of the above exception ("'choice'"), another exception occurred: File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Users/XXX/djangostudy/polls/views.py" in vote 30. 'error_message':"You didn't select a choice", File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/shortcuts.py" in render 30. content = loader.render_to_string(template_name, context, request, using=using) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/loader.py" in render_to_string 68. return template.render(context, request) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/backends/django.py" in render 66. return self.template.render(context) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/base.py" in render 207. return self._render(context) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/base.py" in _render 199. return self.nodelist.render(context) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/base.py" in render 990. bit = node.render_annotated(context) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/base.py" in render_annotated 957. return self.render(context) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/loader_tags.py" in render 177. return compiled_parent._render(context) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/base.py" in _render 199. return self.nodelist.render(context) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/base.py" in render 990. bit = node.render_annotated(context) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/base.py" in render_annotated 957. return self.render(context) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/loader_tags.py" in render 177. return compiled_parent._render(context) File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/template/base.py" … -
issues with ckeditor in django
when i upload image via ckeditor get this Eroor File "/home/cena/AjiiMajii/.venv/local/lib/python2.7/site-packages/ckeditor_uploader/views.py", line 105, in _save_file filename = get_upload_filename(uploaded_file.name, request.user) File "/home/cena/AjiiMajii/.venv/local/lib/python2.7/site-packages/ckeditor_uploader/views.py", line 28, in get_upload_filename user_prop = getattr(user, RESTRICT_BY_USER) -
django template don't refresh with context
I would like to get data from context in django views.py to template without refresh page. I tried this index.html: <form action="{% url 'smart:index' %}" method="post" onsubmit="return showDiv();"> {% csrf_token %} <h1 class="para">Most recent</h1> <label class="switch"> <input type="submit" name="recent_users" id="rc_users"> <span class="slider round" id="rc"></span> </label> </form> <script> function showDiv() { document.getElementById('welcomeDiv').style.display = "block"; return false; } </script> and this is the views.py: def index(request): if request.method == 'POST' and 'recent_users' in request.POST: print("ok") context['recent_users'] = recent_users() return render(request, 'smart/home/home.html', context) and the div to show after submit button: <div id="welcomeDiv" style="display:none;" class="box box-danger"> {% for user in recent_users %} <script> alert(user); </script> </div> the problem is that the alert msg does'nt work, is any one can help, thanks in advance. -
Update Hiera by Python web service
I currently have a setup of a puppet master and 2 agents. The requirement is to be able to deploy a simple web-app on the tomcats of both the agents, as and when required, based on request received from a REST web service. Following are the steps: User invokes REST service on Orchestration Layer with information like web-app path, nexus path etc. Request comes to the Python based Orchestration Layer. Orchestration Layer updates Hiera with the information passed in Step 1. The web-app gets deployed on the agents. Now I have certain questions: Does this architecture looks feasible or is something has been missed ? Which Python web framework would be best suited for the Orchestration Layer - Django, Flask, web.py or something else ? Please advise. -
bulk create using ListSerializer of Django Rest Framework
Iam trying to bulk create rows for a certain table using Django Rest Framework. I see in the documentation that DRF supports it. views.py class UserProfileFeedViewSet(viewsets.ModelViewSet): """Handles creating, reading and updating profile feed items.""" authentication_classes = (TokenAuthentication,) queryset = models.ProfileFeedItem.objects.all() serializer_class = serializers.ProfileFeedItemSerializer(queryset, many=True) permission_classes = (permissions.PostOwnStatus, IsAuthenticated) def perform_create(self, serializer): """Sets the user profile to the logged in user.""" serializer.save(user_profile=self.request.user) serializers.py class ProfileFeedItemListSerializer(serializers.ListSerializer): def create(self,validated_data): feed_list = [ProfileFeedItem(**item) for item in validated_data] return ProfileFeedItem.objects.bulk_create(feed_list) class ProfileFeedItemSerializer(serializers.Serializer): """A serializer for profile feed items.""" class Meta: model = models.ProfileFeedItem list_serializer_class = ProfileFeedItemListSerializer fields = ('id', 'user_profile', 'status_text', 'created_on') extra_kwargs = {'user_profile': {'read_only': True}} When i try posting using admin form i always get this error. Can you please help me identify what am i doing wrong here ? TypeError at /api/feed/ 'ProfileFeedItemListSerializer' object is not callable Request Method: GET Request URL: http://127.0.0.1:8080/api/feed/ Django Version: 1.11 Exception Type: TypeError Exception Value: 'ProfileFeedItemListSerializer' object is not callable Exception Location: /home/ubuntu/.virtualenvs/profiles_api/local/lib/python3.5/site-packages/rest_framework/generics.py in get_serializer, line 111 Python Executable: /home/ubuntu/.virtualenvs/profiles_api/bin/python Python Version: 3.5.2 -
How can I get the .so file from .whl?
I want to release the Django website. and I only find the bellow link to download the .whl file: http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi But how can I get the mod_wsgi.so file from the .whl file? Because some tips says the .whl contains it, the .whl file can not unZip, alright?