Questions tagged [django-extensions]

django-extensions is a pluggable django app that provides a collection of custom extensions and tools. These include management commands, additional database field, admin extensions and much more.

django-extensions is a pluggable django app that provides a collection of custom extensions and tools. These include management commands, additional database field, admin extensions and much more.

105 questions
29
votes
1 answer

ImportError: No module named django_extensions

I am completely new to python as well as to Django. I got a sample Django Rest project. When I run: python manage.py makemigrations I get the error: ImportError: No module named django_extensions How can I solve this? I am running it in a…
Hari Krishnan
  • 5,992
  • 9
  • 37
  • 55
12
votes
2 answers

Add method imports to shell_plus

In shell_plus, is there a way to automatically import selected helper methods, like the models are? I often open the shell to type: proj = Project.objects.get(project_id="asdf") I want to replace that with: proj = getproj("asdf")
Brett Thomas
  • 1,694
  • 3
  • 15
  • 21
10
votes
5 answers

HTML autocomplete is not working along with Django extension in VSCode

I am currently using the latest version of VSCode and Django. Whenever I enable the Django extension by Baptiste Darthenay, HTML autocomplete stops working. If I disable the Django extension and reload VSCode, it will start to work again. What…
nishorgo
  • 111
  • 1
  • 7
8
votes
1 answer

Django: How do I use UUIDField from django-extensions

How do I use the UUIDField in my model? If i do somefield = UUIDField i get: UUIDField is not defined. I do import uuid on top of my models file. And i have django_extensions in installed apps...
R0b0tn1k
  • 4,256
  • 14
  • 46
  • 64
8
votes
4 answers

Django shell_plus: How to access Jupyter notebook in Docker Container

I am trying to access a Jupyter Notebook created with the shell_plus command from django-extensions in a Docker container. docker-compose -f local.yml run --rm django python manage.py shell_plus --notebook My configuration is based on the answers…
8
votes
2 answers

What is the way to set ipython notebook server parameters when running notebook with django-extensions?

I am using the following command to run an ipython notebook server with django: ./manage.py shell_plus --notebook The server functions as expected. However, I would like to set the port and not launch a browser when starting the server. If I were…
dmmfll
  • 2,666
  • 2
  • 35
  • 41
7
votes
3 answers

django-extensions - Get manage.py shell_plus to save history?

I'm using django-extensions shell_plus command, but it doesn't save the command history (i.e., ↑ does nothing). Any ideas how to fix this?
a paid nerd
  • 30,702
  • 30
  • 134
  • 179
5
votes
2 answers

Display created/modified fields of django_extensions in admin interface

I have a class based on TimeStampedModel from django-extentions: from model_utils.models import TimeStampedModel class MyClass(TimeStampedModel): pass By default in the admin interface the created and modified fields are not displayed in the…
Julio
  • 2,493
  • 4
  • 33
  • 53
5
votes
2 answers

Setting IPython Notebook save directory when using through django_extensions

I am using IPython Notebook through django_extensions: python manage.py shell_plus --notebook This saves the Notebook files to the current folder (Django project folder). How can I change the save location for .ipynb files?
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
4
votes
1 answer

Django-extensions model graph text is just squares

I was trying to visualize the database of a project and saw it was recommended to use django-extensions to do that, so I followed the documentation. What I did was: Install pyparsing and pydot using pip and also install graphviz without pip. Also…
dsax7
  • 1,333
  • 22
  • 36
4
votes
1 answer

Populate existing model objects with AutoSlugField

I need to populate an AutoslugField for already existing model objects. My bad realized that the slug field was so handy and better that using pk for security purposes. I already have model objects (rows) in the database. I want to add the…
unlockme
  • 3,897
  • 3
  • 28
  • 42
4
votes
2 answers

Passing command line arguments in django runscript

Is there a way to pass command line arguments to a script using django runscript ? The script I am trying to run uses argparse to accept command line arguments. Command line execution of the script: ./consumer --arg1 arg1 --arg2 arg2 Both arg1 and…
user3351750
  • 927
  • 13
  • 24
4
votes
1 answer

django-extensions test_error_logging

When running the full set of tests for django i am getting this error: FAIL: test_error_logging (django_extensions.tests.management_command.CommandTest) ---------------------------------------------------------------------- Traceback (most recent…
Calum
  • 2,110
  • 2
  • 22
  • 39
3
votes
1 answer

Why do I get the error "ModuleNotFoundError: No module named 'django-extensions'" when running startapp

I am learning Django through the dj4e course. In my project I have set up django-extensions for a previous section of the course. When I moved to a new section and created a new app with the code python manage.py startapp autos I get the…
3
votes
1 answer

Print sql queries in jupyter notebook with django-extensions plugin

Is it possible to show SQL queries like in this command: python manage.py shell_plus --print-sql but in Jupyter Notebook? I tried this command python manage.py shell_plus --notebook --print-sql but it not worked.
Andrei
  • 1,313
  • 4
  • 18
  • 35
1
2 3 4 5 6 7