52 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
52
views
Django's manage.py dumpdata adds free text to each file
I am trying to move Django data from SQLite to Postgres, following this flow:
SQLite connection in settings.py
manage.py dumpdata > data.json
Postgres connection in settings.py
manage.py loaddata ...
0
votes
1
answer
138
views
Django. Error writing database from csv via custom commands
I want to write my own command to quickly get data from csv.
The script successfully fills the table User, Category, Genre. But when it comes to the Title model, I get the error
ValueError: Cannot ...
0
votes
2
answers
1k
views
What's the real use of the management/commands directory in the Django Application?
In the documentation, it is written that it can be used for writing custom Django-admin commands. But my question is why do we need to write custom Django admin commands? The given example in the ...
0
votes
1
answer
144
views
KeyError when importing config.ini file into Management Command folder and running manage.py (Django)
I have the follow structure.
members
├── management
│ │── __init__.py
│ │── commands
│ │── active.py
│── whatsapp.py
│── config.ini
I am trying to run a whatsapp api and I ...
0
votes
0
answers
149
views
Packaging django app that includes management commands
I am working on a django app that includes a custom management command. This app should be packed for pip.
Layout of the app is standard
django-simpl_ssg
simple_ssg
management
...
1
vote
1
answer
108
views
Django Management Command not workingcif i run for loop
I write this management command but not working
from django.core.management.base import BaseCommand
from name.models import ProductName
class Command(BaseCommand):
def handle(self, *args, **options):
...
0
votes
1
answer
79
views
how to delete int object in django
After filtering and updating I have to delete the objscts, How to solve the isuue,
AttributeError: 'int' object has no attribute 'delete'
def handle(self, *args, **options):
trees.objects....
0
votes
0
answers
355
views
How to send data to running django management command?
I have a custom django management command that is constantly running through the supervisor (keep alive)
I need under certain circumstances (for example, a signal in the project, or a change in the ...
0
votes
1
answer
103
views
Crontab seems to start scripts but nothing happens
I have defined quite a few cronjobs in my docker container, that I let running while I went for some holidays. When I came back, everything had stopped. It appears that the container restarted at some ...
2
votes
1
answer
1k
views
Is it possible to create a django_tenant_superuser via management.call_command?
I'm building a multi-tenant project with django-tenant.
The issue I'm encountering is that "password" is not a valid flag option.
management.call_command(
'...
-1
votes
1
answer
862
views
In django signals, how to pass sender's class variables (model fields) to receiver (management.call_command function) and use it
I am building a multi-tenant project using third-party package (django-tenants) which makes me derive the Tenant and Domain models from it's own classes:
from django_tenants.models import TenantMixin, ...
1
vote
1
answer
866
views
Log something at beginning & end of Django management commands
Right now I have multiple management commands in my Django project.
I would like to log something like [command_name] command started and [command_name] command finished at the beginning and end of ...
2
votes
2
answers
623
views
Nested management commands in Django
Is there anyway to create nested management commands in Django, similar to what the docker and kubectl have? For example, let's say I need to have the following structure:
|-->manage.py
|-->...
3
votes
1
answer
4k
views
Passing in date string to Django management argument
I have a Django management command, which I pass like this:
python manage.py tenant_command generate_weekly_invoice --start_date 2020年11月30日 00:00:00 --end_date 2020年12月06日 23:59:00 --schema=schema_name
...
0
votes
1
answer
277
views
EmailMultiAlternatives not sending BCC emails
I have a Django management command defined like this:
class Command(BaseCommand):
help = "Sends out an email with new jobs added in a timespan of a week"
def handle(self, *args, **...