{"id":16419728,"url":"https://github.com/ericls/djanurl","last_synced_at":"2025-03-23T07:31:45.517Z","repository":{"id":73515354,"uuid":"55882477","full_name":"ericls/djanurl","owner":"ericls","description":"Django URL shortener project","archived":false,"fork":false,"pushed_at":"2016-06-04T18:24:18.000Z","size":295,"stargazers_count":21,"open_issues_count":1,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T18:44:49.563Z","etag":null,"topics":["django","url-shortener"],"latest_commit_sha":null,"homepage":"http://www.ovz.im/","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/ericls.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":"2016-04-10T05:29:21.000Z","updated_at":"2022-10-01T09:09:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"a7862a4b-a6b6-4192-a6e1-8af104c7e36d","html_url":"https://github.com/ericls/djanurl","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/ericls%2Fdjanurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericls%2Fdjanurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericls%2Fdjanurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericls%2Fdjanurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericls","download_url":"https://codeload.github.com/ericls/djanurl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245071808,"owners_count":20556352,"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","url-shortener"],"created_at":"2024-10-11T07:25:44.594Z","updated_at":"2025-03-23T07:31:45.505Z","avatar_url":"https://github.com/ericls.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Djanurl\n\n基于 Django 的短网址程序.\nAn English version follows.\n\n## 需求\n\nDjango 支持的 Python3 版本\n\n处了`pip install -r requirements.txt`, 还可能需要数据库驱动和 web 服务器\n\n## 提示\n1. 请把自定义模板放置于 `templates`;\n2. 请将生产环境的配置写在 `djanurl/production.py`;\n3. 需要运行 `python manage.py collectstatics`. 这需要设置 `STATIC_ROOT`;\n4. 在 `production.py` 设置 `EXPLICIT_REDIRECT = True` 开启显式跳转;\n5. 显式跳转模板请创建到自定义模板目录的`surl/redirect.html`, 可参考 surl 这个 app 的模板;\n6. 默认开启 i18n 和 i10n, 网站语言根据浏览器/系统语言自动判断.\n\n-------\n\n# Djanurl\n\nA Django based url shortener project. \n\n## Requirements\n\nThis project is written in Python3. It should work well with all the versions that Django supports.\n\nIn addition to `pip install -r requirements.txt`, you may also need to install database drivers and http/wsgi servers.\n\n## Some Tips\n1. You should put your own templates in the `templates` folder in the project root directory;\n2. You may have your production settings set in `djanurl/production.py`\n3. You might need to run `python manage.py collectstatics`. In order to do this, you should have `STATIC_ROOT` set in your settings\n4. Set `EXPLICIT_REDIRECT = True` in `production.py` to enable explicit redirection\n5. Template used in explicit redirection is located at `surl/redirect.html`\n6. i18n and i10n is enabled by default. Language code is detected based on browser and os languages.\n\n## 示例部署文件 Example Deployment Files\n\nFile 1: `uwsgi.ini`\n````\n[uwsgi]\nsocket=/tmp/ovz.im.sock\nhome=/path/to/virtualenv/\nchdir=/path/to/project/\nenv=DJANGO_SETTINGS_MODULE=djanurl.settings\nmodule=djanurl.wsgi:application\nmaster=True\nworkers=8\npidfile=/tmp/ovz.im.pid\nmax-requests=5000\nthunder-lock=True\nvacuum=True\nharakiri=120\n````\n\nFile 2: `supervisord.conf`\n````\n....\n[program:ovzim]\ncommand = /path/to/uwsgi --ini /path/to/uwsgi.ini\nstopsignal=QUIT\nautostart=true\nautorestart=true\nstdout_logfile=/var/logs/ovz.log\nredirect_stderr=true\n````\n\nFile 3: nginx configuration `ovz.im.conf`\n\n````\nupstream ovzim {\n    server unix:///tmp/ovz.im.sock;\n}\n\nserver {\n    listen 80;\n    server_name www.ovz.im;\n    return 302 $scheme://ovz.im$request_uri;\n}\n\nserver {\n    listen      80;\n    server_name ovz.im;\n    charset     utf-8;\n\n    client_max_body_size 75M;\n\n    location /static {\n        root /path/to/project/;\n    }\n\n    location / {\n        uwsgi_pass  ovzim;\n        include     uwsgi_params;\n    }\n}\n````","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericls%2Fdjanurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericls%2Fdjanurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericls%2Fdjanurl/lists"}