django-binder:基于Django的SPA类Web应用程序框架,带有类似REST的API

  • a3_472218
    了解作者
  • 181.5KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-25 06:15
    上传日期
Django的活页夹 带有REST类API的SPA webapp的Code Yellow后端框架。 该框架尚在开发中。 尚无完整的文档。 我们正在将其用于几个项目并对其进行微调。 运行测试 有两种运行测试的方法: 直接运行./setup.py test (要求您安装python3和postgres) 与docker一起docker-compose run binder ./setup.py test 通过docker-compose run db psql -h db -U postgres直接访问测试数据库。 可能可以重新创建测试数据库(例如,当您添加/更改模型时)。 实现此目的的一种方法是仅删除所有已构建docker-compose rm的docker映像。 该数据库将在安装过程中在tests/__init__.py 。 以无需保留迁移文件的方式来设置测试。 tests/
django-binder-master.zip
内容介绍
# Django-Binder [![Build Status](https://travis-ci.org/CodeYellowBV/django-binder.svg?branch=master)](https://travis-ci.org/CodeYellowBV/django-binder) [![codecov](https://codecov.io/gh/CodeYellowBV/django-binder/branch/master/graph/badge.svg)](https://codecov.io/gh/CodeYellowBV/django-binder) Code Yellow backend framework for SPA webapps with REST-like API. **This framework is a work-in-progress. There is no complete documentation yet. We are using it for a couple of projects and fine-tuning it.** ## Running the tests There are two ways to run the tests: - Run directly `./setup.py test` (requires you to have python3 and postgres installed) - Run with docker `docker-compose run binder ./setup.py test` - Access the test database directly by with `docker-compose run db psql -h db -U postgres`. - It may be possible to recreate the test database (for example when you added/changed models). One way of achieving this is to just remove all the docker images that were build `docker-compose rm`. The database will be created during the setup in `tests/__init__.py`. The tests are set up in such a way that there is no need to keep migration files. The setup procedure in `tests/__init__.py` handles the preparation of the database by directly calling some build-in Django commands. To only run a selection of the tests, use the `-s` flag like `./setup.py test -s tests.test_some_specific_test`. ## MySQL support MySQL is supported, but only with the goal to replace it with PostgreSQL. This means it has a few limitations: - `where` filtering on `with` relations is not supported. - Only integer primary keys are supported. - When fetching large number of records using `with` or the ids are big, be sure to increase `GROUP_CONCAT` max string length by: ``` DATABASES = { 'default': { 'OPTIONS': { 'init_command': 'SET SESSION group_concat_max_len = 1000000', }, }, } ```
评论
    相关推荐