rengine icon indicating copy to clipboard operation
rengine copied to clipboard

python manage.py not available

Open catchmeifyoucaan opened this issue 2 years ago • 3 comments

After everything had ran successfully, this is the error i got and there is no manage.py in the directory You have 76 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, dashboard, django_celery_beat, recon_note, scanEngine, sessions, startScan, targetApp. Run 'python manage.py migrate' to apply them. Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) psycopg2.errors.UndefinedTable: relation "auth_user" does not exist LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user... ^

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "manage.py", line 25, in main() File "manage.py", line 21, in main execute_from_command_line(sys.argv) File "/usr/local/lib/python3.8/dist-packages/django/core/management/init.py", line 419, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.8/dist-packages/django/core/management/init.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 79, in execute return super().execute(*args, **options) File "/usr/local/lib/python3.8/dist-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, **options) File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 100, in handle default_username = get_default_username(database=database) File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/management/init.py", line 141, in get_default_username auth_app.User._default_manager.db_manager(database).get( File "/usr/local/lib/python3.8/dist-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 431, in get num = len(clone) File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 262, in len self._fetch_all() File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 1324, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 51, in iter results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql cursor.execute(sql, params) File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 66, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers return executor(sql, params, many, context) File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 90, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/usr/local/lib/python3.8/dist-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: relation "auth_user" does not exist LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user... ^

make: *** [Makefile:28: username] Error 1 Thank you for installing reNgine, happy recon!! this is what im getting and i cant find manage.py in the folder

catchmeifyoucaan avatar Jun 06 '22 07:06 catchmeifyoucaan

👋 Hi @catchmeifyoucaan, Issues is only for reporting a bug/feature request. Please read documentation before raising an issue https://rengine.wiki For very limited support, questions, and discussions, please join reNgine Discord channel: https://discord.gg/azv6fzhNCE Please include all the requested and relevant information when opening a bug report. Improper reports will be closed without any response.

github-actions[bot] avatar Jun 06 '22 07:06 github-actions[bot]

You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): startScan, targetApp. Run 'python manage.py migrate' to apply them.

I also encountered the same problem, how did you solve it?

junanc avatar Jun 08 '22 11:06 junanc

This is a standard Django warning. This means that some modifications to your database are not applied until you run the command specified in the message python manage.py migrate

After cloning the repo, I could find the manage.py file under the rengine/web folder. If this is not there, I would recommend downloading it directly from the repo here, or checking that the integrity of the tools is good by redoing a clean installation.

That being said, the way it is installed, you should not have to apply your migrations if you use docker, as this is done by default

triat avatar Jun 08 '22 12:06 triat

@triat Hi, I tried to run the file as you mention, but i get this error when i run it:

      _   _       _
      | \ | |     (_)

_ __ | | | __ _ _ _ __ ___ | '/ _ \ . |/ _ | | ' \ / _
| | | / |\ | (| | | | | | __/ || _|| _|_, ||| |_|__| v1.3.6 / | |/

Traceback (most recent call last): File "/root/rengine/web/manage.py", line 14, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/root/rengine/web/manage.py", line 25, in main() File "/root/rengine/web/manage.py", line 16, in main raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

roysG avatar Apr 06 '23 18:04 roysG

When i try to scan a site.. the scan start but stack after some time without any error..

roysG avatar Apr 06 '23 18:04 roysG

@triat Hi, I tried to run the file as you mention, but i get this error when i run it:

      _   _       _
      | \ | |     (_)

_ __ | | | __ _ _ _ __ ___ | '/ _ \ . |/ _ | | ' \ / _ | | | / |\ | (| | | | | | __/ || _|| |__, ||| ||_| v1.3.6 / | |/

Traceback (most recent call last): File "/root/rengine/web/manage.py", line 14, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/root/rengine/web/manage.py", line 25, in main() File "/root/rengine/web/manage.py", line 16, in main raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

You can't just run python manage.py migrate. You should run this instead: docker-compose -f docker-compose.yml exec web python3 manage.py migrate.

AnonymousWP avatar Apr 07 '23 08:04 AnonymousWP

Give the permissions to the running file... See the document

בתאריך יום ו׳, 7 באפר׳ 2023, 11:43, מאת AnonymousWP ‏< @.***>:

@triat https://github.com/triat Hi, I tried to run the file as you mention, but i get this error when i run it:

  _   _       _
  | \ | |     (_)

_ __ | | | __ _ _ _ __ ___ | '/ _ \ . |/ _ | | ' \ / _ | | | / |\ | (| | | | | | __/ || _|| |__, ||| ||_| v1.3.6 / | |/

Traceback (most recent call last): File "/root/rengine/web/manage.py", line 14, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/root/rengine/web/manage.py", line 25, in main() File "/root/rengine/web/manage.py", line 16, in main raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

You can't just run python manage.py migrate. You should run this instead: docker-compose -f docker-compose.yml exec web python3 manage.py migrate.

— Reply to this email directly, view it on GitHub https://github.com/yogeshojha/rengine/issues/647#issuecomment-1500078258, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXZDOTKBE3HUEDAOZ2BU6DW77HRRANCNFSM5X6PF36Q . You are receiving this because you commented.Message ID: @.***>

roysG avatar Apr 07 '23 09:04 roysG

Give the permissions to the running file... See the document

בתאריך יום ו׳, 7 באפר׳ 2023, 11:43, מאת AnonymousWP ‏< @.***>:

@triat https://github.com/triat Hi, I tried to run the file as you mention, but i get this error when i run it:

  _   _       _
  | \ | |     (_)

_ __ | | | __ _ _ _ __ ___ | '/ _ \ . |/ _ | | ' \ / _ | | | / |\ | (| | | | | | __/ || _|| |__, ||| ||_| v1.3.6 / | |/

Traceback (most recent call last): File "/root/rengine/web/manage.py", line 14, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/root/rengine/web/manage.py", line 25, in main() File "/root/rengine/web/manage.py", line 16, in main raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

You can't just run python manage.py migrate. You should run this instead: docker-compose -f docker-compose.yml exec web python3 manage.py migrate.

— Reply to this email directly, view it on GitHub https://github.com/yogeshojha/rengine/issues/647#issuecomment-1500078258, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXZDOTKBE3HUEDAOZ2BU6DW77HRRANCNFSM5X6PF36Q . You are receiving this because you commented.Message ID: @.***>

??? Then use sudo.

AnonymousWP avatar Apr 07 '23 10:04 AnonymousWP

You es

בתאריך יום ו׳, 7 באפר׳ 2023, 13:13, מאת AnonymousWP ‏< @.***>:

Give the permissions to the running file... See the document

בתאריך יום ו׳, 7 באפר׳ 2023, 11:43, מאת AnonymousWP ‏< @.***>:

@triat https://github.com/triat https://github.com/triat Hi, I tried to run the file as you mention, but i get this error when i run it:


| \ | | (_)

_ __ | | | __ _ _ _ __ ___ | '/ _ \ . |/ _ | | ' \ / _ | | | / |\ | (| | | | | | __/ || _|| |__, ||| ||_| v1.3.6 / | |/

Traceback (most recent call last): File "/root/rengine/web/manage.py", line 14, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/root/rengine/web/manage.py", line 25, in main() File "/root/rengine/web/manage.py", line 16, in main raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

You can't just run python manage.py migrate. You should run this instead: docker-compose -f docker-compose.yml exec web python3 manage.py migrate.

— Reply to this email directly, view it on GitHub #647 (comment) https://github.com/yogeshojha/rengine/issues/647#issuecomment-1500078258 , or unsubscribe

https://github.com/notifications/unsubscribe-auth/ABXZDOTKBE3HUEDAOZ2BU6DW77HRRANCNFSM5X6PF36Q . You are receiving this because you commented.Message ID: @.***>

??? Then use sudo.

— Reply to this email directly, view it on GitHub https://github.com/yogeshojha/rengine/issues/647#issuecomment-1500148850, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXZDOW6NQI7BABUYJ4VBGLW77SE5ANCNFSM5X6PF36Q . You are receiving this because you commented.Message ID: @.***>

roysG avatar Apr 07 '23 10:04 roysG