-
Notifications
You must be signed in to change notification settings - Fork 149
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
Management commands error after protect in Django #107
Comments
FYI, here is a workable example for django, https://github.com/Falldog/pyconcrete/tree/master/example/django For your case, I think that you need to make sure 2 things as below
|
Screenshot before running the program As you can see, the inventory command is present. Here is the result of the program After execution I added import pyconcrete to the manage.py file. Here are its contents:
counter application directory structure
The web application also continues to run after the command is executed But the error persists. Please help me resolve the error. |
It's a litter strange. Can you help to remove all of |
I cleared the python file cache with the command
Result of the command
The error persists. Please help me resolve the error. I suggest that the author of the library reproduce the error on his computer to make sure that my words are correct. |
I can reproduce this issue now. def find_commands(management_dir):
"""
Given a path to a management directory, return a list of all the command
names that are available.
"""
command_dir = os.path.join(management_dir, "commands")
return [
name
for _, name, is_pkg in pkgutil.iter_modules([command_dir])
if not is_pkg and not name.startswith("_")
] Current pyconcrete Metapath solution doesn't compatible with it. Need to implement path_hooks handler. I think it will need some time to add the feature. |
Django doesn't see commands executed from the command line using the manage.py script
protected by the pyconcrete package.
There is an operating system: Ubuntu 22.04.4 LTS x86_64
Interpreter: Python 3.10.12
Packages installed: Django==5.0.6, pyconcrete==0.15.1
Installed compiler: apt-get install gcc python3-dev
To reproduce the error, we used a simple Django project https://github.com/deparkes/simple-django-app.
Next, a simple management command is created in the file counter/management/commands/inventory.py
Its contents are very simple:
Executable files were protected with the command:
After protecting the files, the manage.py script stopped seeing the inventory command.
Command line output:
Please advise how to solve the problem?
The text was updated successfully, but these errors were encountered: