{"id":19600071,"url":"https://github.com/codegeek004/django","last_synced_at":"2025-10-11T18:02:15.410Z","repository":{"id":261529233,"uuid":"884578545","full_name":"codegeek004/django","owner":"codegeek004","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-24T11:03:07.000Z","size":60251,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-09T08:12:37.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codegeek004.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-11-07T02:17:48.000Z","updated_at":"2024-11-24T11:03:10.000Z","dependencies_parsed_at":"2024-11-07T03:36:58.255Z","dependency_job_id":null,"html_url":"https://github.com/codegeek004/django","commit_stats":null,"previous_names":["codegeek004/django"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codegeek004%2Fdjango","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codegeek004%2Fdjango/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codegeek004%2Fdjango/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codegeek004%2Fdjango/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codegeek004","download_url":"https://codeload.github.com/codegeek004/django/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240878208,"owners_count":19872165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-11T09:13:28.820Z","updated_at":"2025-10-11T18:02:15.334Z","avatar_url":"https://github.com/codegeek004.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch3\u003eDjango Tutorial\u003c/h3\u003e\n\u003cp\u003eThis is a django application developed from the official documentation's tutorial. This will explain you the flow of django framework.\u003c/p\u003e\n\u003cp\u003eTo start with we have to create a virtual environment for django and access it.\u003cbr\u003e\n  \u003cpre\u003e\u003ccode\u003epython3 -m venv django-env\nsource django-env/bin/activate\n\u003c/code\u003e\u003c/pre\u003e\u003c/p\u003e\n\u003cp\u003eAfter creating the virtual environment you need to install django\u003c/p\u003e\n\u003ccode\u003epip install django\u003c/code\u003e\n\u003cp\u003eNow you need to bootstrap a django project using the following command\u003c/p\u003e\n\u003ccode\u003edjango-admin startproject mysite django_tutorial\u003c/code\u003e\n\u003cp\u003eNow your directory looks something like this: \u003cpre\u003e\u003ccode\u003edjango_tutorial/\n    manage.py\n    mysite/\n        __init__.py\n        settings.py\n        urls.py\n        asgi.py\n        wsgi.py\u003c/code\u003e\u003c/pre\u003e\u003c/p\u003e\n\u003cp\u003eIn this the manage.py file is used to run the django application(s). The mysite directory is the project. Using this project directory you an create multiple applications.\u003cli\u003eTo start with the first file is __ini__.py which indicates that the directory containing this file should be treated as the python project.\u003c/li\u003e\u003cli\u003esettings.py file is responsible for defining the configurations for our applications. Key components of settings.py\u003c/li\u003e\u003cul\u003e\u003ccode\u003eDEBUG=True\u003c/code\u003e We can turn on or off the debug mode using this. DEBUG should be set to false when application is in production\u003c/ul\u003e\u003cul\u003e\u003ccode\u003eALLOWED_HOSTS['*']\u003c/code\u003e Using this we can specify what are the host/domain names your application could serve. This prevents HTTPS host head attacks\u003c/ul\u003e\u003cul\u003e\u003cpre\u003e\u003ccode\u003eINSTALLED_APPS = [\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'polls',  # Your app\n]\u003c/code\u003e\u003c/pre\u003eINSTALLED_APPS contains django's built in apps and custom apps you have created.\u003c/ul\u003e\n\u003cul\u003e\u003ccode\u003eDATABASES\u003c/code\u003e contains configurations for connecting to your database.\u003c/ul\u003e\n\u003cli\u003eurls.py contains path to all your applications in the django project\u003c/li\u003e\n\u003cli\u003easgi.py is an entry-point for ASGI-compatible web servers to serve your project\u003c/li\u003e\n\u003cli\u003ewsgi.py is an entry-point for WSGI-compatible web servers to serve your project\u003c/li\u003e\u003c/p\u003e\nAfter successfully creating the project you need to make applications. For creating the applications you need to create an app in the same directory.\u003cbr\u003e\u003ccode\u003epython manage.py startapp poll\u003c/code\u003e\n\u003cp\u003eThis will create a app directory poll which is laid out something like this.\u003cpre\u003e\u003ccode\u003epolls/\n    __init__.py\n    admin.py\n    apps.py\n    migrations/\n        __init__.py\n    models.py\n    views.py\u003c/code\u003e\u003c/pre\u003e\u003c/p\u003e\n    \u003cp\u003e\u003cli\u003eJust like the project directory the __init__.py file here too indicates that this file should be treated as a python package which allows you to import modules from this directory.\u003c/li\u003e  \u003c/p\u003e\n    \u003cli\u003eadmin.py file is used for configuring the django admin interface.\u003c/li\u003e\n    \u003cli\u003eapps.py file contains the configurations of the application. It defines the app's name and configurations.\u003c/li\u003e\n    \u003cli\u003ethe migrations directory contains the information about the files migrations which are used to manage changes to your database schema.\u003c/li\u003e\n    \u003cli\u003emodels.py file is where you define the database models. Each model corresponds to a database table and defines the structure of the data.\u003c/li\u003e\n\u003cli\u003e\n  In views.py file you define the views for your application. Views handle the logic behind what data is displayed and how it is presented to the user.\n\u003c/li\u003e\n\u003cp\u003eTo run your application run the command \u003cbr\u003e\u003cpre\u003e\u003ccode\u003epython manage.py runserver\u003c/code\u003e\u003c/pre\u003e. \u003cbr\u003eIf you have any changes in your database run the commands \u003cpre\u003e\u003ccode\u003epython manage.py makemigrations\npython manage.py migrate\u003c/code\u003e\u003c/pre\u003e\u003c/p\u003e\n  \n  \n\n# django\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodegeek004%2Fdjango","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodegeek004%2Fdjango","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodegeek004%2Fdjango/lists"}