{"id":22864498,"url":"https://github.com/darcdev/recuperacion","last_synced_at":"2025-03-31T09:45:07.353Z","repository":{"id":50270859,"uuid":"518658952","full_name":"darcdev/recuperacion","owner":"darcdev","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-28T01:29:18.000Z","size":8491,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T14:22:12.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/darcdev.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}},"created_at":"2022-07-28T01:18:46.000Z","updated_at":"2022-07-28T01:29:25.000Z","dependencies_parsed_at":"2022-08-25T11:20:39.740Z","dependency_job_id":null,"html_url":"https://github.com/darcdev/recuperacion","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/darcdev%2Frecuperacion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darcdev%2Frecuperacion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darcdev%2Frecuperacion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darcdev%2Frecuperacion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darcdev","download_url":"https://codeload.github.com/darcdev/recuperacion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246450405,"owners_count":20779406,"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-12-13T11:28:09.787Z","updated_at":"2025-03-31T09:45:07.331Z","avatar_url":"https://github.com/darcdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# project_name\n\nDjango 3.2.12 + Postgres 11 + Dokku config (Production Ready)\n\n## Documentation ##\n\nThe project has a requirements document which is hosted at the following link:\nhttps://docs.google.com/document/d/1sPXStBqmgArgUppvDD705n8iP_wjbgbnHtVZsB5MZwA\n\n### Kanban ###\n```\nThe visualization and assignment of tasks and project requirements is handled on a Kanban board \nlocated in the Projects tab called \"Base CMS E-Commerce\". In the board there are 5 columns.\n- To Do (pending tasks) \n- In progress (Tasks in progress)\n- Review in progress\n- Reviewer approved\n- Done (tasks/requirements completed)\n\nThe Issues and notes are created in the To Do column. \nNotes are requirements to work in later.\nissues are next or in progress requirements to develop.\n```\n### Steps to change the name of an application in Django: ###\n```\n-An application with the target name must be created.\n-Copy the contents of the application to be renamed into the application with the target name.\n-Delete the content of the application to be renamed. (delete the url in project_name)\n-Execute the migration commands (makegrations and migrate), this is done to delete the DB tables.\n-Delete the folder of the application to rename and delete the application record in the settings(common.py).\n-Ready, you have renamed the app.\n\n```\n### Directory Tree ###\n```\n\n├── main (Main application of the project, use it to add main templates, statics and root routes)\n│   ├── fixtures\n│   │   ├── dev.json (Useful dev fixtures, by default it creates an `admin` user with password `admin`)\n│   │   └── initial.json (Initial fixture loaded on each startup of the project)\n│   ├── migrations\n│   ├── static (Add here the main statics of the app)\n│   ├── templates (Add here the main templates of the app)\n│   ├── admin.py\n│   ├── apps.py\n│   ├── models.py (Main models like City, Config)\n│   ├── tests.py (We hope you will put some tests here :D)\n│   ├── urls.py (Main urls, place the home page here)\n│   └── views.py\n├── media\n├── project_name\n│   ├── settings\n│   │   ├── partials\n│   │   │   └── util.py (Useful functions to be used in settings)\n│   │   ├── common.py (Common settings for different environments)\n│   │   ├── development.py (Settings for the development environment)\n│   │   └── production.py (Settings for production)\n│   ├── urls.py\n│   └── wsgi.py\n├── scripts\n│   ├── command-dev.sh (Commands executed after the development containers are ready)\n│   └── wait-for-it.sh (Dev script to wait for the database to be ready before starting the django app)\n├── static\n├── Dockerfile (Instructions to create the project image with docker)\n├── Makefile (Useful commands)\n├── Procfile (Dokku or Heroku file with startup command)\n├── README.md (This file)\n├── app.json (Dokku deployment configuration)\n├── docker-compose.yml (Config to easily deploy the project in development with docker)\n├── manage.py (Utility to run most django commands)\n└── requirements.txt (Python dependencies to be installed)\n```\n\n### How to install the template ###\n\nClone the repository, and update your origin url: \n```\ngit clone https://github.com/altixco/django-postgres-dokku project_name\ncd project_name\n```\n\nMerge the addons required by your project (Optional):\n```\ngit merge origin/rest\ngit merge origin/webpack\ngit merge origin/push-notifications\n```\n\nRename your project files and directorys:\n```\nmake name=project_name init\n```\n\u003e Info: Make is required, for mac run `brew install make`\n\n\u003e After this command you can already delete the init command inside the `Makefile` \n\nThe command before will remove the `.git` folder so you will have to initialize it again:\n```\ngit init\ngit remote add origin \u003crepository-url\u003e\n```\n\n### How to run the project ###\n\nThe project use docker, so just run:\n\n```\ndocker-compose up\n```\n\n\u003e If it's first time, the images will be created. Sometimes the project doesn't run at first time because the init of postgres, just run again `docker-compose up` and it will work.\n\n*Your app will run in url `localhost:8000`*\n\nTo recreate the docker images after dependencies changes run:\n\n```\ndocker-compose up --build\n```\n\nTo remove the docker containers including database (Useful sometimes when dealing with migrations):\n\n```\ndocker-compose down\n```\n\n### Accessing Administration\n\nThe django admin site of the project can be accessed at `localhost:8000/admin`\n\nBy default the development configuration creates a superuser with the following credentials:\n\n```\nUsername: admin\nPassword: admin\n```\n\n## Production Deployment: ##\n\nThe project is dokku ready, this are the steps to deploy it in your dokku server:\n\n#### Server Side: ####\n\n\u003e This docs does not cover dokku setup, you should already have configured the initial dokku config including ssh keys\n\nCreate app and configure postgres:\n```\ndokku apps:create project_name\ndokku postgres:create project_name\ndokku postgres:link project_name project_name\n```\n\n\u003e If you don't have dokku postgres installed, run this before:\n\u003e `sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git`\n\nCreate the required environment variables:\n```\ndokku config:set project_name ENVIRONMENT=production DJANGO_SECRET_KEY=....\n```\n\nCurrent required environment variables are:\n\n* ENVIRONMENT\n* DJANGO_SECRET_KEY\n* EMAIL_PASSWORD\n\nUse the same command to configure secret credentials for the app\n\n#### Local Side: ####\n\nConfigure the dokku remote:\n\n```\ngit remote add dokku dokku@\u003cmy-dokku-server.com\u003e:project_name\n```\n\nPush your changes and just wait for the magic to happens :D:\n\n```\ngit push dokku master\n```\n\nOptional: To add SSL to the app check:\nhttps://github.com/dokku/dokku-letsencrypt\n\nOptional: Additional nginx configuration (like client_max_body_size) should be placed server side in:\n```\n/home/dokku/\u003capp\u003e/nginx.conf.d/\u003capp\u003e.conf\n```\n\n\u003e Further dokku configuration can be found here: http://dokku.viewdocs.io/dokku/\n\n## Create volume for file storage (jpg, pdf, mp3, mp4, txt): ##\n\nFirst we must connect to the server, with the following command.\n``` \nssh root@137.184.18.181 \n```\nOnce inside the server we list the dokku applications.\n```\ndokku apps:list\n```\nAfter identifying the application to be connected to the volume, we proceed to create the directory (cms-media).\n```\nmkdir -p /var/dir/dokku/data/storage/cms-media\n```\nThen we grant access permissions to the folder and link the project directory to the folder.\n```\nchown -R dokku:dokku /var/dir/dokku/data/storage/cms-media\nchown -R 32767:32767 /var/dir/dokku/data/storage/cms-media\ndokku storage:mount project_name /var/dir/dokku/data/storage/cms-media:/src/media\n```\nThen we restart the application.\n```\ndokku ps:restart project_name\n```\nTo verify that the volume was created successfully.\n```\ndokku storage:report\ncd /var/dir/dokku/data/storage/cms-media\nls -la\n```\n\u003e For more documentation: https://dokku.com/docs~v0.26.8/advanced-usage/persistent-storage/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarcdev%2Frecuperacion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarcdev%2Frecuperacion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarcdev%2Frecuperacion/lists"}