Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
51 views

do you have an idea how to use signals in custom management commands in Django? My Command's handle method processes continious stuff which needs to be cleaned up, when Command is interrupted. Without ...
ahandi's user avatar
  • 21
0 votes
1 answer
45 views

I have multiple dictionaries, and I want each key/value pair to be defined in the local scope of a django-extensions shell_plus session. My current management command looks something like this: import ...
Lord Elrond's user avatar
  • 16.5k
0 votes
2 answers
144 views

I followed the instructions on https://docs.djangoproject.com/en/5.0/ref/contrib/staticfiles/#s-customizing-the-ignored-pattern-list to override the ignore_patterns in my static files. Here are my ...
fishfin's user avatar
  • 313
0 votes
0 answers
54 views

I have a Django command which I can run using manage.py. The command imports django.conf.settings, then I grab Songs from the database to update bits of the settings: from django.conf import settings ...
Faith Baghan's user avatar
1 vote
0 answers
281 views

Hello everyone hope I find you well! So I'm trying to setup a new project with Django and a Kafka consumer. I'm using confluent-python package to create my consumer. So I'm facing a very odd situation....
Pedro Silva's user avatar
0 votes
1 answer
688 views

I wrote a set of commands for my Django project in the usual way. Is it possible to combine multiple commands into one command? class Command(BaseCommand): """ import all files in ...
JasonTS's user avatar
  • 2,629
1 vote
0 answers
131 views

I am new with django-tenants. I want to programatically run a cummand I have created with management.call_command() but I am getting error. Can someone help me with this? This command runs without ...
stackuser's user avatar
0 votes
0 answers
82 views

I want to pass value from django custom command to a view. Custom command: GDA_frontend/GDA_datatables/management/commands/gda_start.py class Command(BaseCommand): help = 'Starts the GDA app with ...
Luka's user avatar
  • 1
1 vote
1 answer
723 views

I'm trying to have a directory structure for my custom django-admin commands. According to the Django tutorial, commands are created as modules under the management/commands directory. e.g. management/...
user3599803's user avatar
  • 7,084
0 votes
1 answer
172 views

I have setup a scheduled task to run daily on PythonAnywhere. The task uses the Django Commands as I found this was the preferred method to use with PythonAnywhere. The tasks produces no errors but I ...
Mark's user avatar
  • 125
1 vote
1 answer
521 views

Problem I translate my group names in my Django application with the default translation tools. Since my group names are not hard-coded in my code, when I run makemessages, the lines corresponding to ...
Raida's user avatar
  • 1,536
6 votes
2 answers
7k views

I want to find a custom command in a project with many apps, how to get a list of all commands from all apps?
Sashko Lykhenko's user avatar
0 votes
1 answer
230 views

I want to pass values to template_context and the docs says: Any option passed to the startapp command (among the command’s supported options) What I understand is, that any extra argument that I pass,...
user avatar
3 votes
2 answers
404 views

The signature of BaseCommand.handle is handle(*args, **kwargs). The documentation example only uses the kwargs argument. Are there cases/ways to define command arguments/options such that they will ...
Dave's user avatar
  • 8,258
0 votes
0 answers
355 views

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 ...
Dmitry  Reva's user avatar
0 votes
1 answer
2k views

I have wrote a python script which automatically uploads files from a given folder to a django modell. I want this script running while django server is running. My script runs perfectly when I run it ...
brdptr02's user avatar
0 votes
2 answers
426 views

I am trying to run a django command on my heroku production server, but get the following error: Note: The same command works fine in my local dev environment. I took the following steps: ssh onto ...
Andrew Einhorn's user avatar
0 votes
0 answers
49 views

Deleting posts via Django command does not work. I do not know what to do, I am at a dead end. I hope you can help me... delnc.py File command class Command(BaseCommand): help = 'Командa для ...
Black Black's user avatar
0 votes
0 answers
283 views

I want to create a Django app from user input. Here is my code. def createAppname(name): split_name = name.split(" ") s = "".join(i[0:] for i in split_name) ...
Rohit Hazare's user avatar
1 vote
2 answers
1k views

How to schedule and run a specific command in django using Windows Task Scheduler. My django project is not currently local server deployed but using the manual set up just like activating the virtual ...
Mark Anthony Libres's user avatar
1 vote
2 answers
4k views

'django-admin' is not recognized as an internal or external command, operable program or batch file... So I am getting this error in terminal. I am trying to build an app. First I opened a folder(page)...
Tech-D's user avatar
  • 21
0 votes
1 answer
604 views

I created a custom command in django and I want to use a docker-compose command in it. I use a subprocess as follow: class Command(BaseCommand): def handle(self, *args, **options): data = ...
Kimor's user avatar
  • 612
0 votes
0 answers
412 views

I have an app that deletes files that have been uploaded more than one month ago. from django.core.management.base import BaseCommand, CommandError from blacklist_app.models import EntradaHistorial ...
Jorge's user avatar
  • 353
1 vote
1 answer
371 views

i am trying to store data in from json file and i added its not a problem to add data but when i trigger data again again they copy data and create same new one that i don't want , i want that it will ...
Piotr's user avatar
  • 155
6 votes
4 answers
3k views

Is it allowed to group custom Django commands to separate folders inside the same Django app? I have a lot of them and wanted to group them logically by purpose. Created folders but Django can't find ...
wowkin2's user avatar
  • 6,425
2 votes
1 answer
1k views

I am trying to call the command using args in Django 2.0. When I pass the args it give this error message: "TypeError: Unknown option(s) for dummy command: args. Valid options are: help, no_color, ...
Faizan's user avatar
  • 288
2 votes
1 answer
3k views

I have a Django management commands that I would like to run. I would like to have it available for a user by clicking the button and it would execute it. I do not need help to write one - I have them ...
Radek's user avatar
  • 1,189
4 votes
3 answers
4k views

This question is a simpler version of this 4 years old question without answer Django management command doesn't show logging output from python library: I have a command: class Command(...
Benjamin's user avatar
  • 3,495
2 votes
1 answer
4k views

I have written a simple command to loop through all of Result objects and check its www field (representing URL of the published scientific result eg. https://doi.org/10.1109/5.771073) There is 1M ...
Yevgen Ponomarenko's user avatar
0 votes
0 answers
829 views

I am writing a management command to upload a file to my server. I am able to upload the file to media properly when the file is in the project folder. But i couldn't manage to upload a file from ...
Hskl's user avatar
  • 31
0 votes
1 answer
446 views

Problem Receive 502 bad gateway when i try to execute a django management command via gunicorn Logic Line I think the problem is about permissions, something like gunicorn is not able call the ...
Marcos Mendes's user avatar
1 vote
0 answers
361 views

We have a custom command in a django app that performs synchronization of data with an external service. The command is started hourly. Usually, the command is finished within half an hour or less, ...
pusteblume's user avatar
0 votes
0 answers
507 views

I'm trying to run the command zappa manage staging 'run_sql --sql \"show databases\"' But I get the following error: zappa manage staging 'run_sql --sql "show databases"' [START] RequestId: ...
Vadorequest's user avatar
  • 18.2k
0 votes
1 answer
57 views

Was fighting yesterday with the issue of importing pics from URL to the Django model. Was able to come up with a working solution, but still don't know how this is works. How a save func knows what ...
edvard_munch's user avatar
0 votes
1 answer
1k views

I've written a django command and want to see it's timing so inside django shell_plus I do this: import timeit from django.core.management import call_command timeit.timeit("""call_command('prova')""...
user2239318's user avatar
  • 2,826
2 votes
2 answers
485 views

Is here a way to write a Django command to generate code automatically? In my case: every time I create a new model I must create the following stuff too: Create Administration classes in admin.py ...
user2937998's user avatar
0 votes
0 answers
296 views

I have "xxx" in installed apps (settings.INSTALLED_APPS) Inside this applications, I check on existing schema in Postgresql If schema not exists I throw the exception. I request a user to execute ...
madjardi's user avatar
  • 6,019
-1 votes
1 answer
538 views

I have created a custom command which takes a positional and a named optional argument. It does many checks, downloads a file, unzips it and populates the database with the unzipped data. To make the ...
cezar's user avatar
  • 12.1k
1 vote
2 answers
620 views

I am trying to write a custom django-admin command that executes a celery task, however the task doesn't execute and django just hangs when I try. from django.core.management.base import BaseCommand ...
johnnythejames's user avatar
2 votes
2 answers
2k views

I've scoured the documentation and am looking for a Django setting that disables system checks (not just silences them) in production. I have a project with 20,000+ models which are autogenerated to ...
FlipperPA's user avatar
  • 14.4k
2 votes
3 answers
2k views

I have successfully employed Photologue to present galleries of regularly-created data plot images. Of course, now that the capability has been established, an obscene number of data plots are being ...
Alex Willison's user avatar
2 votes
0 answers
800 views

I have a Django project which is used to remotely call a python script with predefined arguments (retrieved as a string from database). The python script is designed to loop indefinitely until killed/...
Brian Pace's user avatar
4 votes
0 answers
3k views

In an attempt to try to generalize a django app, so it can be run with different configurations defined in yaml files, I wanted to extend the runserver command to take the locations of these ...
ryanjdillon's user avatar
  • 19.2k
-1 votes
1 answer
1k views

I have a view to download a file. I want to create a command to be able to call this view and download the file in a certain folder. class DownloadFile(View): def get(self, request, pk): ....
loar's user avatar
  • 1,785
1 vote
2 answers
3k views

I am writing a django command that takes a bunch of input and processes it. It seems natural that because of the volume of the data, the input should either come in as a file or as stdin. I would ...
McKay's user avatar
  • 12.7k
0 votes
1 answer
135 views

Lets say i have a command like: class Command(object): help = 'roll over and die' def add_arguments(self, parser): parser.add_argument( '--foo', help='see ...
Kazz's user avatar
  • 626
0 votes
1 answer
649 views

class Command(BaseCommand): args = 'Arguments is not needed' help = 'Django admin custom command poc.' def handle(self, *args, **options): db_alias = options.get('olddb') ...
danny's user avatar
  • 11
3 votes
1 answer
4k views

I'd like to filter that implements this "pseudocode": Post.objects.filter(Post.timestamp + Post.duration > datetime.datetime.now()) I also would like to wrap this in a Django management command....
Kaesekante's user avatar
12 votes
2 answers
16k views

I'm trying to build a static site generator using Django (because its resourceful that way), and right now my problems are dealing with the Django command that is supposed to build my static site ...
JellisHeRo's user avatar
1 vote
2 answers
410 views

I have a Django commend "script" that i running every 20 second like this:: (only shows part of it, and works fine ;)) * * * * * /manage.py btupdate * * * * * sleep 20; /manage.py btupdate * * * * * ...
pkdkk's user avatar
  • 3,981