{"id":27072809,"url":"https://github.com/hong539/image_board","last_synced_at":"2025-04-05T23:33:53.848Z","repository":{"id":207581447,"uuid":"719556451","full_name":"hong539/image_board","owner":"hong539","description":"make a image board with Django","archived":false,"fork":false,"pushed_at":"2024-03-11T14:04:06.000Z","size":130,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-11T15:31:28.303Z","etag":null,"topics":["django","imageboard","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hong539.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}},"created_at":"2023-11-16T12:24:33.000Z","updated_at":"2024-03-02T06:52:09.000Z","dependencies_parsed_at":"2023-11-24T14:48:07.963Z","dependency_job_id":null,"html_url":"https://github.com/hong539/image_board","commit_stats":null,"previous_names":["hong539/image_board"],"tags_count":0,"template":false,"template_full_name":"hong539/local_library_website","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hong539%2Fimage_board","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hong539%2Fimage_board/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hong539%2Fimage_board/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hong539%2Fimage_board/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hong539","download_url":"https://codeload.github.com/hong539/image_board/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415825,"owners_count":20935384,"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":["django","imageboard","python"],"created_at":"2025-04-05T23:33:53.170Z","updated_at":"2025-04-05T23:33:53.841Z","avatar_url":"https://github.com/hong539.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image_board\n\n## To-do-list\n\n* reference implementation\n    * [pinry](https://github.com/pinry/pinry)\n    * [Boorunaut](https://pypi.org/project/Boorunaut/)\n    * [forked from gnstaxo/imageboard](https://github.com/hong539/imageboard)\n    * [szurubooru](https://github.com/rr-/szurubooru)\n        * Image board engine, Danbooru-style.\n    * [A Complete Beginner's Guide to Django - Part 1](https://simpleisbetterthancomplex.com/series/2017/09/04/a-complete-beginners-guide-to-django-part-1.html)\n* app post:\n    * How to render images/video Thumbnail?\n    * edit views/PostDetail to make query for two models(Post/Comment) or even combine them into one to render template post_detail.html\n        * [ForeignKey.related_name](https://docs.djangoproject.com/en/4.2/ref/models/fields/#django.db.models.ForeignKey.related_name)\n            * edit/checkt post_detail.html\n            * To display the comments associated with the post, you can use the related_name attribute in the ForeignKey field of the Comment model. Here’s an example:\n            * post is the Post object that we want to display comments for, and comments is the related_name that we defined in the ForeignKey field of the Comment model.\n* app accounts:\n    * custom login/logged out page\n    * user permission relations\n\n## Prerequisites\n\n* Linux host such as Arch Linux, Debian, Ubuntu, RHEL ...etc\n* Python \u003e= 3.10\n* [pyenv+poetry](https://github.com/hong539/setup_dev_environment/blob/main/programming_languages/python/python.md#usage-with-pyenvpoetry)\n    * pyenv for Python versions control\n    * poetry for Project dependency control\n    * Project dependcy detialls will be in pyproject.toml/poetry.lock\n* MySQL\n    * [docker hub/MySQL](https://hub.docker.com/_/mysql)\n    * [MySQL 8.0 Reference Manual](https://dev.mysql.com/doc/refman/8.0/en/)\n    * [教學課程：使用 MySQL 和 Docker Compose 建立多容器應用程式](https://learn.microsoft.com/zh-tw/visualstudio/docker/tutorials/tutorial-multi-container-app-mysql)\n* tree\n    * a CLI tools to list contents of directories in a tree-like format.\n* docker/podman (just pickup one to do conatiner image building and running)\n\n## Quick Start\n\n```shell\n#spawns a virtual environment\npoetry shell\n\n#add packages\n#src: https://python-poetry.org/docs/cli/#add\npoetry add django\npoetry add gunicorn\npoetry add diagrams -G dev\npoetry add django-environ==0.10.0\n\n#remove packages\npoetry remove diagrams\npoetry remove django-environ\n\n#for help\npython3 manage.py help\n\n#Creating a superuser for Django CMS system\npython3 manage.py createsuperuser\n\n#run devserver\npython manage.py runserver 8080\n\n\n#check gunicorn\ngunicorn --version\n#run with gunicorn\n#some test codes in misc\ngunicorn --workers=2 test_gunicorn01:app\n#run with django project\n#src: https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/gunicorn/\ngunicorn locallibrary.wsgi\n\n\n#Warning: You'll need to run these commands every time your models change in a way that will affect the structure of the data that needs to be stored (including both addition and removal of whole models and individual fields).\npython3 manage.py makemigrations\npython3 manage.py migrate\n\npython3 manage.py sqlmigrate posts 0001\n\n#run test\npython3 manage.py test\n#Showing more test information\npython3 manage.py test --verbosity 2\n#Speeding things up\npython3 manage.py test --parallel auto\n#Running specific tests\npython3 manage.py test catalog.tests.test_models\npython3 manage.py test catalog.tests.test_views\npython3 manage.py test catalog.tests.test_forms\n\n#deploy check\npython3 manage.py check --deploy\n\n#Starts the Python interactive interpreter\npython3 manage.py shell\n\n#src: https://docs.python.org/3.8/library/sys.html#sys.path\n#A list of strings that specifies the search path for modules. \n#Initialized from the environment variable PYTHONPATH, plus an installation-dependent default.\npython -c \"import sys; print(sys.path)\"\n\n#add env PYTHONPATH\nexport PYTHONPATH=/path/to/your/module:$PYTHONPATH\n\n#add packages by poetry\npoetry add \"psycopg[binary,pool]\"\npoetry add django-environ\n\n#add packages by poetry to extras section\npoetry add diagrams --optional --extras diagrams\n\n#export requirements.txt if needed\npoetry export -f requirements.txt --output requirements.txt\npoetry export -f requirements.txt --output requirements.txt --without-hashes\n```\n\n## Test\n\n* [django / pass multiple models to my ListView](https://stackoverflow.com/questions/67223248/django-pass-multiple-models-to-my-listview)\n* table join\n* [Changing to a custom user model mid-project](https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#changing-to-a-custom-user-model-mid-project)\n* [Writing your first Django app, part 2](https://docs.djangoproject.com/en/4.2/intro/tutorial02/)\n* [Playing with the API](https://docs.djangoproject.com/en/4.2/intro/tutorial02/#playing-with-the-api)\n* [get_user_model()](https://docs.djangoproject.com/en/4.2/topics/auth/customizing/#django.contrib.auth.get_user_model)\n* [[Day24] - Django-REST-Framework User Management](https://ithelp.ithome.com.tw/articles/10278976)\n* [django.contrib.auth](https://docs.djangoproject.com/en/4.2/ref/contrib/auth/)\n* [Django_BBS](https://github.com/devbruce/Django_BBS)\n\n```shell\n$ python manage.py shell\n\u003e\u003e\u003e from django.contrib.auth import get_user_model\n\u003e\u003e\u003e from myapp.models import BlogPost\n\u003e\u003e\u003e user = get_user_model().objects.create_user(username='testuser', password='12345')\n\u003e\u003e\u003e post = BlogPost.objects.create(author=user, date='2023-11-16', title='Test Post', post='This is a test post.')\n\u003e\u003e\u003e post.author.username\n'testuser'\n```\n\n## Misc\n\n* [chatgpt-line-bot](https://github.com/Lin-jun-xiang/chatgpt-line-bot)\n* [gpt4free](https://github.com/xtekky/gpt4free)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhong539%2Fimage_board","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhong539%2Fimage_board","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhong539%2Fimage_board/lists"}