django-project-structure/docs/search/search_index.json

1 line
9.2 KiB
JSON
Raw Normal View History

2023-11-26 11:06:21 +00:00
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":""},{"location":"#django-project-structure","title":"Django Project Structure","text":"<p>This is a template/project structure for developing django-based applications - either strictly through the <code>django-rest-framework</code> or just <code>django</code>.</p> <p>The project is meant to be easily clone-able, and used as the starter template for the next big thing you develop. Note, this is a folder structure only, not \u201cbest practices\u201d.</p>"},{"location":"#getting-started","title":"Getting Started","text":"<ol> <li>Since this is a template repository, simply hit \"Use this template\" on GitHub and follow the instructions. Otherwise, you can just clone the repo, remove/add anything you see fit.</li> <li>Run the project using <code>python manage.py runserver</code> and you should see the default success page provided by Django at http://127.0.0.1:8000/.</li> </ol>"},{"location":"#creating-an-app","title":"Creating an App","text":"<ol> <li>Create a folder with the app name in <code>apps</code>. For example: <code>poll</code></li> <li>Run <code>python manage.py startapp poll apps/poll</code> from the root directory of the project</li> </ol>"},{"location":"#project-tree","title":"Project Tree","text":"<pre><code>.\n\u251c\u2500\u2500 apps\n\u2502 \u2514\u2500\u2500 example # A django rest app\n\u2502 \u251c\u2500\u2500 api\n\u2502 \u2502 \u251c\u2500\u2500 v1 # Only the \"presentation\" layer exists here.\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 serializers.py\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 urls.py\n\u2502 \u2502 \u2502 \u2514\u2500\u2500 views.py\n\u2502 \u2502 \u251c\u2500\u2500 v2 # Only the \"presentation\" layer exists here.\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 serializers.py\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 urls.py\n\u2502 \u2502 \u2502 \u2514\u2500\u2500 views.py\n\u2502 \u2502 \u2514\u2500\u2500 __init__.py\n\u2502 \u251c\u2500\u2500 fixtures # Constant \"seeders\" to populate your database\n\u2502 \u251c\u2500\u2500 management\n\u2502 \u2502 \u251c\u2500\u2500 commands # Try and write some database seeders here\n\u2502 \u2502 \u2502 \u2514\u2500\u2500 command.py\n\u2502 \u2502 \u2514\u2500\u2500 __init__.py\n\u2502 \u251c\u2500\u2500 migrations\n\u2502 \u2502 \u2514\u2500\u2500 __init__.py\n\u2502 \u251c\u2500\u2500 templates # App-specific templates go here\n\u2502 \u251c\u2500\u2500 tests # All your integration and unit tests for an app go here.\n\u2502 \u251c\u2500\u2500 admin.py\n\u2502 \u251c\u2500\u2500 apps.py\n\u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u251c\u2500\u2500 models.py\n\u2502 \u251c\u2500\u2500 services.py # Your business logic and data abstractions go here.\n\u2502 \u251c\u2500\u2500 urls.py\n\u2502 \u2514\u2500\u2500 views.py\n\u251c\u2500\u2500 common # An optional folder containing common \"stuff\" for the entire project\n\u251c\u2500\u2500 config\n\u2502 \u251c\u2500\u2500 settings.py\n\u2502 \u251c\u2500\u2500 asgi.py\n\u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u251c\u2500\u2500 urls.py\n\u2502 \u2514\u2500\u2500 wsgi.py\n\u251c\u2500\u2500 deployments # Isolate Dockerfiles and docker-compose files here.\n\u251c\u2500\u2500 docs\n\u2502 \u251c\u2500\u2500 CHANGELOG.md\n\u2502 \u251c\u2500\u2500 CONTRIBUTING.md\n\u2502 \u251c\u2500\u2500 deployment.md\n\u2502 \u251c\u2500\u2500 local-development.md\n\u2502 \u2514\u2500\u2500 swagger.yaml\n\u251c\u2500\u2500 requirements\n\u2502 \u251c\u2500\u2500 common.txt # Same for all environments\n\u2502 \u251c\u2500\u2500 development.txt # Only for a development server\n\u2502 \u251c\u2500\u2500 local.txt # Only for a local server (example: do