{"id":17461936,"url":"https://github.com/jgcmarins/django-commands","last_synced_at":"2026-05-04T02:31:08.566Z","repository":{"id":79922141,"uuid":"80260241","full_name":"jgcmarins/django-commands","owner":"jgcmarins","description":"A repository that provides information about how to start a new project in Django.","archived":false,"fork":false,"pushed_at":"2017-05-11T22:11:33.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T18:42:26.663Z","etag":null,"topics":["django","framework","introduction","python","python3","tutorial"],"latest_commit_sha":null,"homepage":"https://jgcmarins.github.io/django-commands/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jgcmarins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-28T01:41:25.000Z","updated_at":"2025-02-20T16:39:02.000Z","dependencies_parsed_at":"2023-03-15T20:00:24.777Z","dependency_job_id":null,"html_url":"https://github.com/jgcmarins/django-commands","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jgcmarins/django-commands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgcmarins%2Fdjango-commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgcmarins%2Fdjango-commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgcmarins%2Fdjango-commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgcmarins%2Fdjango-commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgcmarins","download_url":"https://codeload.github.com/jgcmarins/django-commands/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgcmarins%2Fdjango-commands/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32592289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","framework","introduction","python","python3","tutorial"],"created_at":"2024-10-18T07:25:29.036Z","updated_at":"2026-05-04T02:31:08.532Z","avatar_url":"https://github.com/jgcmarins.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ATTENTION\nThis is not any official Django's tutorial. It's just a simplified way to create a new project and start developing fast, avoiding waste of time with some mistaken commands. If you don't know anything about Django, it's highly recommended that you visit Django's official website [https://www.djangoproject.com/](https://www.djangoproject.com/).\n\n## Index\n- [Index](#index)\n- [Description](#description)\n- [Setup](#setup)\n\t- [venv](#venv)\n\t\t- [Activation](#activation)\n\t\t- [Deactivation](#deactivation)\n\t- [Installation](#installation)\n- [Starting our project](#starting-our-project)\n    - [django-admin](#django-admin)\n- [Understanding our project](#understanding-our-project)\n\t- [manage.py](#manage.py)\n- [Creating an app](#creating-an-app)\n    - [app vs model](#app-vs-model)\n    - [Example](#example)\n- [Migrations](#migrations)\n    - [makemigrations](#makemigrations)\n    - [migrate](#migrate)\n- [Let's see things working](#lets-see-things-working)\n- [Congratulations and thanks](#congratulations-and-thanks)\n- [Contribution](#contribution)\n- [License](#license)\n- [TODO](#todo)\n\n## Description\nWhen we work with frameworks, there are some basic rules that we may need to follow. The purpose of this repository is to help us keeping the right way when starting a new project in Django.\n\n## Setup\nFirst things first. Let's setup our work environment.\n\nSo, a good pratice, is to create our project inside a virtual environment. Why? Doing this, we protect all projects from each other. In other words, each Django project can have its own independent set of installed packages.\n\n#### venv\nPython's official library that provides this tool is [venv](https://docs.python.org/3/library/venv.html).\nTo create a virtual environmet, run:\n\n```\npython3 -m venv /path/to/new/virtual/environment\n```\n\n###### Activation\nNow that we have created our virtual environment, let's active it:\n\n```\nsource \u003cvenv\u003e/bin/activate\n```\n\nWhere *\\\u003cvenv\\\u003e* is */path/to/new/virtual/environment*.\n\n###### Deactivation\nTo deactive, just run:\n\n```\ndeactivate\n```\n\n#### Installation\nAlright, now that we have our work environment, let's install Django ~~finally~~. Remember: with virtual environment active, everything we install, will be installed inside our virtual environment. To **install** Django, run:\n\n```\npip3 install django\n```\n\n## Starting our project\nDjango is a powerful framework to build web apps. It helps us building as many web apps as needed. But there is something on top of our web apps: our **BIG** project. The project is the web application itself and it holds lots of apps. To start our project, run:\n\n```\ndjango-admin startproject \u003cproject_name\u003e\n```\n\nDon't forget to choose a good name :wink:\n\n#### django-admin\nFrom Django's official tutorial:\n\u003e **django-admin** is Django’s command-line utility for administrative tasks.\n\n## Understanding our project\nSo far so good? Alright! At this point, our directory shall look like this:\n\n```\nproject_name/\n    manage.py\n    project_name/\n        __init__.py\n        settings.py\n        urls.py\n        wsgi.py\n```\n\n#### manage.py\nFrom Django's official tutorial:\n\u003e **manage.py**: A command-line utility that lets you interact with this Django project in various ways. You can read all the details about **manage.py** in [django-admin and manage.py](https://docs.djangoproject.com/en/1.10/ref/django-admin/).\n\n## Creating an app\nAlright! Now it's time to put some **apps** inside our project. But first, let's understand the difference between an **app** and a **model**.\n\n#### app vs model\nFrom Django's official tutorial:\n\u003e A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the data you’re storing. Generally, each model maps to a single database table.\n\nSo, when we tell Django to start a an app, it creates a set of files and dependencies which will support all work on a model. The command to create a new app is:\n\n```\npython3 manage.py startapp \u003capp_name\u003e\n```\n\n#### Example\nFor example, we are writing a web application that manages an e-commerce. So, our project name is *MyCommerce* and we have this two apps, *Cart* and *Product*. Our project directory should look like this:\n\n```\nMyCommerce/:\n    Cart/\n        admin.py\n        apps.py\n        __init__.py\n        migrations/\n            __init__.py\n        models.py\n        tests.py\n        views.py\n    manage.py\n    MyCommerce/\n        __init__.py\n        __pycache__/\n            __init__.cpython-35.pyc\n            settings.cpython-35.pyc\n        settings.py\n        urls.py\n        wsgi.py\n    Product/\n        admin.py\n        apps.py\n        __init__.py\n        migrations/\n            __init__.py\n        models.py\n        tests.py\n        views.py\n```\n\n## Migrations\nWell done! We're almost ready to start developing our web application!\n\nSo, why Django is incredibly easy? One of the greatest things in Django is it's ability to handle lots of database's bureaucracy for us. It comes with an inner **SQLite** ready and working. All setted up.\n\nTherefore, when we create an app and add some information to it's model, we are telling Django how is our database schema. \n\n#### makemigrations\nTo tell Django that our database schema (for a single model) is ready or updated, we run the following command:\n\n```\npython3 manage.py makemigrations \u003capp_name\u003e\n```\n\n#### migrate\nAnd to tell Django \"ok, now you can apply database changes\", we run:\n\n```\npython3 manage.py migrate\n```\n\n## Let's see things working\nFinally, to checkout our web application running:\n\n```\npython3 manage.py runserver\n```\n\n## Congratulations and thanks\nCongratulations! Now everything is working, ready and waiting for your code. Thanks for arriving here. Hope you enjoyed this little tutorial.\n\n## Contribution\nI am still learning Django so, please, if you find any wrong information, submit an issue or create a pull request. Thanks! :octocat:\n\n## License\n[GPL-3.0](/LICENSE)\n\n## TODO\n- admin page\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgcmarins%2Fdjango-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgcmarins%2Fdjango-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgcmarins%2Fdjango-commands/lists"}