Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to set password in user table when user is signup using google or facebook django allauth
By overriding the SocialAccountManager def save_user(self, request, sociallogin, form=None): """ Saves a newly signed up social login. In case of auto-signup, the signup form is not available. """ u = sociallogin.user u.set_unusable_password() if form: get_account_adapter().save_user(request, u, form) else: get_account_adapter().populate_username(request, u) sociallogin.save(request) return u how to get the password from social account signup -
Django - Statit files don't serve in production
My site works well in local but when I put it on my server, it can't load the static files. Here's my files. settings.py DEBUG=False STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_URL = '/static/' All my static are in /myproject/mymainapp/static I've got another directory "static" of the root of my project by doing manage collectstatic in production. Here's my nginx conf file : [...] root /home/user/site/mymainapp/; [...] location /static { alias /home/user/site/mymainapp/static; } I've tried to set the path to my static directory in my root directory project but it don't make anything better. My URLs patterns : urlpatterns = [ [...] nothing relative to static files ] Maybe I should add something in my URLs patterns ? Thanks for your help :) -
passing empty queryset to form results in form_invalid
I have a model form that contains among other things a dropdown list of pupils (ModelMultipleChoiceField), which is initially empty but when a user selects a teacher, I get the list of pupils registered for this teacher via ajax request. self.fields['pupil'] = forms.ModelMultipleChoiceField(queryset=Pupil.objects.none(),) Everything works till the validation. Since initially queryset points to none, when a form is submitted it is returned with an error "It is invalid choice". I can pass the entire set of pupils to the pupil field and then make it empty via jQuery but that looks ugly. What is the right way of doing it? -
Django __str__ returned non-string (type NoneType)
I am getting __str__ returned non-string (type NoneType) error at edit Product Model object Product Model class Product(models.Model): ProductName = models.CharField(blank=True, max_length=250) Price = models.FloatField(blank=True, default=9.99) Tax = models.FloatField(blank=True, null=True, default=0.0) StoreId = models.IntegerField(blank=True, null=True) RelatedStore = models.ForeignKey(Store, blank=True, null=True) Category = models.CharField(max_length=200, blank=True, null=True, default='No Specific Category') ProductImage = models.CharField(max_length=400, null=True, blank=True) Features = models.TextField(blank=True, null=True) ProductSize = models.IntegerField(blank=True, null=True, default=3) FavoriteField = models.BooleanField(blank=True, default=False) Active = models.BooleanField(blank=True, default=True) def __unicode__(self): return self.ProductName def __str__(self): return self.ProductName Any helpful answer will be appreciated. -
request.user.is_authenticated always return false in python/django
its been 5 days strugling with this.It was working well at first but suddenly it started giving me some erros that i couldn't understand so i started modifying my code from MyCustomUser model and custom authentication backend but still i cant figure this problem. What surprise me is that when i register users with sign_up function, the line " if user is not None and request.user.is_authenticated:" return false and it doesn't log in the user after sign up, but when i open django shell and test if user.is_authenticated it return True and user.is_anonymous return False. Can please anyone help me identify what is the problem here. Please fellow django developers. bellow is my sign_up view: def sign_up(request): if request.method == 'POST': form = SignUpForm(request.POST) if form.is_valid(): new_user = form.save(commit=False) #create string of first_name an last_name full_name = '{0} {1}' .format(new_user.first_name, new_user.last_name) #Slugify full name new_user.slug = slugify(full_name) new_user.save() email = request.POST.get('email') raw_password = request.POST.get('password1') #Authenticate the user user = authenticate(email=email, password=raw_password) if user is not None and request.user.is_authenticated: login(request, user) #Redirect to success url after user has successfully is logged in. return HttpResponseRedirect(reverse_lazy('jogos:question-list')) else: form = SignUpForm() return render(request, 'jogos/sign_up.html', {'form':form}) from jogos.models import MyCustomUser from django.contrib.auth import get_user_model And … -
Current user as a comment's autor (DJANGO)
I have create a model called 'Comentario' where the logged user can create his own comment. How can I do to automatically save as the author of the comment the logged user. Here I show my schema: models.py class Comentario (models.Model): titulo = models.CharField(max_length=50) texto = models.CharField(max_length=200) autor = models.ForeignKey (Perfil, editable=False, blank=True) fecha_publicacion = models.DateTimeField(auto_now_add=True) tag = models.ManyToManyField(Tags, blank=True) def __str__(self): return (self.titulo) views.py class ComentarioCreate (LoginRequiredMixin,CreateView): model = Comentario form_class = ComentarioForm template_name = 'home/comentario_form.html' success_url = reverse_lazy ('home:listar') def save(self): autor=self.request.user.username user.save() forms.py class ComentarioForm(forms.ModelForm): class Meta: model = Comentario fields = [ 'titulo', 'texto', 'tag', ] labels = { 'titulo': 'Titulo', 'texto' : 'Descripcion', 'tag' : 'Etiquetas', } widgets = { 'titulo':forms.TextInput(attrs={'class':'form-control'}), 'texto':forms.TextInput(attrs={'class':'form-control'}), 'tag':forms.CheckboxSelectMultiple(), } Perfil is a model which inherits form AbstractUser. models.py class Perfil(AbstractUser): nom_puesto = models.ForeignKey(Puesto, blank = True) def __str__(self): return '{}'.format(self.username) How can I do to have in the field 'autor' the username of the logged user? thank you for your answer! -
django - load currently logged in user information in the form
django noob here. The question i am going to ask has been asked several times, however, i couldn't find the answers which can help my case. the query is: I have a Form having a choice field which loads its choices information from the database. Basically, I have designed my models in such a way that, the choices displayed is individual to the users. for example: for user1, the choice field shows a,b,c,d. where as for user 2, the choice field shows v,w,d. The problem i am facing is referencing the logged in user and getting the username. then pass the username as the filter to the database. I have come across numerous init functions trying to do this, somehow it is not helping my case. forms.py class class_model(forms.Form): class_name = forms.ChoiceField( required=False, widget=forms.Select, ) def __init__(self, user, *args, **kwargs): self.user = user super (class_model, self).__init__(*args, **kwargs) current_user = self.user name = current_user.username k = User.objects.get(username=name) y = UserProfile.objects.get(user=k) schoolid = y.schoolid primary_filter = Class1.objects.filter (school_id=schoolid) ax = [("Choose Class", "Choose Class")] + list (primary_filter.objects.values_list ('class_name', 'class_name').distinct()) self.fields['class_name'].choices = ax The error i receive: 'QueryDict' object has no attribute 'username' -
Django: ManyToMany relationship and database duplicity
So I have models GeneralUser, Business, Brand, Bottle. class Business(models.Model): name = models.CharField(max_length=100, blank=False) owner = models.ForeignKey(GeneralUser, on_delete=models.CASCADE, blank=False, related_name="businesses") class Brand(models.Model): name = models.CharField(max_length=150, blank=False, unique=True) businesses = models.ManyToManyField(Business, related_name="brands", blank=False) class Bottle(models.Model): name = models.CharField(max_length=150, blank=False) slug = models.SlugField(max_length=550, default="", null=False, blank=False) brand = models.ForeignKey(Brand, on_delete=models.CASCADE, blank=False, related_name="bottles") Each Brand can belong to many businesses, and each Business can hold many brands. My goal is to not have Brand objects created if they already exist in the database. I've built a Bottle ModelForm which also allows the user to choose and create a new Brand in the process. But the problem I'm facing now is this: Users only see brands associated with the Business. User 1 created Brand X → OK User 2 tries to create Brand X → IntegrityError unique constraint failed. Which I totally understand and not surprised by. My question is what's the best solution in this case? -
How to get specific field from serializer of Django rest framework
Inside Views.py, I have these code: class ServerViewSet(viewsets.ViewSet): def list(self, request): servers = Server.objects.all() serializer = ServerSerializer(servers, many=True) return Response(serializer.data) # In here, I want to get the server name only def retrieve(self, request, pk=None): servers = get_object_or_404(Server, pk=pk) serializer = ServerSerializer(servers) return Response(serializer.data) # In here, I want to get the server name and ip address Inside serializers.py, I have these code: class ServerSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Server # fields = '__all__' fields = ('id', 'name', 'desc', 'ip_address') Is there an official method to filter out the specific field from serializers.data -
Сelery hangs on startup
I'm trying to use real-time processing with a Django app that is configured as specified in the documentation. Without my_monitor() functions from the example, celery works fine, but as soon as I add this function it doesn't run. Project struct: - proj/ - firstapp/ - manage.py - proj/ - __init__.py - celery_config/ - __init__.py - main.py - ... - celery.py - settings.py - urls.py - ... - ... In celery.py file I have the following code that works: from __future__ import absolute_import import os from celery import Celery from . import celery_config as config os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings') celery_app = Celery('proj') celery_app.config_from_object(config) celery_config stored broker_url, queues, routers, shedule and etc. Run celery: $ celery -A proj ... and in this form it works fine then I add the function in celery.py: def celery_logger(app): state = app.events.State() def logging_task_received(event): state.event(event) task = state.tasks.get(event['uuid']) # here I want to add your own log entry in db with app.connection() as connection: recv = app.events.Receiver(channel=connection, handlers={ 'task-received': logging_task_received, }) recv.capture(limit=None, timeout=None, wakeup=True) celery_logger(celery_app) and now, it hangs when you call celery -A proj ... -
Django ManytoManyField and widgets
I have two models, Product and Category and ManytoMany field in Product. The Category appear as key on ProductCreate View. I need to customize the widget and field for Categories. I checked in Django source Fields and Widgets but I don't see a reference(class) for ManyToMany. To what type of Field and Widget ManyToMany relationship corresponds(I presume is Charfield as save or SelectField)? Where I can find the code ? (an example to customize field/widget in this case) -
Django: Cannot display object image in DetailView
As you see in shot-screens the object image is shown in ListVIew. but I don't have access to this image in DetailView with same url. List View: {% for team in teams %} <tr> <td>{{ forloop.counter }}</td> <td><img src="{% thumbnail team.logo 30x30 %}" alt=""> {{ team.name }}</td> .... Detail View: ... <h3 class="page-header"><img src="{% thumbnail team.logo 30x30 %}">{{ team.name }}</h3> ... -
Get data from 2 Model in Django python
class Product(models.Model): name = models.CharField(max_length=200) price = models.FloatField() avgrating = models.FloatField() def __str__(self): return self.name class Rating(models.Model): Product_id = models.ForeignKey('Product', related_name='Product_id') User_id = models.ForeignKey('User', related_name='User_id') rate = models.IntegerField() I want like - name of the product - price of the product - avgrating (AVG rating) - depend on User_id and Product_id and SQL query like: select p.name,p.price,p.avgrating,r.rate from Product p, Rating r where User_id=1; out Like: in json formate { "name":"Iphone 8", "Price":80000, "avgrating":3.5, "rate":5 } -
I want to use wpadmin in django but having an issue
Hello everyone I want to integrate wpadmin by barszczmm into my django project but in his documentation he has written Add django.core.context_processors.request to TEMPLATE_CONTEXT_PROCESSORS setting. Icannot exactly understand what this means . I tried by adding this line django.core.context_processors.request in setting.py under templates -> 'context_processors' but nothing happened and server gives the exception InvalidTemplateLibrary at /admin/ .please tell me exactly what to do -
Django passing variables into string
I'm trying to pass: img src="{% static '/static_dirs/images/itcg/01_{{ card_id }}.jpg' %}" alt="{{ card_id }}"> to load image with file name 01_xx.jpg, but the result is just xx without image. Basically what happens is that {{ card_id }} works in alt but I can't load the image. I have tried to change 01_{{ card_id }}.jpg into 01_01.jpg and it works, so the static files can load properly but apparently 01_{{ card_id }}.jpg is not working as intended. I also tried to changing one of my image name from 01_01.jpg into 01.jpg and do the following: img src="{% static '/static_dirs/images/itcg/{{card_id}}.jpg' %}" alt="{{ card_id }}"> The image still not loading, so I guess the problem is not in "01_" part either. Can someone help? -
ReferenceError: toastr is not defined when using Material Bootstrap alert
I'm trying to use Material Bootstrap Alert in my Django app. If user inputs wrong password or username while trying to login to the page, the error toast message should appear in the upper right corner. With js alert it works perfectly fine but when I'm trying to invoke toastr.error('Wrong login credentials. Please, try again...'); I get these erorrs: jQuery.Deferred exception: toastr is not defined @http://127.0.0.1:8000/login/:63:9 j@http://127.0.0.1:8000/static/js/jquery-3.2.1.min.js:2:29997 g/http://127.0.0.1:8000/static/js/jquery-3.2.1.min.js:2:30313 undefined ReferenceError: toastr is not defined Here is my login.html page: {% extends 'utas/template.html' %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{% block title %}Login{% endblock %}</title> </head> <body> {% block pagecontent %} <div class="container"> <!-- Begin Form login --> <form method="post" class="mt-5" style="width: 24rem; margin: 0 auto;"> {% csrf_token %} <p class="h5 text-center mb-4">Sign in</p> <div class="md-form"> <i class="fa prefix material-icons grey-text">account_circle</i> <input type="text" id="defaultForm-user" class="form-control" name="username" required oninvalid="this.setCustomValidity('Username is required!')" oninput="setCustomValidity('')"> <label for="defaultForm-user">Your username</label> </div> <div class="md-form"> <i class="fa prefix material-icons grey-text">lock</i> <input type="password" id="defaultForm-pass" class="form-control" name="password" required oninvalid="this.setCustomValidity('Password is required!')" oninput="setCustomValidity('')"> <label for="defaultForm-pass">Your password</label> </div> <div class="text-center"> <button type="submit" class="btn btn-default">Login</button> </div> </form> <!-- End Form login --> </div> {% endblock %} {% block script %} {% if form.errors %} <script type='text/javascript'> $(document).ready(function() { toastr.error('Wrong login credentials. Please, … -
pyAudio stream audio with Paspberry Pi
I want to stream music using pyAudio and Raspberry Pi. What I am doing is like this: def play(request): CHUNK = 1024 wf = wave.open("/var/www/moozee/MusicApp/music/mymusic.wav", 'rb') p = pyaudio.PyAudio() stream = p.open(format=p.get_format_from_width(wf.getsampwidth()), channels=wf.getnchannels(), rate=wf.getframerate(), output=True) data = wf.readframes(CHUNK) while data != '': stream.write(data) data = wf.readframes(CHUNK) stream.stop_stream() stream.close() p.terminate() return HttpResponse('success') and my urls.py from .views import play urlpatterns = [ url(r'^play-stream/$', play, name='stream'), ] The problem is when I type this url in browser it gives me OSError [Errno -9996] Invalid output device (no default output device) here is my gunicorn.service [Unit] Description=gunicorn daemon After=network.target [Service] User=umar Group=www-data WorkingDirectory=/var/www/moozee/MusicApp ExecStart=/var/www/moozee/MusicApp/.venv/bin/gunicorn --access-logfile - -- workers 3 --bind unix:/var/www/moozee/MusicApp/moozee.sock Capstone.wsgi:application [Install] WantedBy=multi-user.target Here is my Nginx configuration server { listen 80; server_name DOMAIN_NAME; location = /favicon.ico { access_log off; log_not_found off; } location /static/ { root /var/www/moozee/MusicApp; } location / { include proxy_params; proxy_pass http://unix:/var/www/moozee/MusicApp/moozee.sock; } } How can I fix this issue? I am running my project on Raspberry Pi server and I know that this problem is due to Raspberry Pi has no default audio output device. I want to play this audio on web-browser but I have no idea how to go further. Thanks in advance! -
Django disable a link if list returns empty
I don't want to display a link if the list returns empty. template.html {% for item in cart %} <h1>{{ item.product.product_title }}</h1> <a href="{% url 'products:remove_from_cart' item.product.id %}">Remove item</a> {% empty %} <p>No items in cart</p> {% endfor %} {% if item is not None %} <p> <a href="{% url 'products:checkout' %}">Checkout</a> </p> {% endif %} views.py def cartview(request): if request.user.is_authenticated(): cart = Cart.objects.filter(user=request.user.id, active=True) orders = ProductOrder.objects.filter(cart=cart) #total = 0 count = 0 for order in orders:) count += order.quantity context = { 'cart': orders, 'count': count, } return render(request, 'store/cart.html', context) else: return redirect('index:index') I want to hide checkout link if the cart list is empty. putting it in the for loop would make the link appear many times. I want to display checkout button only once. -
Django 127.0.0.1:8000/admin/ stopped working
Not sure what I've done to break the admin site, but going to 127.0.0.1:8000/admin/ is not working and gives me the error in the screenshot below: Here's the two urls.py files: myproject/urls.py from django.conf.urls import include, url from django.contrib import admin import product_app.urls urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^', include(product_app.urls)), ] and the product_app urls.py: from django.conf.urls import url from django.conf import settings from django.views.static import serve from . import views from .views import * urlpatterns = [ url(r'^$', views.HomePage.as_view(), name='home'), url(r'^contact/$', views.contact, name='contact'), url(r'^subscribe/$', views.subscribe, name='subscribe'), url(r'^products/$', views.products, name = 'products'), url(r'^product/$', ProductListView.as_view(), name='product_list'), url(r'^user/(\w+)/$', views.profile, name='profile'), url(r'post_url/', views.post_product, name='post_product'), url(r'^([0-9]+)/$', views.detail, name = 'detail'), url(r'^login/$', views.login_view, name='Login'), url(r'^logout/$', views.logout_view, name='Logout'), url(r'^like_product/$', views.like_product, name='like_product' ), url(r'^profile/edit/$', views.edit_profile, name='edit_profile'), url(r'^(?P<pk>\d+)/edit/$', PostUpdateView.as_view(), name='product-edit'), url(r'^(?P<pk>\d+)/delete/$', PostDeleteView.as_view(), name='product-delete'), ] if settings.DEBUG: urlpatterns += [ url(r'^product/(?P<path>.*)$', serve, { 'document_root': settings.MEDIA_ROOT, }), ] ...and just in case, the models.py: from django.db import models from django.contrib.auth.models import User from django.core.urlresolvers import reverse def get_image_path(instance, filename): return '/'.join(['product_images', str(instance.name), filename]) class Product(models.Model): user = models.ForeignKey(User) name = models.CharField(max_length=100) description = models.CharField(max_length=300) price = models.DecimalField(max_digits=10, decimal_places=2) url = models.CharField(max_length=200) product_type = models.CharField(max_length=100) image = models.ImageField(upload_to='product_images', blank=True, null=True) image_url = models.CharField(max_length=200, blank=True) likes = models.IntegerField(default=0) def __str__(self): return self.name … -
django-admin startproject myproject is not working
I'm new to django and wanted to begin learning it but I am stuck at creating a new project. So, far I tried command django-admin startproject mysite and django-admin.py startproject mysite but the outcome produces -bash: django-admin.py: command not found and -bash: django-admin: command not found. I also tried this in a virtualenv but it produces the same thing. (mysite) xxxxxxx (master *+) django-tutorial $ django-admin startproject myproject -bash: django-admin: command not found (mysite) xxxxxx (master *+) django-tutorial $ django-admin.py startproject myproject -bash: django-admin.py: command not found I am running mac osx el capitan -
DatabaseError: current transaction is aborted, commands ignored until end of transaction block on manage.py syncdb
I cloned an existing django project and set it up on a virtualenv on Windows 10. I installed the following tools; Django==1.5.1 pillow==2.5.1 South==1.0.2 django-autocomplete-light==1.1.7 django-haystack==2.3.1 django-memcache-status==1.1 #django-mptt==0.5.4 mailsnake==1.6.3 psycopg2==2.4.5 requests==1.1.0 simplejson==3.1.0 sorl-thumbnail==11.12 textile==2.1.5 #xapian-haystack==1.1.5beta gunicorn==19.1.1 #pycurl==7.19.5 django-widget-tweaks==1.3 pycountry==1.10 django-jsonfield==0.9.13 python-dateutil==2.3 geopy==1.7.0 whoosh==2.5.7 structlog==15.1.0 celery==3.1.17 python-memcached==1.54 I am using postgresql 9.6. When I ran python manage.py syncdb I get the above error, interestingly when I comment out all other apps, apps that ship with Django successfully sync. The following is the error log from pg_log; ERROR: relation "pages_entrytype" does not exist at character 755 STATEMENT: SELECT "pages_entrytype"."id", "pages_entrytype"."created", "pages_entrytype"."created_by_id", "pages_entrytype"."modified", "pages_entrytype"."modified_by_id", "pages_entrytype"."visible", "pages_entrytype"."name", "pages_entrytype"."title", "pages_entrytype"."header", "pages_entrytype"."description", "pages_entrytype"."meta_description", "pages_entrytype"."content", "pages_entrytype"."sortorder", "pages_entrytype"."system_required", "pages_entrytype"."old_id", "pages_entrytype"."old_table", "pages_entrytype"."parent_id", "pages_entrytype"."lft", "pages_entrytype"."rght", "pages_entrytype"."tree_id", "pages_entrytype"."level", "pages_entrytype"."slug", "pages_entrytype"."bookable", "pages_entrytype"."icon", "pages_entrytype"."icon_hover" FROM "pages_entrytype" WHERE UPPER("pages_entrytype"."name"::text) = UPPER('accommodation'). ERROR: current transaction is aborted, commands ignored until end of transaction block. STATEMENT: SELECT c.relname FROM pg_catalog.pg_clasLEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r', 'v', '') AND n.nspname NOT IN ('pg_catalog', 'pg_toast') AND pg_catalog.pg_table_is_visible(c.oid) LOG: could not receive data from client: An existing connection was forcibly closed by the remote host. I have ensured lazy loading in my models. -
Django : Conditional expressions in get_queryset(self)
I am in Django 1.11 and I would like to combine what I read: https://docs.djangoproject.com/fr/1.11/ref/models/conditional-expressions/ https://docs.djangoproject.com/fr/1.11/topics/class-based-views/generic-display/ https://docs.djangoproject.com/fr/1.11/ref/models/querysets/#django.db.models.Q For example, suppose I have something like this that will check if Objects are in the user area and a ListView use it. open_help_requests = HelpRequest.objects.filter(state=HelpRequest.OPEN) filtered_help_requests = [] for help_request in open_help_requests: """ Formule de Haversine pour connaitre la distance entre deux points géographiques """ earth_radius = 6373.0 lat1 = radians(help_request.student.studentcollaborator.postal_code.latitude) lon1 = radians(help_request.student.studentcollaborator.postal_code.longitude) lat2 = radians(request.user.student.studentcollaborator.postal_code.latitude) lon2 = radians(request.user.student.studentcollaborator.postal_code.longitude) dlon = lon2 - lon1 dlat = lat2 - lat1 a = sin(dlat / 2) ** 2 + cos(lat1) * cos(lat2) * sin(dlon / 2) ** 2 c = 2 * atan2(sqrt(a), sqrt(1 - a)) distance = earth_radius * c if distance <= help_request.settings.distance: filtered_help_requests.append(help_request) What I want to move this condition check inside the filter in def get_queryset(self): so that I could directly make additional simple order/filter operations with the filtered QuerySet. Recreate the QuerySet with the filtered variable list id looks too heavy (like this : Django get a QuerySet from array of id's in specific order). Any ideas ? Thanks. -
Returning JSON object from rest API
I am attempting to return a json object from a rest API. I'm using django and when I view the object from the web, I can see the data as a json object: [{"user": 2, "content": "please work", "members": [1], "date": "2017-11-04T21:44:23Z", "attendees": [2]}] I am trying to receive it in react and then display the content from it: export default class fetchPosts { constructor(props){ this.state = { data: [], error: false, refreshing: false, url: 'http://127.0.0.1:8000/post/PostList', } } fetchAllPosts = () => { fetch('http://127.0.0.1:8000/post/PostList') .then(res => res.json()) .then(response => { this.setState({ loading: false, data: response, refreshing: false, }); console.log(data) return data }) } } but using the console log in my react debugger all that is returned is this strange object. I understand that the console log may not display it precisely, however even when I attempt to deconstruct and render it, it tells me either the promise was rejected or data.content is null. -
Is there a Python/Django equivalent to Rails bundler-audit?
I'm fairly new to Django so apologies in advance if this is obvious. In Rails projects, I use a gem called bundler-audit to check that the patch level of the gems I'm installing don't include security vulnerabilities. Normally, I incorporate running bundler-audit into my CI pipeline so that any time I deploy, I get a warning (and fail) if a gem has a security vulnerability. Is there a similar system for checking vulnerabilities in Python packages? -
Django can't make external connections with requests or urllib2 on development server
Everytime I make an external request (including to google.com) I get this response: HTTPConnectionPool(host='EXTERNALHOSTSITE', port=8080): Max retries exceeded with url: EXTERNALHOSTPARAMS (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x105d8d6d0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))