Skip to main content

est django app with minimum files without projec

Project description

Installation

$ [sudo] pip install django-app-test

Benefits

learn Django with minimum code. 1 example = 1 app folder. no need project

How it works

tests.py required

optional app files:

fixtures/
templates/
templatetags/
forms.py
models.py
settings.py
views.py
urls.py

output temp folder:

manage.py 
app/__init__.py
app/apps.py
app/...             # app optional files
app/tests.py        # required

executed management commands:

python manage.py makemigrations app     # if models.py exists
python manage.py migrate app            # if models.py exists
python manage.py loaddata fixtures/*    # if fixtures/ exists
python manage.py test app

settings.py

DJANGO_SETTINGS_MODULE by default is django_app_test_settings

customize:

a) create settings.py

b) export DJANGO_SETTINGS_MODULE="custom_settings"

Scripts usage

command usage
django-app-test usage: django-app-test path

Examples

models.py

from django.db import models
from taggit.managers import TaggableManager

class MyModel(models.Model):
...

settings.py

INSTALLED_APPS = [
    'app',
    'taggit',
    'django.contrib.auth',
    'django.contrib.contenttypes',
]

SECRET_KEY="<SECRET_KEY>"
DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3','NAME': 'dbname'}}

tests.py

from .models import MyModel
...

What's Next?

create Makefile:

all:
    django-app-test .

create Makefile for every folder:

all:
    find "$(CURDIR)" -name "tests.py" -print0 | xargs -0 -L 1 -I{} sh -c 'set "$$(dirname "$$0")"/Makefile; echo "all:" > "$$1"; echo " @django-app-test ." >> "$$1";echo $$1' {}

django-readme-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-app-test, version 2019.6.27
Filename, size File type Python version Upload date Hashes
Filename, size django-app-test-2019.6.27.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page