What is ASCII-Generator.site?
ASCII-Generator.site is a Django website for generating ASCII art character maps from images or text 🎨
What is Django?
Django is a free and open source WEB program framework written in Python, which adopts the framework mode of MTV, namely model M, view V and template T. It can help you develop WEB sites faster and easier.
Official experience address: https://ascii-generator.site/
Install in Docker mode on Qunhui.
Search for ASCII Gen in the registry, select the first wbsu2003 / ASCII gen, and select the latest version.
The default port 1234 is used directly
|Local port||Container port|
Image to ASCII
Image to ASCII or Text to ASCII can be selected at the top. The default is image to ASCII. Select a black-and-white picture
For the convenience of explanation, Lao Su processed the official moving picture and divided it into several paragraphs
Try the color map
Old Su uploaded a picture of a star. Can you see who it is?
The answer is revealed at the end of the article
Text to ASCII
Text to ASCII only needs to input transformed text, but Chinese is not supported
Continue moving graph
Considering that most people are not interested in building, Lao Su put the building part behind this time
Dockerfile is built based on the project source code and has made a lot of optimizations. The main reason is that it has been replaced with domestic sources to solve the problems of slow construction and unsuccessful construction. In addition, the image has been reduced from 2G to 1G. Later, it will become the template for Lao Su to build Python and Django projects
I feel there is still room for further optimization. Take your time
FROM python:3.8-slim LABEL maintainer=laosu<email@example.com> # set work directory WORKDIR /ags COPY ./requirements.txt /ags # set environment variables ## Prevent Python from copying pyc files into containers ENV PYTHONDONTWRITEBYTECODE 1 # Ensure that Python output is logged to the terminal so that Django logs can be monitored in real time. ENV PYTHONUNBUFFERED 1 # Environment # Replaceable source: # 1. Aliyuan: mirrors.aliyun.com # 2. Tsinghua source: mirrors.tuna.tsinghua.edu.cn # 3. Netease: mirrors.163.com #RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list \ RUN sed -i s@/deb.debian.org/@/mirrors.163.com/@g /etc/apt/sources.list \ && rm -Rf /var/lib/apt/lists/* \ && apt-get clean \ && apt-get -y update --fix-missing -o Acquire::http::No-Cache=True \ && apt-get install -y python3-pip python3-opencv libpq-dev # Replaceable source: # 1. Tsinghua source: https://pypi.tuna.tsinghua.edu.cn/simple # 2. Douban source: http://pypi.douban.com/simple # 3. Alibaba source: https://mirrors.aliyun.com/pypi/simple # 4. Tencent source: http://mirrors.cloud.tencent.com/pypi/simple RUN pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com \ && pip install -r requirements.txt # copy project COPY . /ags RUN chmod +x manage.py # Application EXPOSE 1234 CMD ["python", "manage.py", "runserver", "0.0.0.0:1234"]
The basic commands for building images and running containers are as follows 👇
# Download code git clone https://github.com/hermanTenuki/ASCII-Generator.site.git ags # Or mirror the site git clone https://hub.fastgit.org/hermanTenuki/ASCII-Generator.site.git ags # Enter directory cd ags # Put the 'Dockerfile' file in the code root directory # Modify the project/settings.py file # 1. Set EASY_RUN_MODE is set from False to True # 2. Set TIME_ZONE='UTC 'changed to ` Asia/Shanghai` # Build mirror docker build -t wbsu2003/asciigen:v1 . # Run container docker run -d \ --name=wbsu2003-asciigen1 \ -p 1234:1234 \ wbsu2003/asciigen:v1
The answer is revealed
hermanTenuki/ASCII-Generator.site: Django website for generating ASCII-arts out of images or text 🎨
Running apt get update in docker reports an error returned a non zero code: 100 - rioka - blog Garden
How to Create Django Docker Images | Engineering Education (EngEd) Program | Section