信息数据模型
Project description
xy_django_app_information
说明
通用信息数据模型.
源码仓库
安装
# bash
pip install xy_django_app_information
使用
1. 直接引入
-
1. 设置全局配置
在Django项目中的settings.py文件中加入如下配置 例如: settings.py
# settings.py
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"xy_django_app_information",
"Demo",
"Resource",
"Media",
]
-
2. 运行项目
xy_web_server -w django start
# 启动工程后访问 http://127.0.0.1:8401/admin 验证信息管理系统
2. 自定义
-
1. 创建Information模块
操作 样例工程
# bash
xy_web_server -w django startapp Information
# Information 模块创建在 source/Runner/Admin/Information
-
2. 设置全局配置
在Django项目中的settings.py文件中加入如下配置 例如: settings.py
# settings.py
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"Demo",
"Resource",
"Media",
"Information",
]
-
3. 在Information模块的models.py文件中加入如下代码
# models.py
from xy_django_app_information.abstracts import MARegion
from django.utils.translation import gettext_lazy as _
class MRegion(MARegion):
class Meta:
app_label = "Information"
verbose_name = _("地理信息")
verbose_name_plural = _("地理信息")
-
4. 在Information模块的admin.py文件中加入如下代码
# admin.py
from django.contrib import admin
from .models import MRegion
# Register your models here.
@admin.register(MRegion)
class ARegion(admin.ModelAdmin):
pass
-
5. 运行项目
xy_web_server -w django start
# 启动工程后访问 http://127.0.0.1:8401/admin 验证账户管理系统
运行 样例工程
样例工程具体使用方式请移步 xy_web_server.git 下列仓库
许可证
xy_django_app_information 根据 <木兰宽松许可证, 第2版> 获得许可。有关详细信息,请参阅 LICENSE 文件。
捐赠
如果小伙伴们觉得这些工具还不错的话,能否请咱喝一杯咖啡呢?
联系方式
微信: yuyangiit
邮箱: yuyangit.0515@qq.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file xy_django_app_information-1.0.3.tar.gz
.
File metadata
- Download URL: xy_django_app_information-1.0.3.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dbf88cceb3f15bd4aee783af03db3a543bea2fcead2fbd75176f915506cc547 |
|
MD5 | 2e179b975d6dbe74f31f0a37ef71fcc2 |
|
BLAKE2b-256 | 248ccc6cb4fb6df71af60195e21a12bf635ea4035e15798bc5764412a8285e18 |
File details
Details for the file xy_django_app_information-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: xy_django_app_information-1.0.3-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba07d06a7c7bd182a5182ec710464eab1cf8d62fd94640f4ceb1867a01c76c2a |
|
MD5 | f192e7b47d82bb96a0a11c15b94515e3 |
|
BLAKE2b-256 | f750aed145ac076a29a4e425686217931573f6a85cab52d927c601bc02eca862 |