Posts
Q&A
ํด๋์ค์ ๊ดํด์ ์ง๋ฌธ๋๋ฆฝ๋๋ค.
a = japan('tokyo', '100๋ง', '์ฐ์')print(a.__dict__)a.foods('๋๊น์ค', 1000)b = aprint(b.__dict__)##๊ฒฐ๊ณผ{'name': 'tokyo', 'population': '100๋ง', 'economy': '์ฐ์'} {'name': '๋๊น์ค', 'population': '100๋ง', 'economy': '์ฐ์', 'price': 1000} foods๋ผ๋ ํจ์๋ ์ ์คํ์ํค์ จ๊ณ ์ ๊ทธ ํจ์๋ฅผ ์คํ์ํค๋ฉด a์ ๊ฐ์ด ๋ณํฉ๋๋ค. ํ์ง๋ง foods ํจ์๋ ๋ฆฌํด๊ฐ์ด ์๊ธฐ ๋๋ฌธ์ด ๊ทธ ๊ฒฐ๊ณผ๋ฅผ b์๋ค ๋ฃ์ผ๋ ค๊ณ ํด๋ ๋ฃ์ ๊ฒ์ด ์์ต๋๋ค. ๊ตณ์ด b๋ฅผ ๋ฐ๊พธ์๊ฒ ๋ค๋ฉด a์ food ํจ์๋ฅผ ์จ์ ๊ฐ์ ๋ฐ๊พธ๊ณ a๋ฅผ b์ ๋์ ํ์ ์ผ ํ ๊ฒ์ ๋๋ค. ํ์ง๋ง ์ฝ๋์ ๋ฌธ์ ๋ name์ด 'tokyo'์์ '๋๊น์ค'๋ก ๋ฐ๋ ๋ถ๋ถ๋ ์์ต๋๋ค. ์์ ์ด๋ฆ์ ์ถ๊ฐํ๊ณ ์ถ์ผ์๋ค๋ฉด foods ํจ์์ self.name = name์ self.foodname = name ๋ฑ์ผ๋ก ๋ฐ๊พธ๋ ๊ฒ์ด ํ์ํด ๋ณด์ ๋๋ค.
- 0
- 1
- 214
Q&A
61๊ฐ ์งํ์ค์ ์๋ฌ๊ฐ ๋ฉ๋๋ค.
๋ฌธ์ ๋ ํด๊ฒฐํ์ต๋๋ค. ์ ๊ฐ ์ค๋ฅ๋ด์ฉ์ ๋๋ฌด ์งง๊ฒ ์ฌ๋ ค๋จ๋ค์ ใ ใ ์์ ํ ์ค์ด ๋ ์์์ต๋๋ค. collectstatic ์๋ฌ ์ ๋ถ๋ ์๋์ ๊ฐ์ต๋๋ค. ๊ตฌ๊ธ๋ง์ ํด์ RUN python manage.py collectstatic --noinput ์ผ๋ก ๋ช ๋ น์ด๋ฅผ ๋ฐ๋๋๊น ์ฑ๊ณตํ๋๋ฐ ์ด๋๋ ๋ฌธ์ ๊ฐ ์์๊น์? Step 10/12 : RUN python manage.py collectstatic ---> Running in 65fa9291ebdb You have requested to collect static files at the destination location as specified in your settings: /home/SynapseComponent/_static This will overwrite existing files! Are you sure you want to do this? Type 'yes' to continue, or 'no' to cancel: Traceback (most recent call last): File "/home/SynapseComponent/manage.py", line 22, in main() File "/home/SynapseComponent/manage.py", line 18, in main execute_from_command_line(sys.argv) File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, **options) File "/usr/local/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 184, in handle if input(''.join(message)) != 'yes': EOFError : EOF when reading a line The command '/bin/sh -c python manage.py collectstatic' returned a non-zero code: 1
- 1
- 1
- 606
Q&A
39๊ฐ) 0.0.0.0:8000์ผ๋ก ์ ์ํ๋ ค๊ณ ํ๋๋ฐ ๋ชจ๋ฐ์ผ์์ ์ค๋ฅ๊ฐ ๋จ๋ค์
ํน์ ๋ชฐ๋ผ์ 192.168.0.8:8000 ์ผ๋ก ์ ์ํ๋๋ ์ ๋๋ค์? ์๋ ์ด๋ ๊ฒ ํ๋ ๊ฑด๊ฐ์??
- 1
- 1
- 1.2K