Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
How do I reference my model in a nested folder structure to dump data in Django 3.2?

I'm using Django 3.2 and Python 3.9. I have this project directory setup

+ cbapp
    - manage.py
    - settings.py
    + models
        - __init__.py
        - crypto_currency.py

In my settings.py file, I have

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'cbapp',
]

I want to dump some data to a fixtures file, so I tried

$ python3 manage.py dumpdata cbapp.models.crypto_currency  > ./cbapp/fixtures/crypto_currency.json
CommandError: No installed app with label 'cbapp.models.crypto_currency'.

What's the proper way to reference my model to dump data?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Firstly in cbapp/models/__init__.py I think you have to import all models from crypto_currency.py. Like so: from .crypto_currency import *

Then you should be able to use (Replace CryptoModel with the name of your model):

python3 manage.py dumpdata cbapp.CryptoModel > ./cbapp/fixtures/crypto_currency.json
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!