Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Ajax call to View doesn't work on button click
I am new to Django and Ajax and therefore my knowledge is limited. Excuse me if I have done something blunder. In Django Html template if the button is clicked, then an ajax call is sent to the view with parameters filename(from the div filename) and the count(value retrieved from textbox). In the increment_page view, the pdf with filename content is extracted into a list "result" using pypdf and the count value is incremented. Return the result list value at the count(index) to display it in the div "textdisplay" in the webpage. The Ajax call to the view is not made on button click The Jquery Ajax call <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"> </script> <script> $(document).ready(function() { $('#other').click(function() { var filename = $("#filename").val(); var count = $("#count").val(); $.ajax({ type: 'POST', url: '/increment_page/', data: {'name':filename,'count':count}, dataType: json, success: function(data) { $('#textdisplay').html(data.result); } }); }); }); code here in Views.py def increment_page(request): #If the AJAX request if request.is_ajax() and request.POST: try: #Get the filename name = request.POST['name'] pdf = pyPdf.PdfFileReader(open(name, "rb")) result=[] #Extract the file contents for page in pdf.pages: result.append(page.extractText()) result = [x for x in result if x != ''] #Get the count count = request.POST['count'] #Increment the count count=count+1 #Get the list … -
django - How to change existing code to ModelForm instance
New to Django and this is my first web application. I'm having trouble with django's ModelForm feature and I wanted to know: How do I modify my code so that I can create an instance of ModelForm, and specifically, how can I extract the form data to upload to the backend? I will need to reference this instance at a later time to re-populate the same data in an update_profile view but the updation can only happen once the user is logged in (after signup and profile creation). For the editing section, do I use pk=some_record.pk? Very confused, any help is appreciated. Here is a snippet of views.py: def create_profile(request): if request.POST: address = request.POST['address'] date_of_birth = request.POST['date_of_birth'] company = request.POST['company'] home_phone = request.POST['home_phone'] work_phone = request.POST['work_phone'] custprofdata = CustomerDetail(address = address, date_of_birth = date_of_birth, company = company, home_phone = home_phone, work_phone = work_phone) custprofdata.save() output = {'address': address, 'dateofbirth': date_of_birth, 'company': company, 'homephone': home_phone, 'workphone': work_phone} return render(request, 'newuser/profile_created.html', output) else: return redirect(create_profile) And here is a snippet of the form part of the respective create_profile.html: <form action = "{% url 'create_profile' %}" class="create_profile" role="form" method = "post"> {% csrf_token %} <div class="form-group"> <label for="address" class="col-md-3 control-label">Address</label> <div class="col-md-9"> … -
django 1.10 media images don't show
I have had django media images working in an existing django 1.7 project by adding the following to site urls.py: urlpatterns = patters( url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), ) This url structure doesn't work in django 1.10 and so I changed it to the reccommended here Django MEDIA_URL and MEDIA_ROOT: urlpatterns = [ ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) This fails to render any uploaded media images. Is there an equivalent media url patter for django 1.10 I can use? -
AngularJS Routing not working properly with Django
I know there are a ton of questions regarding AngularJS routing and trust me I've read through them all.. My issue is a weird one. Basically the routing works for one route, but none of the others.. and with the route that works I get a strange error regarding the controller that I don't know how to solve: So the routing works for the Settings button, but when I press the English button the view does not load. And what's even weirder is if i remove the controller from the settings view, then the settings page doesn't load either.. Here's the relevant code: Index.html <!DOCTYPE html> <html> <head> <title>CRS Client Portal</title> <base href="/" /> <!-- The HTML5 Shim is required for older browsers, mainly older versions IE --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!--[if lt IE 7]> <div style=' clear: both; text-align:center; position: relative;'> <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie6_countdown_bannercode"><img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" alt="" /></a> </div> <![endif]--> {% include 'stylesheets.html' %} <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> </head> <body ng-app="crsportal"> {% if user.is_authenticated %} <div class="container-fluid user-profile"> {% include 'userprofile.html' %} </div> {% else %} <div class="container-fluid" ng-controller="LoginController as vm"> {% include 'login.html' %} </div> {% endif … -
Django-Haystack returns no results
I using Haystack with elasticsearch backend. When I do a query I get no results. What else can I try? I'm really stuck. Any help appreciated! :) Here's my code view.py class ActressSearchView(SearchView): template = 'search/search.html' form_class = SearchForm def get_queryset(self): queryset = super(ActressSearchView, self).get_queryset() q = queryset.order_by('name','release_date') return q def get_context_data(self, *args, **kwargs): context = super(ActressSearchView, self).get_context_data(*args, **kwargs) return context url.py url(r'^search/?$', ActressSearchView.as_view(), name='search'), -
add username to url in django
I 've been trying to add the URLs of the system with the user name as a parameter in them, but it did not work for me , I've seen some reviews here and it did not work me the way as they have done or solved their problem . views.py @login_required def profile(request, username): User = get_object_or_404(user, username=username) return render(request, 'dashboard/Profile.html', {'profile': User}) urls.py url(r'^profile/(?P<username>\w+)/$', views.profile, name='profile'), if need, here is my forms.py class RegistrationForm(forms.Form): username = forms.RegexField(regex=r'^\w+$', widget=forms.TextInput(attrs= {'class': 'form-control'}), label=_("Username"), error_messages={'invalid': _("This value must be contain only letters, number and undescores.!")}) email = forms.EmailField(widget=forms.TextInput(attrs={'class': 'form-control'}), label=_("Email Address")) password1 = forms.CharField(widget=forms.PasswordInput(attrs={'class': 'form-control'}), label=_("Type your password")) password2 = forms.CharField(widget=forms.PasswordInput(attrs={'class': 'form-control'}), label=_("Retype your password")) This is the error that the system shows me I tried with these posts and it does not work -
Django Internationalization (I18N) not changing text
I created an simple website to test internationalization, but I can't make it work the way I wanted. I would like to change messages in my views.py without checking the request.LANGUAGE_CODE (which is showing correctly). I can go to the urls with prefix /en/ and /pt-br/ but they don't change the text in the template. I tried running django-admin makemessages --locale=pt_BR I changed the lines #: mytest/views.py:7 msgid "Welcome to my site." msgstr "Bem vindo ao meu site." ran django-admin compilemessages --locale=pt_BR PS: (even though it is wrong, I tried django-admin makemessages/compilemessages --locale=pt-br as well) What I changed in settings.py (added my app, added locale middleware, added some internalization settings) INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'mytest' ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] # Internationalization # https://docs.djangoproject.com/en/1.10/topics/i18n/ LOCALE_PATHS = [ os.path.join(BASE_DIR, 'locale/translations/'), ] LANGUAGE_CODE = 'en-us' from django.utils.translation import ugettext_lazy as _ LANGUAGES = [ ('pt-br', _('Portuguese')), ('en', _('English')), ] TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True views.py from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ def index(request): print(request.LANGUAGE_CODE) #this shows correctly the prefix in the url output = _("Welcome to my site.") … -
Django password in PHP
I have a problem, because I have a database with users and theirs passwords were secured with Django (pbkdf2). So '123' looks like this: pbkdf2_sha256$20000$MflWfLXbejfO$tNrjk42YE9ZXkg7IvXY5fikbC+H52Ipd2mf7m0azttk= Now I need to use this passwords in PHP project and I don't have any idea how to compare them. Thanks for help! -
Moving celery to a remote, dedicated machine for a Django project
I run asynchronous tasks via celery for a social networking Django web application of mine. In my current setup, celery workers and celerybeat are run on the web application server, whereas a postgresql DB resides on a separate server. Asynchronous tasks ought not impede/slowdown user experience, thus I've decided to move them to their own dedicated machine (they've now become quite voluminous). My question is regarding how to achieve the aforementioned architecture. The asynchronous workers are manipulating tables and rows in the DB. 1) How would I call my asynch workers in a remote location, 2) How would I route their results to effect the required changes in the DB? Would love to know the most efficient way to achieve this, and an illustrative example would be nice. Thanks in advance. -
django rest framework can't get field name
Struggling to get field name in serializer class: from myapp.models import Image class ImageSerializer(serializers.ModelSerializer): class Meta: model = Image fields = ('image__image__url', ) my model: class Image(models.Model): name = models.CharField(max_length=128, null=True, blank=True) image = FilerImageField() In browser I get error: Field name image__image__url is not valid for model Image. Although if I try in shell: >>> from myapp.models import Image >>> img = Image.objects.get(pk=1) >>> img.image.url '/media/filer_public/37/05/37054d47-2e23-4d05-80b5-a3183f10ea38/screenshot_from_2016-03-24_115543.png' What might be the problem? -
how to create a refrence link for multi-level marketing website in django
i am creating a multi-level marketing website in which user a parent and childs like a tree. and each user have a refrence link which they share with others to build their network . refrence link will redirect them to registration and add the new user to child field of user whose refrence link is used to register the new user.and this refrence link must be unique for all users. i want to create that refrence link that can be used by new users to register. i have created models.py: from django.db import models from django.conf import settings def upload_location(instance, filename): return "%s/%s" %(instance.id, filename) class profile(models.Model): username = models.OneToOneField(settings.AUTH_USER_MODEL, default=1) name = models.CharField(max_length=120) dob = models.DateField(auto_now=False, auto_now_add=False) image = models.ImageField(upload_to=upload_location, null=True, blank=True, width_field="width_field", height_field="height_field") height_field = models.IntegerField(default=0) width_field = models.IntegerField(default=0) contact = models.BigIntegerField() parent = models.OneToOneField( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='parent', default = 1, ) child = models.ManyToManyField(settings.AUTH_USER_MODEL, default=1, related_name='child') refrence_link = models.URLField(max_length=200, null=True) def __unicode__(self): return self.name def __str__(self): return self.name i have no idea how to create this refrence link. urls.py: from django.conf.urls import url, include from django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^accounts/', include('registration.backends.default.urls')), ] i am using django-registration-redux for registration. -
What is the proper way of testing throttling in DRF?
What is the proper way of testing throttling in DRF? I coulnd't find out any answer to this question on the net. I want to have separate tests for each endpoint since each one has custom requests limits (ScopedRateThrottle). The important thing is that it can't affect other tests - they have to somehow run without throttling and limiting. -
How to store lots of scores
So I want to store out of 10 scores to one decimal place for around 25+ objects. So around 2500 fields. I wan't to count how many people have chose each score so for example: Object 1 0.0 : 53 0.1 : 49 0.2 : 394 ... 9.8 : 483 9.9 : 283 10.0 : 700 I could put 100 fields in each models but that seems like a bad way to do it. I also want to be able to get to the data easily to do things such as graph it. So what would you say would be the best way to go about this? Thanks, Ed. -
How to move a python application to another folder in server without damaging it?
I am running the celery flower application (https://github.com/mher/flower) in my server. I installed this application in my Python LAMP server using the following command: pip install flower Now I want to do some modifications in the application such as functionality and layout. I want to do it by placing a copy of the application files in my /var/www/html public folder where all of my other applications are placed so as not to disturb the original application and not having to go into the system files like ../lib/......./dist/flower. I have been developing applications in django previously and and in django, we can just put a copy of application files in our root applications folder and do modifications in it and the system reads the new copy of the files instead of original installation (pretty clean and clear method). I was hoping to have something like this for this application also? Any suggestions? -
Cannot fetch choices for multiple select from in django
I've got a problems with fetching choices for multiple select form. I'm trying to get choices from couchdb. It's successfully printed out into console it: [[u'c6570a56173b637d66ba2a2e390271fe', u'Rambler'], [u'c6570a56173b637d66ba2a2e3902ad1f', u'BBC']] , but it doesn't appear in template. Here's my forms.py sel = [] # FiltersForm is print out title, two select elements and an one required textinput's field class FiltersForm(forms.Form): title = forms.CharField(widget=forms.TextInput(attrs={'placeholder': 'A title'}), label='Title') item = forms.ChoiceField(widget=forms.Select(attrs={'class': 'selectpicker'}), required=False, label='If', choices=items) action = forms.ChoiceField(widget=forms.Select(attrs={'class': 'selectpicker'}), required=False, label='is', choices=actions) word = forms.CharField(widget=forms.TextInput(attrs={'placeholder': 'a word'})) link = forms.URLField(max_length=255, widget=forms.URLInput(attrs={'value': 'http://'})) source = forms.MultipleChoiceField(widget=forms.SelectMultiple(attrs={'class': 'selectpicker'}), choices=sel) def __init__(self, *args, **kwargs): request = kwargs.pop('request', None) response = request.db.view('subscriptions/source', key=str(request.user)).rows for item in response: sel.append([item.id, item.value['title']]) print sel super(FiltersForm, self).__init__(*args, **kwargs) Instance of form in views.py # Retrieving a FiltersForm form = FiltersForm(request.POST or None, request=request) What's wrong with my form? -
django:column books_book.publication_date does not exist
I'm reading chapter 6 of django book: http://www.djangobook.com/en/2.0/chapter06.html And I've done whatever chapter 5 and 6 of this book told me and I checked my work and searched the error many times but I'm still having problem when I go to http://127.0.0.1:8000/admin/books/book/ to add some book and save it, I get this error: ProgrammingError at /admin/books/book/ column books_book.publication_date does not exist LINE 1: ...books_book"."title", "books_book"."publisher_id", "books_boo... And this is my models on models.py: from django.db import models class Publisher(models.Model): name = models.CharField(max_length=30) address = models.CharField(max_length=50) city = models.CharField(max_length=60) state_province = models.CharField(max_length=30) country = models.CharField(max_length=50) website = models.URLField() def __unicode__(self): return self.name class Meta: ordering = ['name'] class Author(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=40) email = models.EmailField() def __unicode__(self): return u'%s %s' % (self.first_name, self.last_name) class Book(models.Model): title = models.CharField(max_length=100) authors = models.ManyToManyField(Author) publisher = models.ForeignKey(Publisher) publication_date = models.DateField() def __unicode__(self): return self.title And this is on setting.py: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.staticfiles', 'books', ] MIDDLEWARE_CLASSES = [ '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', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', ] And this is on admin.py: from django.contrib import admin # Register your models here. from django.contrib import admin from books.models import Publisher, Author, Book admin.site.register(Publisher) admin.site.register(Author) admin.site.register(Book) Thanks … -
Deletion via ajax: in case of failure I'm redirected to delete url, but I would like to stay where I am (on detail page)
Django 1.10 I'd like to organize deletion of objects via ajax. The result of DetailView is in front of the user. The user sees detail information on the object, and knowingly presses "Delete". Comment on IntegrityErrorMixin: I decided to use on_delete=models.PROTECT for my models. In this case standard DeleteView will cause internal server error (500). So, I have to redefine delete method to catch integrity Error. Comment on ActionDeleteMixin: from the result of DetailView we call UpdateView via ajax. Therefore in html in the form tag we have to redefine action attribute. Comment on empty url: in DeleteView it is necessary to stipulate success_url. But in case of ajax it doesn't make sense. The object is deleted, 200 status code goes to the client side. And then via Javascript the user is redirected to frame_list. Data transmitted from the server are not analyzed. In other words, redirect_to_frame_list can accept data, textStatus, and jqXHR, but I don't use them. So, in case of success, simply redirect. And on the server side for me it is easier just to render empty html. So, in the browser I test the functionality. If the user doesn't violate the reference integrity, s/he can delete a … -
Django-registration custom urls
I've used django-registration (the app, HMAC) for user registration and login. Everything works fine, but I would like to have the login form at http://localhost:8000/, instead of /accounts/login/. What would be the cleanest way to accomplish this? When just copying the form from login.html to my index.html file, which provides the view of the main page, it (obviously (?)) doesn't work. I'm using django 1.9.6 and django-registration 2.1. Please note that I haven't got 'registration' in INSTALLED_APPS in the setting.py file, since that wasn't needed according to the docs. This is my login.html file: {% extends "mysite/base.html" %} {% load i18n %} {% block content %} <form method="post" action="."> {% csrf_token %} {{ form.as_p }} <input type="submit" value="{% trans 'Log in' %}" /> <input type="hidden" name="next" value="{{next}}" /> </form> <p>{% trans "Forgot password" %}? <a href="{% url 'auth_password_reset' %}">{% trans "Reset it" %}</a>!</p> <p>{% trans "Not member" %}? <a href="{% url 'registration_register' %}">{% trans "Register" %}</a>!</p> {% endblock %} And my urls.py file: from django.conf.urls import include, url from django.contrib import admin from . import views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', views.index, name='index'), url(r'^accounts/', include('registration.backends.hmac.urls')), url(r'^groups/', include('groups.urls')), #my own app ] -
Tastypie: deserialize content
All posts that i saw were for 2013\2014 years and this function for now has other parameters. My ajax request is: var body_data = new FormData(); body_data.append('text', message); body_data.append('loc_lat', elements[i].latitude); body_data.append('loc_lon', elements[i].longitude); body_data.append('loc_name', results[i].name); body_data.append('loc_addr', results[i].formatted_address); body_data.append('types', results[i].types); body_data.append('action', null); for(var k = 0; k <= (file.length - 1); k++) { body_data.append('photo'+k, file[k], file[k].name); } this.$.ajaxNewPost.body = body_data; /*this.$.ajaxNewPost.body = { "photos" :body_data, "photo_len" :len, "text" :message, "loc_lat" :elements[i].latitude, "loc_lon" :elements[i].longitude, "loc_name" :results[i].name, "loc_addr" :results[i].formatted_address, "types" :results[i].types, "action" :null };*/ this.$.ajaxNewPost.contentType = 'multipart/form-data'; this.$.ajaxNewPost.generateRequest(); For front-end i'm using Polymer. In my sirializer code is: class PostSerializer(Serializer): def deserialize(self, content, format='multipart/form-data'): print('PostSerializer') for i in content: print(i) #print(content) return content In official documentation didn't wrote exactly what this functiom must return and how i can deserialize it. What is the best way: write my own parser for content or there is some api that i hadn't saw? As i've undestood content is array of bytes and it hasn't any methods until that has array by default. -
Django - grouping queryset into json objects for highcharts.js
I am trying to render a percent barchart in my Django-driven web-site, and currently having trouble passing a json object with correct structure to the client-side. I need to get the number of female and male students in the list of univerities, so that the json object looks like this: series: [{ name: 'Harvard', data: [100, 40]}, { name: 'Oxford', data: [110, 60]}, { name: 'MIT', data: [90, 30] }] I've come across this post, but I don't like this approach in that I would like to pass the json object to javascript via ajax and render the graph in the get-method's success function. So my question is, how do I manipulate Django lists to come up with a json of the above structure where one of the fields is a list itself. So I am looking for something like: for univ in universities_qs: result['name'] = univ.name for category in sex_category: result['data'] = [.......] # mail/female number return JsonResponse({'content':json.dumps(result, ensure_ascii=False).encode('utf8')}) -
Django not showing up in my python directory
I am using ubuntu mate and have used pip install django command to install django. But I am not able to locate it in my python folder and also startproject returns error "cant locate python-django or python3-django. -
How can I render only first paragraph using jinja
I am using Django to create a website. I have a jinja variable called content <p>paragraph1</p> <p>paragraph2</p> <img... /> <p>paragraph3</p> ... I know I can truncate it using {{ content | truncatewords_html:10 | safe }} but it's what exactly I want, I want to render the first <p> tag only, how can I do it with jinja? Thanks! -
Django REST framework serializers: multiple fields mapping to one property
I have a model that has a flags property, which is a bitmask of multiple values. I want to expose it as an API using django-rest-framework, where the different flags are different boolean properties. Say, if the flags are FLAG_NEW=1, FLAG_DELETED=2, I want to expose isNew and isDeleted fields. For read-only models, this is easy - just use a SerializerModelField and get whether the flag is set. However, that doesn't work when I want to deserialize (this is a read-only field). I could use a custom field, but then what should I put in the source= parameter? They will overwrite each other if I put source=flags and if I don't, then how do I get the initial value? class MyModel(models.Model): FLAG_NEW = 1 FLAG_DELETED = 2 flags = models.IntegerField() .... class MyModelSerializer(models.Model): isDeleted = ??? isNew = ??? -
2 different date format comparison
I'm trying to use the default django Auth system. I get this error when I try to login: TemplateDoesNotExist at /accounts/login/ registration/login.html Request Method: GET Request URL: http://127.0.0.1:8000/accounts/login/ Django Version: 1.10 Exception Type: TemplateDoesNotExist Exception Value: registration/login.html Here is how my project is organized http://i.imgur.com/uymMTzd.png This is my urls.py located in the same directory as my settings.py: from django.contrib.auth import views as auth_views from django.conf.urls import url, include # include allows to import files from Apps from django.contrib import admin from .views import loggedin urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^sharing/', include('sharing.urls')), #auth related URLS url(r'^accounts/login/$', auth_views.login, name='login'), and finally, here is my settings file: """ Django settings for MyFamily project. Generated by 'django-admin startproject' using Django 1.10. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'ms62v8@=5p%*_$68th0zuw8!_xebp5s_m(7u-lq2wnvx+zyyrb' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ … -
error installing django storage swift on raspbian os
fallen in a pit trying to install sudo easy_install django-storage-swift This is for the first time I am seeing such a huge stacktrace. Running pbr-1.10.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-DFzzSy/python-keystoneclient-3.5.0/temp/easy_install-jogKbH/pbr-1.10.0/egg-dist-tmp-I5kTKH Traceback (most recent call last): File "/usr/bin/easy_install", line 9, in <module> load_entry_point('setuptools==5.5.1', 'console_scripts', 'easy_install')() File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 2199, in main lambda: setup( File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 2185, in with_ei_usage return f() File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 2202, in <lambda> distclass=DistributionWithoutHelpCommands, **kw File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 393, in run self.easy_install(spec, not self.no_deps) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 636, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 668, in install_item self.process_distribution(spec, dist, deps) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 716, in process_distribution [requirement], self.local_index, self.easy_install File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 631, in resolve dist = best[req.key] = env.best_match(req, ws, installer) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 874, in best_match return self.obtain(req, installer) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 886, in obtain return installer(requirement) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 636, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 666, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 856, in install_eggs return self.build_and_install(setup_script, setup_base) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1078, in build_and_install self.run_setup(setup_script, setup_base, args) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1063, …