# Launch Python shell in the running Docker container docker exec -ti photonix python photonix/manage.py shell # Import Django models from photonix.accounts.models import User from photonix.photos.models import Library, LibraryUser, LibraryPath # Create a user user = User(username='YOUR_USERNAME') user.set_password('YOUR_PASSWORD') user.save() # Create a library library = Library(name='YOUR_NEW_LIBRARY_NAME', classification_color_enabled=True, classification_location_enabled=True, classification_style_enabled=True, classification_object_enabled=True, setup_stage_completed='Th') library.save() # Create a path attached to the library so files can be imported library_path = LibraryPath(library=library, type='St', backend_type='Lo', path='YOUR_PATH_INSIDE_DOCKER_CONTAINER', watch_for_changes=True) library_path.save() # Link the user created above to the library created above library_user = LibraryUser(library=library, user=user, owner=True) # owner=True only if this new library user is going to be in charge of managing it library_user.save() # Alternatively, if you want to be the owner in charge, set owner=False above and then also run this owner_user = User.objects.get(username='demo') library_user = LibraryUser(library=library, user=owner_user, owner=True) library_user.save()
Hey, me again, sorry for the long delay, kids got sick one after the other and then work/life got in the way, but finally got a chance to sit down and play around with this the last couple of days, so have a couple of questions.
Firstly, what's the difference between setting a user as the owner of a library or not? I'm trying to work out which is the right approach for my install.
pip --no-build-isolationwould help or a
oldest-supported-numpybut no luck yet :(