Django 官方教程翻译项目[==========] 100/100 7. Writing your first Django app, part 5 [==========] 100/100 8. Writing your first Django app, part 6 [==========] 100/100 9. Writing your first Django app models 4. 5. class Reporter(models.Model): 6. full_name = models.CharField(max_length=70) 7. 8. def __str__(self): # Python 2 下请使用 __unicode__ 9. return self.full_name import Reporter, Article 3. 4. # 现在系统中还没有记者。 5. >>> Reporter.objects.all() 6.7. 8. # 创建一个 Reporter 对象。 9. >>> r = Reporter(full_name='John Smith') 10. 11. # 将对象保存到数据库。save()方法需要被显式调用。 0 码力 | 103 页 | 1.86 MB | 1 年前3
Django 5.1.2 DocumentationCustomize the admin look and feel Customize the admin index page Writing your first Django app, part 8 Installing Django Debug Toolbar Getting help from others Installing other third-party packages What’s generic views | Part 5: Testing | Part 6: Static files | Part 7: Customizing the admin site | Part 8: Adding third- party packages Advanced Tutorials: How to write reusable apps | Writing your first contribution first Django app, part 6 Writing your first Django app, part 7 Writing your first Django app, part 8 Advanced tutorial: How to write reusable apps What to read next Writing your first contribution for0 码力 | 3519 页 | 3.17 MB | 1 年前3
Django 5.1 DocumentationCustomize the admin look and feel Customize the admin index page Writing your first Django app, part 8 Installing Django Debug Toolbar Getting help from others Installing other third-party packages What’s generic views | Part 5: Testing | Part 6: Static files | Part 7: Customizing the admin site | Part 8: Adding third- party packages Advanced Tutorials: How to write reusable apps | Writing your first contribution first Django app, part 6 Writing your first Django app, part 7 Writing your first Django app, part 8 Advanced tutorial: How to write reusable apps What to read next Writing your first contribution for0 码力 | 3513 页 | 3.17 MB | 1 年前3
Django 5.0.x DocumentationCustomize the admin look and feel Customize the admin index page Writing your first Django app, part 8 Installing Django Debug Toolbar Getting help from others Installing other third-party packages What’s generic views | Part 5: Testing | Part 6: Static files | Part 7: Customizing the admin site | Part 8: Adding third- party packages Advanced Tutorials: How to write reusable apps | Writing your first patch first Django app, part 6 Writing your first Django app, part 7 Writing your first Django app, part 8 Advanced tutorial: How to write reusable apps What to read next Writing your first patch for Django0 码力 | 3407 页 | 3.21 MB | 1 年前3
Django Q Documentation
Release 0.2.2Schedules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4 Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . dictionary in your settings.py # settings.py example Q_CLUSTER = { 'name': 'myproject', 'workers': 8, 'recycle': 500, 'timeout': 60, 'compress': True, 'save_limit': 250, 'label': 'Django Q', 'redis': { 'host': 'localhost', 'port': 6379, 'db': 0, 'password': None, 'socket_timeout': None, 'charset': 'utf-8', 'errors': 'strict', 'unix_socket_path': None } For more information on these settings please refer0 码力 | 24 页 | 208.74 KB | 1 年前3
Django 1.11.x Documentationdistributions of Django . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1427 8 Glossary 1429 9 Release notes 1431 9.1 Final releases . . . . . . . . . . . . . . . . . . . . . . Smith> >>> Reporter.objects.get(id=2) Traceback (most recent call last): ... (continues on next page) 8 Chapter 2. Getting started Django Documentation, Release 1.11.30.dev20200305075726 (continued from to it. Many Django apps also provide their documentation online through sites like readthedocs.org. 8. Try building your package with python setup.py sdist (run from inside django-polls). This cre- ates0 码力 | 1878 页 | 6.40 MB | 1 年前3
Django 1.10.x Documentationdistributions of Django . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1393 8 Glossary 1395 9 Release notes 1397 9.1 Final releases . . . . . . . . . . . . . . . . . . . . . . get(id=2) Traceback (most recent call last): ... DoesNotExist: Reporter matching query does not exist. 8 Chapter 2. Getting started Django Documentation, Release 1.10.9.dev20171123183751 # Create an article to it. Many Django apps also provide their documentation online through sites like readthedocs.org. 8. Try building your package with python setup.py sdist (run from inside django-polls). This cre- ates0 码力 | 1817 页 | 6.19 MB | 1 年前3
Django 1.11.x Documentationto it. Many Django apps also provide their documentation online through sites like readthedocs.org. 8. Try building your package with python setup.py sdist (run from inside django-polls). This creates Consequently, we’ll be using the revision of Django just prior to that, commit 4ccfc4439a7add24f8db4ef3960d02ef8ae09887. Navigate into Django’s root directory (that’s the one that contains django, docs, tests revision of Django that we’ll be using in the tutorial below: $ git checkout 4ccfc4439a7add24f8db4ef3960d02ef8ae09887 Running Django’s test suite for the first time When contributing to Django it’s very0 码力 | 2747 页 | 2.67 MB | 1 年前3
Django 1.10.x Documentationto it. Many Django apps also provide their documentation online through sites like readthedocs.org. 8. Try building your package with python setup.py sdist (run from inside django-polls). This creates Consequently, we’ll be using the revision of Django just prior to that, commit 4ccfc4439a7add24f8db4ef3960d02ef8ae09887. Navigate into Django’s root directory (that’s the one that contains django, docs, tests revision of Django that we’ll be using in the tutorial below: $ git checkout 4ccfc4439a7add24f8db4ef3960d02ef8ae09887 Running Django’s test suite for the first time When contributing to Django it’s very0 码力 | 2538 页 | 2.59 MB | 1 年前3
Django Q Documentation
Release 1.3.6dictionary in your settings.py # settings.py example Q_CLUSTER = { 'name': 'myproject', 'workers': 8, 'recycle': 500, 'timeout': 60, 'compress': True, 'save_limit': 250, (continues on next page) 6 Chapter Useful for large payloads, but can add overhead when used with many small packages. Defaults to False 8 Chapter 1. Features Django Q Documentation, Release 1.3.6 1.2.11 save_limit Limits the amount of 'host': 'localhost', 'port': 6379, 'db': 0, 'password': None, 'socket_timeout': None, 'charset': 'utf-8', (continues on next page) 1.2. Configuration 9 Django Q Documentation, Release 1.3.6 (continued0 码力 | 62 页 | 452.10 KB | 1 年前3
共 93 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10













