{"id":18614866,"url":"https://github.com/andrewjbateman/python-django-barcode","last_synced_at":"2025-04-11T00:30:59.283Z","repository":{"id":96860853,"uuid":"308930696","full_name":"AndrewJBateman/python-django-barcode","owner":"AndrewJBateman","description":":clipboard: Python-Django app to create \u0026 display barcodes","archived":false,"fork":false,"pushed_at":"2021-06-20T06:57:25.000Z","size":212,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T06:51:13.807Z","etag":null,"topics":["admin-dashboard","barcode","django","images","pip","python","tutorial-code"],"latest_commit_sha":null,"homepage":"","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/AndrewJBateman.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":"2020-10-31T17:01:21.000Z","updated_at":"2023-06-29T15:05:55.000Z","dependencies_parsed_at":"2023-03-30T11:36:32.478Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/python-django-barcode","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/AndrewJBateman%2Fpython-django-barcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fpython-django-barcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fpython-django-barcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fpython-django-barcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/python-django-barcode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322233,"owners_count":21084333,"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":["admin-dashboard","barcode","django","images","pip","python","tutorial-code"],"created_at":"2024-11-07T03:27:15.780Z","updated_at":"2025-04-11T00:30:59.275Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: Python Django BarCode\n\n* Python-Django app to create \u0026 display barcodes\n* Code from a tutorial by [Pyplane](https://www.youtube.com/channel/UCQtHyVB4O4Nwy1ff5qQnyRw) - see [:clap: Inspiration](#clap-inspiration) below\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/python-django-barcode?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/python-django-barcode?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/python-django-barcode?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/python-django-barcode?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Python Django BarCode](#zap-python-django-barcode)\n\t* [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n\t* [:books: General info](#books-general-info)\n\t* [:camera: Screenshots](#camera-screenshots)\n\t* [:signal_strength: Technologies](#signal_strength-technologies)\n\t* [:floppy_disk: Setup](#floppy_disk-setup)\n\t* [:computer: Code Examples](#computer-code-examples)\n\t* [:cool: Features](#cool-features)\n\t* [:clipboard: Status \u0026 To-do list](#clipboard-status--to-do-list)\n\t* [:clap: Inspiration](#clap-inspiration)\n\t* [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* Django framework admin dashboard lets user specify barcode fields. These are converted into a barcode using the `python-barcode` library function and displayed.\n\n## :camera: Screenshots\n\n![screen print](./img/admin.png)\n![screen print](./img/barcode.png)\n\n## :signal_strength: Technologies\n\n* [Python v3](https://www.python.org/) programming language\n* [Django v3](https://www.djangoproject.com/) server-side web framework\n* [python-barcode v0.13.1](https://pypi.org/project/python-barcode/) to create barcode. Supports barcode formats: EAN-8, EAN-13, EAN-14, UPC-A, JAN, ISBN-10, ISBN-13, ISSN, Code 39, Code 128, PZN\n* [Pillow v8](https://pypi.org/project/Pillow/) Python Imaging Library (Fork)\n\n## :floppy_disk: Setup\n\n* [Install Python](https://docs.python-guide.org/starting/installation/)\n* [Install pip](https://docs.python-guide.org/dev/virtualenvs/#installing-pipenv)\n* [Install Django](https://docs.djangoproject.com/en/3.1/howto/windows/) by typing `pip install Django`\n* Run `django-admin startproject barcode_proj` to create a new project [ref. docs](https://docs.djangoproject.com/en/3.1/intro/tutorial01/)\n* Open `barcode_proj` in VS Code\n* Run `python manage.py startapp products` to create Python module\n* Add code\n* Run `pip freeze` to see list of modules installed. [Ref. Docs](https://pip.pypa.io/en/stable/reference/pip_freeze/)\n* Run `python manage.py makemigrations` for changes to models etc.\n* Run `python manage.py migrate` to migrate the migration files.\n* To add a superuser Run `python manage.py createsuperuser --username=joe --email=joe@example.com` [Ref. Docs](https://docs.djangoproject.com/en/3.1/topics/auth/default/)\n* Run `python manage.py runserver` to run server on port 8000 and open /admin console\n\n## :computer: Code Examples\n\n* extract from `products/models.py` by [Pyplane](https://www.youtube.com/channel/UCQtHyVB4O4Nwy1ff5qQnyRw)  showing Product class with fields, a string representation of the product and the bar code\n\n```python\nclass Product(models.Model):\n    name = models.CharField(max_length=200)\n    barcode = models.ImageField(upload_to='images/', blank=True)\n    country_id = models.CharField(max_length=1, null=True)\n    manufacturer_id = models.CharField(max_length=6, null=True)\n    product_id = models.CharField(max_length=5, null=True)\n\n    def __str__(self):\n        return str(self.name)\n\n    def save(self, *args, **kwargs):\n        EAN = barcode.get_barcode_class('ean13')\n        ean = EAN(f'{self.country_id}{self.manufacturer_id}{self.product_id}', writer=ImageWriter())\n        buffer = BytesIO()\n        ean.write(buffer)\n        self.barcode.save(f'{self.name}.png', File(buffer), save=False)\n        return super().save(*args, **kwargs)\n```\n\n## :cool: Features\n\n* Django inbuilt packages - admin dashboard\n\n## :clipboard: Status \u0026 To-do list\n\n* Status: Working\n* To-do: Comment code, complete readme. Change server config so it shows admin panel right away (so not necessary to add `/admin` to server path)\n\n## :clap: Inspiration\n\n* [Pyplane: Youtube: Django barcode generator | How to create barcodes in Django](https://www.youtube.com/watch?v=VDIJ4GgKxR8\u0026t=102s)\n* [python-barcode documentation](https://python-barcode.readthedocs.io/en/stable/barcode.html#creating-barcodes-as-image)\n* [Medium: Shankar Jha: What makes Django cool?](https://medium.com/@shankarj67/what-makes-django-cool-5d7cad83de5c)\n\n## :file_folder: License\n\n* N/A\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fpython-django-barcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fpython-django-barcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fpython-django-barcode/lists"}