Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Unable to import 'knox.models' pylint(import-error)
I am building a simple register and login API in Django with Knox authentication. I cannot import only this 'know.models' but others from django and rest_framework. I have checked in settings.py, pylint path and virtual env dependencies. All necessary things are installed and updated. How should I solve this error? -
Migrate or Integrate Python Standalone Script to DJango
I'm new to DJango and Want to know the best way to connect it with Standalone Python application. The Old setup we have is: HTML, Javascript and PHP web portal Python Application to get results and do actions (Connected to Portal through by PHP and Ajax) Right now I migrated the Web portal code to DJango and everything is working fine but I want to connect it to the Python app in a Secure way and without building the whole application again in DJango. How can I do that? -
Django update html label without refreshing page
I am working on a Deep learning project where first we read the real-time video from an ipcamera, get the frame, feed this image/frame to our deeplearning model and this model returns a detected text. in our browser we want to show the image and detected text to the user. so far i am able to show live feed of camera and detected text on the webpage but the problem is the detected text label is not refreshing it is only showing the text detected in the first frame. only live feed is refreshing, to refresh the detected_text label we have to refresh whole page. is there a way we can update only the detected_text label of the index.html whenever the model detects a new text in the image. live camera feed is coming from one url and detected text is being passed as a context from recognizetext view. my index.html page: <html> <head> <meta name="viewport" content="width=device-width, minimum-scale=0.1"> </head> <body style="margin: 0px;"> <h3> image </h3> <img style="-webkit-user-select: none;margin: auto;" src="http://127.0.0.1:8000/api/live/" width="640" height="480"> <h3>{{ detected_text }}</h3> </body> </html> views.py, to get the live camera feed and render index.html : class VideoCamera(object): # for camera feed def __init__(self): self.video = cv.VideoCapture('rtsp://user:password@172.xx.xx.xx:554/live.sdp') (self.grabbed, … -
module 'django.forms' has no attribute 'PhoneNumberField'
from django import forms class ContactForm(forms.Form) name = forms.CharField(max_length=100) email = forms.EmailField() moblie = forms.PhoneNumberField() -
How to show user groups because they didn't show in django view?
I have CRUD operations for users which can be done only from admin and he can assign users to 6 different groups. It saved in the database and everything works well. The problem I faced now is that the groups are not visualize in my views (or in the UI whatever it called) I attached picture to show what I mean: The groups are not showing. Can anyone say what I'm missing? models.py class CustomUserManager(BaseUserManager): def create_user(self, email: str, password: str, group: Group, **extra_fields): if not email: raise ValueError(_('The Email must be set')) email = self.normalize_email(email) user = self.model(email=email, **extra_fields) user.set_password(password) user.save() if group is not None: group.user_set.add(user) return user def create_superuser(self, email, password, **extra_fields): extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_superuser', True) extra_fields.setdefault('is_active', True) if extra_fields.get('is_staff') is not True: raise ValueError(_('Superuser must have is_staff=True.')) if extra_fields.get('is_superuser') is not True: raise ValueError(_('Superuser must have is_superuser=True.')) return self.create_user(email, password, **extra_fields) class CustomUser(AbstractUser): username = None email = models.EmailField(_('email address'), unique=True) USERNAME_FIELD = 'email' REQUIRED_FIELDS = [] objects = CustomUserManager() def __str__(self): return self.email username = models.CharField(max_length=30, blank=True, default='') is_superuser = models.BooleanField(default=True) is_admin = models.BooleanField(default=True) is_employee = models.BooleanField(default=True) is_headofdepartment = models.BooleanField(default=True) is_reception = models.BooleanField(default=True) is_patient = models.BooleanField(default=True) is_active = models.BooleanField(default=True) is_staff = models.BooleanField(default=True) forms.py class UserForm(ModelForm): … -
Hi, someone can help me with some django views?
I hope someone can solve this problem. My goal is to take the last hour posts and insert them in a dictionary with all the info (author, title, text and published date). At the end I want to dumps it in an html file. This is my code: views.py @superuser_only def PostUltimaOra(request): post_detail = {} dt = now() PostsLastHour = Post.objects.filter(published_date__range=(dt-timedelta(hours=1), dt)) for each in PostsLastHour: post_detail = { 'author': each.author, 'title': each.title, 'text': each.text, 'published_date': each.published_date, } dj = json.dump(post_detail) return render(request, 'blog/numeroposts.html', {'dj': dj}) models.py class Post(models.Model): author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) title = models.CharField(max_length=200) text = models.TextField() created_date = models.DateTimeField(default=timezone.now) published_date = models.DateTimeField(blank=True, null=True) def publish(self): self.published_date = timezone.now() self.save() def __str__(self): return self.title html {% extends 'blog/base.html' %} {% block content %} <h1>{{ 'Posts per utente:' }}</h1> {% for k, v in numero.items %} {{ 'L utente con id n° '}} {{ k }} {{ ' ha pubblicato '}} {{ v }} {{ ' posts' }} <p>{{ ''|linebreaksbr }}</p> {% endfor %} <h2>{{ 'I post pubblicati nell utlima ora sono questi: ' }} {{ dj }}</h2> {% endblock %} -
Django Can I change the Receive Charset only in a specific View?
settings.py DEFAULT_CHARSET = 'UTF-8' views.py class OrderResult(viewsets.ModelViewSet): def create(self, request, *args, **kwargs): payload = request.data <<---- some string broken *** save to database i'd like to receive data with 'euc-kr' only in the above View. -
How to deploy GOOGLE_APPLICATION_CREDENTIALS and use from Django app deployed using Elasticbeanstalk
I have an Django app deployed to AWS using Elasticbeanstalk. I implemented FCM(Firebase Cloud Messaging) relation to Django app. To access FCM feature from Django, it required Firebase Admin SDK installed to django. Firebase Admin SDK requires firebase's private key as json file accessed via env var GOOGLE_APPLICATION_CREDENTIALS. On my local Mac Book env I set local path to private key json file to GOOGLE_APPLICATION_CREDENTIALS in .bash_profile. How do I deploy the firebase's privatge key json file to somewhere safe on AWS(S3 maybe) and access from Django app deployed to AWS using Elasticbeanstalk. -
fusionchart not showing up in django
I am trying to integrate fusion chart in Django, i followed the [official article][1] but the chart is not showing up. I have changed the following files according to the article. My base.html {% load static %} <!DOCTYPE html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>My Site</title> <link rel="shortcut icon" type="image/x-icon" href="{%static '/images/favicon.png'%}" /> <!-- CSS --> <link rel="stylesheet" href="{%static 'css/bootstrap.css'%}" /> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous" /> <link rel="stylesheet" href="{%static 'css/animate.min.css'%}" /> <link rel="stylesheet" href="{%static 'css/owl.carousel.min.css'%}" /> <link rel="stylesheet" href="{%static 'css/style.css'%}" /> <link rel="stylesheet" href="{%static 'css/responsive.css'%}" /> </head> <body> <!-- Begin: Header --> {% include "user/layout/header.html" %} <!-- End: Header --> <!-- Begin: Main --> {% block content %} {% endblock %} <!-- End: Main --> <!-- Footer : Begin---> {% include "user/layout/footer.html" %} <!-- Footer : End --> <!-- Jquery--> <script src="{%static 'js/jquery.min.js'%}"></script> <script src="{%static 'js/bootstrap.js'%}"></script> <script src="{%static 'js/owl.carousel.min.js'%}"></script> <script src="{%static 'js/wow.js'%}"></script> <script src="{%static 'js/custom.js'%}"></script> <script src="{%static 'js/sweetalert.min.js'%}"></script> <script src="{%static 'js/fusioncharts.js'%}"></script> <script src="{%static 'js/fusioncharts.charts.js'%}"></script> <script src="{%static 'js/fusioncharts.maps.js'%}"></script> <script src="{%static 'js/fusioncharts.theme.carbon.js' %}"></script> </body> </html> My View def chart(request): dataSource = {} dataSource['chart'] = { "caption": "About This Product", "showValues": "0", "theme": "carbon" } dataSource['data'] = [] for key … -
RuntimeError: Model class blog.models.Blog doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS
settings.py INSTALLED_APPS = [ 'blog.apps.blogConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] Models.py: from django.db import models class Blog(models.Model): name = models.CharField(max_length=100) tagline = model`enter code here`s.TextField() Apps.py class blogConfig(AppConfig): name = 'blog' -
jQuery remote method is not working properly, no error is showing
I am new to jQuery, I am trying to use remote method, it's not working properly, I think the error is in accessing url, I've tried in different patterns , yet it didn't work. I am using Django. Can anyone help me with it? Thanks in advance. <script> $( document ).ready( function () { $( "#signupForm" ).validate( { rules: email: { required: true, good_email : true, remote: {url: "{% url 'check_usn_email' %}"} }, messages: { email: { required: "Please enter your Email address", remote: "An account with that email already exists" } }); }) </script> Urls.py file: path("check_email/",views.check_email, name="check_email") Views.py file: def check_email(request): is_available = 'false' if request.is_ajax(): '''email = request.GET("email") try: User.objects.get_by_natural_key(email) is_available = False except User.DoesNotExist: is_available = True''' return HttpResponse(is_available) html form: <form id="signupForm" method="post" class="login-form text-center" action="/accounts/register/"> {% csrf_token %} <div class="form-group"> <label class="field__label" for="email">Email Address</label> <i class="fas fa-envelope"></i> <input type="email" id="email" class="field__input" placeholder="Email ID" name="email"> </div> </form> -
Trouble connecting to my remote postgres dB using Django
Having trouble connecting to my remote postgres dB using Django. The connection details are fine because I can run normal python scripts using my dB. However, connecting via Django causes this error = Connecting to the PostgreSQL database... could not connect to server: Connection timed out Is the server running on host "HOSTNAME" ("IP_ADDRESS") and accepting TCP/IP connections on port 5432? Which is weird because no where in my settings file do I create port = 5432, I've also added the IP address that was returned to my allowed hosts, still didn't solve the issue. I am using a Digital Ocean managed postgres database. This is my settings.py file = import os from pathlib import Path from urllib.parse import urlparse import dj_database_url import logging.config # Build paths inside the project like this: BASE_DIR / 'subdir'. #BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.environ.get('SECRET_KEY_DJANGO') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = ['0.0.0.0', 'localhost', '127.0.0.1'] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'home.apps.HomeConfig', 'django_plotly_dash.apps.DjangoPlotlyDashConfig', 'dpd_static_support', … -
What is the best architecture one can follow while using Django Rest Framework
I am new to the DRF, and I was thinking about what is the best way to structure/architect the Django so that I can efficiently manage multiple environments as well as maintaining a standard architecture. -
django can't send Arabic email with RTL (from right to left) syntax
hi i am use django EmailMessage to send emails , for English language it is fine , but i am try to send email to users by arabic language but the email arrives to user not RTL (from right to left) is any option in django send email settings to send email with RTL syntax ? here is my code : from django.core import mail try: f_email_connections().open() email2send = mail.EmailMessage( email_subject, ## subject email_body, # Body goes here email_send_from, # from email address [email_send_to], # to email address connection=f_email_connections(), ) email2send.send() # Send the email f_email_connections().close() except: pass -
Django Websocket, send message to different rooms
I built chat app using Django web socket. I want to send the message to different room like broadcast message. I want to differentiate the group and broadcast chat here. I went through the documentation and surfed online. But i didn't find any relevant information. Mostly I find, using Groups chat. I'm stuck on this. Am I going correct way ? Any suggestion that will be helpful for me. Thanks in advance -
How to create an dummy object in Django without saving it to the model
I am having an model instance project = Project.objects.get(id = 10) How to create a copy of this object without saving to our model Because this query I am using inside a delete function and this dummy object I need to pass to an celery function So if my delete function return the success message also my celery function works in background ... So I do not want to store a copy image inside it -
gather scheduler run task for using in method of run in task class
I Using CLass based celery task schduler and my task run every 30 days from model i want gather time of execution for clalcualtion in one field I create a base task as below: from datetime import timedelta from celery.task import PeriodicTask class WorflowScheduler(PeriodicTask): abstract = True run_every = None query_task_pk = 1 def run(self): pass I read data from model and create parameter of schedule insert class PMscheduler(models.Model): jobname = models.CharField(max_length=100,unique=True) Days = models.IntegerField(blank=True) Hours = models.IntegerField(blank=True,validators=[MinValueValidator(0), MaxValueValidator(23)]) Minutes = models.IntegerField(blank=True,validators=[MinValueValidator(0), MaxValueValidator(59)]) title = models.CharField(max_length=150) ) in task.py i create schduler paramter for insert from user : shedulelist = PMscheduler.objects.all() for i in shedulelist: class CreatePM(WorflowScheduler): run_every = timedelta(days=i.Days,hours=i.Hours,minutes=i.Minutes) def run(self, **kwargs): PMTicket.objects.create( title=i.title, tobeimplementtime=i.tobeimplementtime, return title I need tobeimplement before mention as task executed every 30 day + 1day, how can i do that -
Django change_list customization add fields and action button to send email
I am a beginner and haven't worked overriding the django admin templates before. I could be really very wrong in my approach here to sincere apologies. I wish to modify the django admin change view to include form fields for email message and email subject. Currently the submit button is not even appearing. How should I proceed? admin.py class EvaluationAdmin(admin.ModelAdmin): change_form_template = "admin/evalutations/change_form.html" form = EvaluationForm def has_change_permission(self, request, obj=None): if obj is not None: if request.user.is_superuser: return True elif obj.decision == "rejected" or obj.decision == "success": return False elif request.user == obj.first_eval and (obj.is_second_review == False): return True elif request.user == obj.second_eval: return True return False def has_delete_permission(self, request, obj=None): if obj is not None: if request.user.is_superuser: return True elif request.user == obj.first_eval and (obj.is_second_review == False): return True elif request.user == obj.second_eval: return True return False def response_change(self, request, obj, form_url=''): if "_send_email" in request.POST: form = EvaluationForm(request.POST) receiver_email = self.get_queryset(request).filter(id=obj.id).lead.user.email sender_email = "pratyushadhikary1152@gmail.com" if form.is_valid: message = form.cleaned_data["message"] subject = form.cleaned_data["subject"] send_mail( subject, message, sender_email, [receiver_email], fail_silently=False, ) return HttpResponseRedirect(".") return super().response_change(request, obj) forms.py class EvaluationForm(forms.ModelForm): email_subject = forms.CharField(max_length=200) email_text = forms.CharField(widget=forms.Textarea) class Meta: model = Evaluation fields = "__all__" and here is the overridden change_form.html {% … -
How to Create Multiple Selection in Django
I'm trying to create like a simple form with multiple choice for my school project. so how do I create a multiple form like this using django? [1]: https://i.stack.imgur.com/ebsBW.png [1] -
Django - How to create an arithmetic relationship between two fields of different models in Django?
I am creating a sales app which has two modules with different models and relationships. The two modules are: Products(to keep track of product inventory) - this has 5 models: Providers, Warehouses, Brands, Products and Entries Sales(will keep track of sales per customer and salesman as well as other relevant sales data) - this has three models: User, Customers, Sales, among others The Entries model in the Products module has a field called "units" which is basically a DecimalField that represents the amount of X product in stock, for example 100 pounds of beef. class Entries(models.Model): user= models.ForeignKey(User,on_delete=models.CASCADE, related_name="entradas", editable=False) brand= models.ForeignKey(Brands, on_delete=models.CASCADE, related_name="marcas") product= models.ForeignKey(Products, on_delete=models.CASCADE, related_name="entradas") warehouse= models.ForeignKey(Warehouses, on_delete=models.CASCADE, related_name="bodegas") method= models.CharField(max_length=256,default="PEPS") created_date = models.DateTimeField(auto_now=True) entry_date= models.DateField() document= models.CharField(max_length=256,default='N/A') lot= models.IntegerField() CAD = models.DateField() UxC = models.IntegerField() unit_type = models.ForeignKey(EntryType, on_delete=models.CASCADE) units= models.DecimalField(max_digits=100,decimal_places=2) In the Sales model I will have a field which represents how much of a product was sold to that customer, I will use a manytomany relationship as you could sell multiple entries of different products to a customer. My question is, how can I create a relationship where for each product sold that Entry field "units" would automatically reflect the substraction of the sale. … -
I'm using 3 chained dropdown in 1 form using Python Django with the help of ajax, But I can't load cities under selected state
Here's my url path('ajax/load-cities/', load_cities, name='ajax_load_cities'), This is the form This is form.py class AddSuburb_form(ModelForm): name = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Enter Suburb Name'})) class Meta: model = Suburb fields = ['country', 'state', 'city', 'name'] widgets = { 'country': forms.Select(attrs={'class': 'form-control'}), 'state': forms.Select(attrs={'class': 'form-control'}), 'city': forms.Select(attrs={'class': 'form-control'}), } def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['state'].queryset = State.objects.none() if 'country' in self.data: try: country_id = int(self.data.get('country')) self.fields['state'].queryset = State.objects.filter(country_id=country_id).order_by('name') except (ValueError, TypeError): pass # invalid input from the client; ignore and fallback to empty City queryset elif self.instance.pk: self.fields['state'].queryset = self.instance.country.state_set.order_by('name') def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['city'].queryset = City.objects.none() if 'state' in self.data: try: state_id = int(self.data.get('state')) self.fields['city'].queryset = City.objects.filter(state_id=state_id).order_by('name') except (ValueError, TypeError): pass # invalid input from the client; ignore and fallback to empty District queryset elif self.instance.pk: self.fields['city'].queryset = self.instance.state.city_set.order_by('name') Heres the template In here, only states under the selected country must show and as same, cities under the selected state should showup. I can see, states are working fine but not cities. <div class="col-md-3"> <h3>Template</h3> <div class="drop-down"> <form method="POST" action="{% url 'add_suburb' %}" id="AddSuburbForm" data-cities-url="{% url 'ajax_load_cities' %}"> {% csrf_token %} {{form.as_p}} <button type="submit" class="btn btn-primary"> Save</button> </form> </div> Ajax Second function seems to have some problem but … -
Avoid double call GET Ajax load
Well, I'm trying to create a graphical interface for a database using django. I have to say that I'm trying to learn so I don't have too much experience with Frameworks, just with pure code. The doubt I have is: -When trying to create a filter system with checkboxes I have used Ajax to be able to update the view without having to refresh. Like this: $(document).on('click','#console_check_filter',function(){ var ps_id; ps_id = $(this).attr("data-posts-id"); $.ajax({ url: "{% url 'list-view' %}", method: 'POST', data: { 'getfilter': ps_id, 'csrfmiddlewaretoken': '{{ csrf_token }}', }, success: function (res, status,data) { $("#list").load("/game/list-view"); }, error: function (res,ras,rus) { } }); }); But I had the error that for every call I made with POST the AJAX function ().load() made another call which eliminated the variable that gave me the POST. This made it impossible for me to use the information received from the POST to create the filter. Result: I click on the checkbox and in the console I get a call with the filtered list and then another one without filter, and as it is not only the last one that is rendered, which has no data. To solve this I have used a globar variable to … -
Celery - worker only sometimes picks up tasks
I am building a lead generation portal that can be accessed online. Please don't mind the verbosity of the code, I'm doing a lot of debugging right now. My Celery worker inconsistently picks up tasks assigned to it, and I'm not sure why. The weird thing about this, is that sometimes it works 100% perfect: there never are any explicit errors in the terminal. I am currently in DEBUG = TRUE and REDIS as a broker! views.py class LeadInputView(FormView): template_name = 'lead_main.html' form_class = LeadInput def form_valid(self, form): print("I'm at views") form.submit() print(form.submit) return HttpResponseRedirect('./success/') tasks.py @task(name="submit") def start_task(city, category, email): print("I'm at tasks!") print(city, category, email) """sends an email when feedback form is filled successfully""" logger.info("Submitted") return start(city, category, email) forms.py class LeadInput(forms.Form): city = forms.CharField(max_length=50) category = forms.CharField(max_length=50) email = forms.EmailField() def submit(self): print("I'm at forms!") x = (start_task.delay(self.cleaned_data['city'], self.cleaned_data['category'], self.cleaned_data['email'])) return x celery.py @app.task(bind=True) def debug_task(self): print('Request: {0!r}'.format(self.request)) settings.py BROKER_URL = 'redis://localhost:6379' CELERY_RESULT_BACKEND = 'redis://localhost:6379' CELERY_ACCEPT_CONTENT = ['application/json'] CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json' CELERY_TIMEZONE = 'UTC' The runserver terminal will look something like this: I'm at views I'm at forms! <bound method LeadInput.submit of <LeadInput bound=True, valid=True, fields=(city;category;email)>> But the worker doesn't say that it picked … -
Can someone explain this error that i get when i try to deploy my django project
Here's the error in the apache log: Exception ignored in: <function Local.__del__ at 0x7fb9a1720310> Traceback (most recent call last): File "/opt/bitnami/python/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__ NameError: name 'TypeError' is not defined Exception ignored in: <function Local.__del__ at 0x7fb9a1720310> Traceback (most recent call last): File "/opt/bitnami/python/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__ NameError: name 'TypeError' is not defined Exception ignored in: <function Local.__del__ at 0x7fb9a1720310> Traceback (most recent call last): File "/opt/bitnami/python/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__ NameError: name 'TypeError' is not defined Exception ignored in: <function Local.__del__ at 0x7fb9a572a310> Traceback (most recent call last): File "/opt/bitnami/python/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__ NameError: name 'TypeError' is not defined Exception ignored in: <function Local.__del__ at 0x7fb9a572a310> Traceback (most recent call last): File "/opt/bitnami/python/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__ NameError: name 'TypeError' is not defined Exception ignored in: <function Local.__del__ at 0x7fb9a572a310> Traceback (most recent call last): File "/opt/bitnami/python/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__ NameError: name 'TypeError' is not defined I'm using a bitnami server on AWS lightsail. All my static webpages load perfectly, but whenever I try to do a from submission there's a 500 server error. I don't know how to fix that. I dont use typerror anywhere in my views.py btw -
Apple Review of iOS Cordova App - No User Agent received
This has happened 3 times over the last ~1.5 years. (Out of about 10 reviews.) On these 3 random occasions Apple reviewers have somehow sent requests which have: Lost their session AND somehow have absolutely NO User Agent at all (this is the one that really confuses us) (This results in our app being rejected because they have receive unintended behavior because they have no session or useragent.) INFO: We have a Cordova app and point it to our website running on a Django server. <!--- config.xml ---> <preference name="AppendUserAgent" value="APP_NAME_cordova" /> This has happened for us: cordova-ios@5.0.1 2/8 times cordova-ios@5.1.1 0/1 times (Lucky?) cordova-ios@6.1.1 1/1 times Never when we are testing ourselves No reports from our ~8,000 iOS users that match this behavior Never on Android (reviews/users/us) How could this be happening? Could this be django dropping the user agent? (and session? :S) Could Cordova be failing to send the userAgent? Is Apple doing something special/weird? Any suggestions? (Right now we are just assuming requests that match the above 2 criteria to be Apple, and forcing the behavior. Not Ideal.)