Programing/Python
-
[django] DB 생성과 마이그레이션Programing/Python 2019. 4. 9. 07:27
장고 앱에서는 MVT(Model/View/Template) 구조를 가지고 있는데요. 데이터 생성 및 관리를 Model 에서는 database를 사용하고 있습니다. sqlite를 default database로 사용하고 있는데 확장성을 위해서 다른 데이터베이스도 사용이 가능합니다. 이 글에서는 프로젝트 내에 앱과 DB 생성 과정을 정리해 보았습니다. 1. app 생성 $> python manage.py startapp elections 2. app 생성 확인 $> tree ├── elections │ ├── admin.py │ ├── apps.py │ ├── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ └── __pycache__ │ │ └── __init..
-
[python] string formaterPrograming/Python 2019. 4. 8. 15:46
https://pyformat.info/ PyFormat: Using % and .format() for great good! Python has had awesome string formatters for many years but the documentation on them is far too theoretic and technical. With this site we try to show you the most common use-cases covered by the old and new style string formatting API with practical exam pyformat.info input 2 output 1 1 1 1 2 2 2 10 1 2 3 4 5 6 7 8 9 def pr..
-
[Django] 서버주소 0.0.0.0Programing/Python 2019. 4. 8. 10:29
https://en.wikipedia.org/wiki/0.0.0.0 0.0.0.0 - Wikipedia In the Internet Protocol Version 4, the address 0.0.0.0 is a non-routable meta-address used to designate an invalid, unknown or non-applicable target. This address is assigned specific meanings in a number of contexts, such as on clients or on servers.[1] en.wikipedia.org 별도의 설정 없이 서버 외부에서 접근하려면 장고 서버 실행 시 127.0.0.1 대신 0.0.0.0 주소 또는 서버의 실..
-
-
[python] python setting on QtCreatorPrograming/Python 2016. 10. 7. 09:46
안녕하세요. 꿈꾸는 개발자입니다. 다음은 Qt creator 에서 파이썬을 사용하기 위한 방법입니다. 기본적으로 c++ 프로젝트를 생성할순 있지만 파이썬의 경우 사용자 설정이 필요하네요. 1. Run QtCreator 2. Tools > Options > Environment > External tools 3. Add > Add category > Type 'python' 4. Add > Add tool > create a new tools [참고자료] http://stackoverflow.com/questions/24100602/developing-python-applications-in-qt-creator
-