django 创建App 提示CommandError: ‘apps‘ conflicts with the name of an existing Python module and cannot

最近使用django创建app到指定目录:

python manage.py startapp users apps/

报如下错误:

(venv) PS D:\project\python\DjangoDemo> python manage.py startapp users apps      
CommandError: 'apps' conflicts with the name of an existing Python module and cannot be used as an app directory. Please try another directory.

项目结构如下:

解决方法:

在apps 目录下再次创建一个users目录,执行该命令得到解决:

python manage.py startapp users apps/users

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Contents Acknowledgments xiii Introduction xxi Part I: Introduction to Python Frameworks Chapter 1: Web 2.0, Python, and Frameworks 3 The Starting Line 4 What’s Web 2.0? 4 The History of Application Design for Content Creation (In One Easy Dose) 4 The Role of AJAX in Web 2.0 10 Leveraging the Power of DSLs 10 Leveraging the Power of TurboGears 11 Leveraging the Power of Django 12 Leveraging the Power of Python 12 Comparing the Frameworks 13 The Historical Perspective 13 Controller Invocation 14 Summary 17 Chapter 2: Web 2.0 with Traditional Python 19 Old-School Web Technologies 19 XML 19 HTML 21 HTTP 23 SQL 24 JavaScript 25 CGI and Python 25 A Simple Example 25 Architecture 29 The HTML Page 30 The JavaScript Code 33 The Database 38 The Python CGI Program 42 Summary 45 ftoc.indd xv 9/10/07 11:33:01 AM xvi Chapter 3: Introducing the Frameworks 47 Web Application Frameworks 48 MVC in Web Application Frameworks 48 Common Web Application Framework Capabilities 50 Introduction to TurboGears 52 TurboGears History 52 Main TurboGears Components 52 Alternate Components 53 MVC Architecture in TurboGears 53 Creating an Example Application 54 The Controller and View 61 Introduction to Django 71 Django History 71 Main Django Components 71 Alternate Components 72 MVC Architecture in Django 72 Creating an Example Application 73 Summary 92 Part II: TurboGears Chapter 4: Introduction to TurboGears 101 TurboGears Components 101 TurboGears Models (SQLObjects) 101 TurboGears Controllers 102 TurboGears Views (Kid Templates and MochiKit) 103 TurboGears Widgets 104 An Example: A Simple Blog Site 104 Creating the Project 105 Defining the Model 105 Using TGCrud 108 Creating the Blog Author Views with TGCrud 110 Creating the Blog Entry Views with TGCrud 118 Replacing the Blog Welcome Page 128 Changing Your Site’s Look and Feel 131 Summary 136 Chapter 5: User Identity and Visitor Tracking 137 Tracking Visits through Cookies 138 Managing User Identity 140 Contents ftoc.indd xvi 9/10/07 11:33:03 AM xvii User Identity Model Objects 140 Identity Configuration Options 143 Other Identity Framework Components 144 Using the Identity Model Objects 144 Using the Identity Module 150 Visitor Tracking 159 Visitor Tracking Model Objects 160 Visitor Tracking Configuration Options 161 Visitor Tracking Plug-Ins 162 Adding Visitor Tracking 162 Summary 168 Chapter 6: Widgets 169 TurboGears Widgets 170 Using the Widget Browser 172 Using Existing Widgets 173 Defining the Model Object 173 Accepting User Comments 174 Creating New Widgets 185 Creating a Simple Hello Widget 185 Creating a Comment Widget 189 Summary 201 Chapter 7: Advanced TurboGears Topics 203 Your Assignment 204 The Operational Concept 205 Designing the Model 206 TurboGears Toolbox 206 The Model 210 The Controller 216 The View 227 Adding RSS Feed Capability 234 Summary 237 Part III: Django Chapter 8: Dblog: A Blog Implemented in Django 241 Django Design Philosophies 241 An Example: A Simple Blog Site 242 Contents ftoc.indd xvii 9/10/07 11:33:03 AM xviii Initializing the Project 242 Initializing the Application 245 Creating the Model 246 Exploring the Model with Django’s Admin Interface 251 Creating the Views 255 Summary 273 Chapter 9: Django Views and Users 275 Template Inheritance 276 The DRY Problem 276 Defining a Base Template 277 Using the {% extends %} Directive 279 Generic Views 282 List-Detail Generic Views 282 Other Generic Views 284 User Authentication and Authorization 285 Installing User Management 285 The User Model 286 Authenticating a User 287 Enhancing the Base Template 290 User Permissions 293 Creating a User 297 Summary 303 Chapter 10: Advanced Django Topics: AJAX, RSS, and More 305 AJAX and Django 306 MochiKit 306 Django Serialization for AJAX 307 AJAX-ified Blog Example 311 Django Add-Ons 320 django.contrib Add-Ons 320 Other Add-Ons 321 RSS in Detail 321 Deploying Django with Apache HTTPD 327 Installing and Configuring Apache 327 Configuring Other Items 328 Summary 329 Contents ftoc.indd xviii 9/10/07 11:33:03 AM xix Part IV: Advanced Client-Side Topics Chapter 11: MochiKit — Pythonic JavaScripting 337 Why MochiKit? 338 What Is MochiKit? 341 What’s Inside MochiKit? 341 MochiKit.Async 342 MochiKit.Base 349 MochiKit.DOM 351 MochiKit.Logging 352 MochiKit.Signal 352 MochiKit.Visual 355 MochiKit Miscellany 357 Summary 357 Chapter 12: Flash-Based Interfaces and TurboGears 359 The Flex Difference 359 What’s Flex and Why Should I Use It? 360 A Flex2-based Blog 380 The Supporting Model 381 The Application Controller 382 The Flex Front-End 384 FBlog’s MXML Implementation 385 Deconstructing FBlog 387 Summary 392 Appendix A: Tools Used 395 Index 405
Author: Audrey Roy Greenfeld, Daniel Roy Greenfeld Length: 556 pages Edition: 1 Publication Date: 2017-06-30 table: Chapter 1: Coding Style Chapter 2: The Optimal Django Environment Setup Chapter 3: How to Lay Out Django Projects Chapter 4: Fundamentals of Django App Design Chapter 5: Settings and Requirements Files Chapter 6: Model Best Practices Chapter 7: Queries and the Database Layer Chapter 8: Function- and Class-Based Views Chapter 9: Best Practices for Function-Based Views Chapter 10: Best Practices for Class-Based Views Chapter 11: Form Fundamentals Chapter 12: Common Patterns for Forms Chapter 13: Templates: Best Practices Chapter 14: Template Tags and Filters Chapter 15: Django Templates and Jinja2 Chapter 16: Building REST APIs with Django REST Framework (NEW) Chapter 17: Consuming REST APIs Chapter 18: Tradeoffs of Replacing Core Components Chapter 19: Working With the Django Admin Chapter 20: Dealing with the User Model Chapter 21: Django's Secret Sauce: Third-Party Packages Chapter 22: Testing Chapter of Doom! Chapter 23: Documentation: Be Obsessed Chapter 24: Finding and Reducing Bottlenecks Chapter 25: Security Best Practices Chapter 26: Logging: What's It For, Anyway? Chapter 27: Signals: Use Cases and Avoidance Techniques Chapter 28: What About Those Random Utilities? Chapter 29: Deployment: Platforms as a Service Chapter 30: Deploying Django Projects Chapter 31: Continuous Integration Chapter 32: The Art of Debugging Chapter 33: Where and How to Ask Django Questions Chapter 34: Closing Thoughts Appendix A: Packages Mentioned in This Book Appendix B: Troubleshooting Installation Appendix C: Additional Resources Appendix D: Internationalization and Localization Appendix E: Settings Alternatives Appendix F: Advice for Python 2.7 Users (NEW) Appendix G: Security Settings Reference Appendix H: Handling Security Failures (NEW) Appendix i: Channels and Websockets (NEW) Acknowledgments Index

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值