Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run django-admin clearsessions #253

Open
funkyfuture opened this issue Jun 18, 2021 · 4 comments
Open

Can't run django-admin clearsessions #253

funkyfuture opened this issue Jun 18, 2021 · 4 comments
Labels

Comments

@funkyfuture
Copy link

in order to comply with the GDPR i want to delete unneeded user-generated data. unfortunately Django isn't properly set up in the container. setting the DJANGO_SETTINGS_MODULE environment variable might just solve that.

# docker-compose exec seafile django-admin clearsessions
No Django settings specified.
Unknown command: 'clearsessions'
Type 'django-admin help' for usage.

# docker-compose exec seafile django-admin help

Type 'django-admin help <subcommand>' for help on a specific subcommand.

Available subcommands:

[django]
    check
    compilemessages
    createcachetable
    dbshell
    diffsettings
    dumpdata
    flush
    inspectdb
    loaddata
    makemessages
    makemigrations
    migrate
    runserver
    sendtestemail
    shell
    showmigrations
    sqlflush
    sqlmigrate
    sqlsequencereset
    squashmigrations
    startapp
    startproject
    test
    testserver
Note that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.).
@SkywalkerSpace
Copy link
Contributor

Because the execution of this command requires manage.py in the diango project, and use the script to import the correct environment variables.
The available commands are as follows:docker exec seafile /opt/seafile/seafile-server-latest/seahub.sh python-env /opt/seafile/seafile-server-latest/seahub/manage.py clearsessions

@funkyfuture
Copy link
Author

thanks for the feedback, but i'm not really getting it.

is this one command or are it two that need to be executed consecutively?

what irritates me is the circumstance that there's an extra Python environment within a container. or is this not the case?

@SkywalkerSpace
Copy link
Contributor

SkywalkerSpace commented Aug 13, 2021

This is one command.
Yep, there's an extra Python environment within a container. Because Seafile needs a customized Python environment to run。

@funkyfuture
Copy link
Author

fwiw, the command must call an interpreter within this overengineered commands cascade: docker exec seafile /opt/seafile/seafile-server-latest/seahub.sh python-env python3 /opt/seafile/seafile-server-latest/seahub/manage.py clearsessions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants