Starting Django project with Docker

180 views
Skip to first unread message

Prabakaran Balaji

unread,
Sep 26, 2022, 8:12:56 AM9/26/22
to django...@googlegroups.com
Hello Django Geeks,

Looking for geeks' insight for docker related issues. I'm not able to run the command "docker-compose run --rm app sh -c "django-admin startproject app ."

Error - 
Traceback (most recent call last):
  File "/py/bin/django-admin", line 8, in <module>
    sys.exit(execute_from_command_line())
  File "/py/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/py/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/py/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/py/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/py/lib/python3.9/site-packages/django/core/management/commands/startproject.py", line 21, in handle
    super().handle('project', project_name, target, **options)
  File "/py/lib/python3.9/site-packages/django/core/management/templates.py", line 160, in handle
    with open(new_path, 'w', encoding='utf-8') as new_file:
PermissionError: [Errno 13] Permission denied: '/app/manage.py'

Attaching docker related files and directory structure screenshot.
image.png


Will be waiting for your valuable inputs.

docker-compose.yml
Dockerfile

Makrand

unread,
Sep 26, 2022, 8:58:49 AM9/26/22
to django...@googlegroups.com
I can handle cloud related work


From: django...@googlegroups.com <django...@googlegroups.com> on behalf of Prabakaran Balaji <prabu...@gmail.com>
Sent: Monday, September 26, 2022 5:41:30 PM
To: django...@googlegroups.com <django...@googlegroups.com>
Subject: Starting Django project with Docker
 
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK7fxT-m%3D5LMFF%2ByikZ6571eSo3xMuyc6ZGDtLtrE4fd_naz%2BA%40mail.gmail.com.

Yeboah Dominic

unread,
Sep 26, 2022, 8:59:07 AM9/26/22
to django...@googlegroups.com
I think you have to give that user permission.
Like 'sudo chown -R root:root /home/dominic/app' or sudo chown -R dominic:dominic /home/dominic/app


 

Makrand

unread,
Sep 26, 2022, 9:02:05 AM9/26/22
to django...@googlegroups.com
My number is+91 99301 02832
From: django...@googlegroups.com <django...@googlegroups.com> on behalf of Yeboah Dominic <yebo...@gmail.com>
Sent: Monday, September 26, 2022 10:27:31 PM
To: django...@googlegroups.com <django...@googlegroups.com>
Subject: Re: Starting Django project with Docker
 

sham khan

unread,
Sep 26, 2022, 9:16:36 AM9/26/22
to Django users
You need to assign a permission(chown of the folder /app)

Prabakaran Balaji

unread,
Sep 27, 2022, 5:37:04 AM9/27/22
to django...@googlegroups.com, shamim...@gmail.com, yebo...@gmail.com
Hello Folks,

I tried to set the permission on app directory, but still facing the same problem. Any additional thoughts?
image.png


Thanks and regards,
Prabakaran


Kasper Laudrup

unread,
Sep 27, 2022, 8:51:06 AM9/27/22
to django...@googlegroups.com
On 27/09/2022 11.35, Prabakaran Balaji wrote:
> Hello Folks,
>
> I tried to set the permission on app directory, but still facing the
> same problem. Any additional thoughts?

Which permission did you set? It looks like you set the owner of the app
directory to your user.

Is your user the same as the one running the app?
Which directory are you trying to write to?
Is it the same as the application directory?
The user running the app needs write permissions to that directory.

Do you know the basics of Unix permissions? Otherwise that might be a
good place to start:

https://www.softwaretestinghelp.com/unix-permissions/

This was just the first link I found but it looks OK.

If you do already know how Unix permissions work you need to dig a bit
more into which permissions are actually being required instead of just
setting them blindly and hoping it works.

Kind regards,

Kasper Laudrup

amruth bitla

unread,
Sep 27, 2022, 10:41:37 AM9/27/22
to django...@googlegroups.com
I really want to start with docker with atleast 2 to 5 guys

Kazuya Nomura

unread,
Sep 28, 2022, 9:41:08 AM9/28/22
to Django users
Please add me
If you could please add my git account in your project.

Jishnu C K

unread,
Oct 3, 2022, 3:14:29 PM10/3/22
to django...@googlegroups.com
https://medium.com/me/stats/post/58f063097f43

Django: Rendering custom models dynamically using generators.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages