Include example project
This commit is contained in:
0
example_project/__init__.py
Normal file
0
example_project/__init__.py
Normal file
5
example_project/admin.py
Normal file
5
example_project/admin.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import ExampleModel
|
||||
|
||||
admin.site.register(ExampleModel)
|
||||
10
example_project/manage.py
Executable file
10
example_project/manage.py
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
|
||||
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
execute_from_command_line(sys.argv)
|
||||
26
example_project/migrations/0001_initial.py
Normal file
26
example_project/migrations/0001_initial.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 3.0.5 on 2020-04-18 12:18
|
||||
|
||||
from django.db import migrations, models
|
||||
import jsignature.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ExampleModel',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('signature', jsignature.fields.JSignatureField(blank=True, null=True, verbose_name='Signature')),
|
||||
('signature_date', models.DateTimeField(blank=True, null=True, verbose_name='Signature date')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
0
example_project/migrations/__init__.py
Normal file
0
example_project/migrations/__init__.py
Normal file
5
example_project/models.py
Normal file
5
example_project/models.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from jsignature.mixins import JSignatureFieldsMixin
|
||||
|
||||
|
||||
class ExampleModel(JSignatureFieldsMixin):
|
||||
pass
|
||||
67
example_project/settings.py
Normal file
67
example_project/settings.py
Normal file
@@ -0,0 +1,67 @@
|
||||
import os
|
||||
|
||||
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
MANAGERS = ADMINS = ()
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(BASE_DIR, 'example.db'),
|
||||
'USER': '',
|
||||
'PASSWORD': '',
|
||||
'HOST': '',
|
||||
'PORT': '',
|
||||
}
|
||||
}
|
||||
|
||||
SECRET_KEY = 'notsosecret'
|
||||
|
||||
MIDDLEWARE = (
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
)
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': (
|
||||
"django.template.context_processors.request",
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.template.context_processors.debug",
|
||||
"django.template.context_processors.i18n",
|
||||
"django.template.context_processors.media",
|
||||
"django.template.context_processors.static",
|
||||
"django.template.context_processors.tz",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
),
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'example_project.urls'
|
||||
|
||||
INSTALLED_APPS = (
|
||||
'django.contrib.auth',
|
||||
'django.contrib.admin',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.staticfiles',
|
||||
'django.contrib.messages',
|
||||
'jsignature',
|
||||
'example_project',
|
||||
)
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
JSIGNATURE_JQUERY = 'admin'
|
||||
8
example_project/urls.py
Normal file
8
example_project/urls.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
|
||||
urlpatterns = [
|
||||
path('', admin.site.urls),
|
||||
]
|
||||
Reference in New Issue
Block a user