File: django-admin

package info (click to toggle)
python-django 1.7.11-1%2Bdeb8u3
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 45,624 kB
  • sloc: python: 171,189; xml: 713; sh: 203; makefile: 199; sql: 11
file content (42 lines) | stat: -rwxr-xr-x 777 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

set -e

ensure_files_exist() {
    for f in "$@"; do
	if [ ! -e $f ]; then
	    echo "ERROR: $f does not exist" >&2
	    exit 1
	else
	    echo "OK: $f is there"
	fi
    done
}

run() {
    echo "Running “$@”"
    $@
}

# Test startproject
cd $ADTTMP
run django-admin startproject testproject

ensure_files_exist testproject/manage.py testproject/testproject/settings.py

# Test startapp
cd testproject
run django-admin startapp testapp

ensure_files_exist testapp/models.py testapp/tests.py testapp/views.py

# Test manage.py
#./manage.py check

# Needed because upstream doesn't want to rewrite shebang of ./manage.py
# see https://code.djangoproject.com/ticket/20027
if [ -e /usr/bin/python ]; then
    ./manage.py check
else
    python3 ./manage.py check
fi