django Questions
3
Solved
Consider the following:
status = queryset.values('status').annotate(count=Count('status'))
where status field is a CharField with choices. This will result in a list of dictionaries with status ...
Sphinx asked 31/7, 2014 at 13:49
2
Solved
Im working with a django project(im pretty new to django) and running into an issue passing a model object between my view and a celery task.
I am taking input from a form which contains several Mo...
Lump asked 11/2, 2021 at 18:20
3
Solved
Context: I'm building a car dealership app using Django 3.1.4, and trying to implement a feature where by every time a new ad is created, so is a new folder (via the upload_to method) within /media...
Wolof asked 5/1, 2021 at 23:56
3
In the Django Rest Framework I would like to post a file, received as an InMemoryUploadedFile, to a different server as soon as it is received.
It sounds simple, but the request.post() function do...
Lymanlymann asked 5/7, 2018 at 10:52
2
Solved
I have a form wherein I'm trying to insert a static image file in between an if-else loop in HTML. Here's the source code of the template:
<!DOCTYPE html>
<html>
<head>
&...
Toothpaste asked 29/6, 2015 at 14:9
3
I'm completely new for django and I'd want to list the apps of a django project, for example:
FeinCMS
I know that startapp creates the directory structure for an app. I wonder if there is either ...
Empiricism asked 21/6, 2018 at 13:59
3
Solved
I'm using a soft delete in my django admin, done like this.
The issue is that when I delete a foreign key item, that it doesn't seem to trigger the deletes for all the items it's linked to. Or may...
Rriocard asked 4/7, 2011 at 8:38
5
Solved
I've a periodic celery task which needs to store representation of a object in a specific json field.
Here is the simplified model structure.
Parent <-- ChildWrapper <-- Child Image
So basica...
Seraglio asked 19/8, 2019 at 9:50
5
This is what I see when I send mail via Django:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)
This is my email configuration in s...
3
I am working on a Django project where I am trying to use Jquery, I used a command-:
python -m HTTP.server on my Windows PowerShell, server is started but when I trying to use the address http://0....
2
Solved
I am having a little trouble setting up the static folders on elastic beanstalk for a django app I created. I manged to get the app to run without any of the css/js/etc. My file structure is:
|.e...
Antibiotic asked 9/6, 2020 at 0:10
3
Solved
Django gives admin url automatically, such as www.example.com/admin.
I do not want any outside visitors to access this url. This should be accessed only with in the host and allowed IP address.
If ...
Vacancy asked 30/4, 2014 at 18:1
3
I wonder why django doesn't support connection pool? I can't bear open/close connection every request. I try to solve it, but hasn't a good solution.
I try to use mysql_pool, but fail:
TypeError...
2
Solved
I have a Django model field with auto_now_add=True. How do I override the value for this field in my test?
class ABC(models.Model):
sent_at = models.DateTimeField(auto_now_add=True)
class ABCFac...
Sophiesophism asked 10/8, 2021 at 15:50
3
Solved
How can I access if a field has)errors at the level of widget?
Using default I tried:
{% if widget.attributes.has_errors %} or {% if widget.has_errors %}
but are not working.
I use custom widg...
Tabitha asked 2/2, 2019 at 9:25
6
Solved
I'm trying to deploy a django website on a ubuntu 14.04 vps using nginx and gunicorn but my css files and js files are not getting loaded.i developed it on the default django development server and...
Pocketful asked 5/7, 2017 at 6:41
2
Solved
When I upgrade importlib_meta from version 8.4.0 to 8.5.0 (released just yesterday, Sep 11 2024), I get the following error when I start running the development server with python manage.py runserv...
Extremely asked 12/9 at 10:16
2
Solved
currently I am dealing with django static/staticfiles and I learnt a lot about static_url, static_root, staticfiles_dirs here at stackoverflow and in youtube tutorials.
However I don't understand w...
Coastline asked 14/2, 2019 at 7:17
3
Solved
I'm using sentry-python==0.5.3 in a Django 1.11.6 project, and when I inspect a stacktrace's parameter list, I see some of the values are long enough to be cut off by a ... elipsis. I want to see t...
3
Solved
Does anybody know how to run Django Tests using pytest-django against an existing (e.g. production) database?
I know that in general, this is not what unit tests are supposed to do, but in my case...
Pola asked 4/1, 2018 at 13:51
4
Solved
I've been moving around some settings to make more defined local and production environments, and I must have messed something up.
Below are the majority of relevant settings. If I move the produc...
Perichondrium asked 3/1, 2020 at 3:7
3
Solved
I need to calculate period medians per seller ID (see simplyfied model below). The problem is I am unable to construct the ORM query.
Model
class MyModel:
period = models.IntegerField(null=True,...
Ommiad asked 10/1, 2020 at 18:11
2
I am using django-rest-framework-mongoengine for a personal project. I want to be able to send extra data in list requests. I have written 2 mixins for that purpose:
UserSearializerContextMixin: C...
Bonefish asked 25/11, 2015 at 7:33
4
I have this model:
class Invoice(models.Model):
owner = models.ForeignKey(settings.AUTH_USER_MODEL)
data = models.TextField(default=None, blank=True, null=True)
number = models.PositiveIntegerF...
Dupuy asked 25/11, 2015 at 17:8
2
I'm trying to achive that such endpoint /api/messages/<str:email>/ will return a list of messages for given email.
So in my ViewSet I've created a function with @action decorator
@action(
de...
Acetylene asked 25/7, 2020 at 15:5
1 Next >
© 2022 - 2024 — McMap. All rights reserved.