{"id":18790237,"url":"https://github.com/unistra/django-drybones","last_synced_at":"2025-04-13T14:08:26.127Z","repository":{"id":22638750,"uuid":"25981594","full_name":"unistra/django-drybones","owner":"unistra","description":"A project template for django","archived":false,"fork":false,"pushed_at":"2025-03-21T15:04:51.000Z","size":109,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-13T14:08:20.761Z","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/unistra.png","metadata":{"files":{"readme":"README.rst","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":"2014-10-30T17:18:32.000Z","updated_at":"2025-03-21T15:04:55.000Z","dependencies_parsed_at":"2024-01-08T15:01:32.572Z","dependency_job_id":"1b99446f-2167-442e-b636-5d71e8e72351","html_url":"https://github.com/unistra/django-drybones","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unistra%2Fdjango-drybones","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unistra%2Fdjango-drybones/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unistra%2Fdjango-drybones/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unistra%2Fdjango-drybones/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unistra","download_url":"https://codeload.github.com/unistra/django-drybones/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724631,"owners_count":21151561,"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-07T21:10:43.700Z","updated_at":"2025-04-13T14:08:26.105Z","avatar_url":"https://github.com/unistra.png","language":"Python","readme":"========================\nDjango-drybones\n========================\n\nTemplate pour les projets Django 4.2.\n\nPrérequis\n===================\npip, virtualenv et virtualenvwrapper doivent être installés.\n\nProcédure\n===================\nPour générer un template pour le projet \"**myapp**\" :\n\nCréation de l'environnement virtuel\n-----------------------------------\n\nPour créer l'environnement virtuel, se placer dans le répertoire d'installation du projet::\n\n    $ mkvirtualenv myapp\n\nInstallation de Django\n----------------------\n\nPour installer Django dans l'environnement virtuel::\n\n    $ pip install \"Django\u003e=4.2,\u003c5\"\n\nCréation du projet\n-------------------\n\nPour créer le nouveau projet en utilisant le template de la dernière version de django supportée::\n\n    $ django-admin startproject --template=https://github.com/unistra/django-drybones/archive/master.zip --extension=html,rst,ini,coveragerc --name=Makefile myapp\n\nPour une version spécifique::\n\n    $ django-admin startproject --template=https://github.com/unistra/django-drybones/archive/refs/heads/django3.2.zip --extension=html,rst,ini,coveragerc --name=Makefile myapp\n\nConfiguration du projet\n-----------------------\n\nPour configurer le projet dans l'environnement virtuel::\n\n    $ cd myapp\n    $ setvirtualenvproject $VIRTUAL_ENV $(pwd)\n\n    # Edition du fichier postactivate\n    $ echo \"export DJANGO_SETTINGS_MODULE=myapp.settings.dev\" \u003e\u003e $VIRTUAL_ENV/bin/postactivate\n\n    # Edition du fichier postdeactivate\n    $ echo \"unset DJANGO_SETTINGS_MODULE\" \u003e\u003e $VIRTUAL_ENV/bin/postdeactivate\n\n    # Rechargement de l'environnement virtuel\n    $ workon myapp\n\nInstallation des librairies\n---------------------------\n\nPour installer les librairies ::\n\n    $ cdproject\n    $ pip install -r requirements/dev.txt\n\nLancer le serveur de développement\n----------------------------------\n\nPour finaliser l'installation et lancer le serveur::\n\n    $ chmod u+x manage.py\n    $ ./manage.py migrate\n    $ ./manage.py runserver\n\nGoodies\n-------\n\nVous pouvez ajouter une fonction à vos dotfiles pour faciliter la création d'un projet::\n\n    # inits project for django-drybone project\n    # see https://github.com/unistra/django-drybones\n    # Usage initproject project_name [-p python_version] [-d django_version]\n    # example initproject -p 3.11 -d 4.2\n    function initproject () {\n        unset PYTHON_VERSION\n        unset DJANGO_VERSION\n        declare -g PYTHON_VERSION\n        declare -g PYTHON_PATH=\n        declare -g PYTHON_VERSION_PATH\n        local ARGS\n        test -z \"$1\" \u0026\u0026 {\n                echo -e \"Missing argument. Script usage:\\n\" \"  initproject project_name [-p python_version] [-d django_version]\" \"\\n   example : initproject -p 3.11 -d 3.2 \"\n                return 1\n        } || PROJECT_NAME=$1\n        ARGS=$(getopt --long -o \"p:d:\" \"$@\")\n        eval set -- \"$ARGS\"\n        while true\n        do\n                case \"$1\" in\n                        (-p) PYTHON_VERSION=$2\n                                shift 2 ;;\n                        (-d) DJANGO_VERSION=$2\n                                shift 2 ;;\n                        (*) break ;;\n                esac\n        done\n        PYTHON_VERSION=${PYTHON_VERSION:=3.10}\n        DJANGO_VERSION=${DJANGO_VERSION:=4.2}\n        PYTHON_VERSION_PATH=$( which python$PYTHON_VERSION )\n        mkvirtualenv \"$PROJECT_NAME\" -p \"$PYTHON_VERSION_PATH\" \u003e\u00262 || {\n            echo \"Virtualenv creation failed\" \u003e\u00262\n            return 1\n        }\n        workon \"$PROJECT_NAME\"\n        pip install \"Django==$DJANGO_VERSION\" || {\n            echo \"Django installation failed\" \u003e\u00262\n            return 1\n        }\n        django-admin startproject --template=\"https://github.com/unistra/django-drybones/archive/refs/heads/django$DJANGO_VERSION.zip\" --extension=html,rst,ini,coveragerc --name=Makefile \"$PROJECT_NAME\" \u003e\u00262 || {\n            echo \"Project creation failed (maybe wrong django version)\" \u003e\u00262\n            return 1\n        }\n        cd \"$PROJECT_NAME\" || {\n            echo \"No app directory\" \u003e\u00262\n            return 1\n        }\n        setvirtualenvproject \"$VIRTUAL_ENV\" \"$PWD\"\n        echo \"export DJANGO_SETTINGS_MODULE=$PROJECT_NAME.settings.dev\" \u003e\u003e \"$VIRTUAL_ENV/bin/postactivate\"\n        echo \"unset DJANGO_SETTINGS_MODULE\" \u003e\u003e \"$VIRTUAL_ENV/bin/postdeactivate\"\n        workon \"$PROJECT_NAME\"\n        chmod +x manage.py\n        pip install -r requirements/dev.txt\n    }\n\nEt ensuite pour creer le virtualenv, installer django et initialiser le projet::\n\n    $ initproject mon_projet\n\npour preciser la version de python et/ou de django -p pour la version de python et -d pour la version de django::\n\n    $ initproject mon_projet -p 3.12 -d 4.2\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funistra%2Fdjango-drybones","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funistra%2Fdjango-drybones","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funistra%2Fdjango-drybones/lists"}