bartTC / django-attachments

A generic Django application to attach Files (Attachments) to any model.
BSD 3-Clause "New" or "Revised" License
296 stars 90 forks source link

Add test model with UUID primary key. Refs #94 #99

Closed atodorov closed 1 year ago

atodorov commented 1 year ago

@bartTC how do I update attachments/tests/testapp/migrations/ ? What command do you use? I'm not seeing a manage.py here.

bartTC commented 1 year ago

This is where pipenv comes into play. It basically creates a virtualenv for you. With the right ENV variables (loaded from .env)

# pip install pipenv

# ~/Workspace/django-attachments master
$ pipenv install
Loading .env environment variables...
Installing dependencies from Pipfile.lock (a053bc)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

# ~/Workspace/django-attachments master
$ pipenv run django-admin makemigrations --dry-run
Loading .env environment variables...
System check identified some issues:

WARNINGS:
testapp.TestModel: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
    HINT: Configure the DEFAULT_AUTO_FIELD setting or the AppConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
No changes detected