Quickstart¶
- Follow the installation guide:
Install Quade with pip:
pip install quadeAdd Quade to your project’s
INSTALLED_APPS
:INSTALLED_APPS = [ ... 'quade.apps.QuadeConfig', ]Initialize the Quade settings by adding these lines to your Django settings:
import quade QUADE = quade.Settings()(By default, Quade will only be available whenDEBUG=True
. For more details, see Settings.)
Add the django_jinja template handler to your
TEMPLATES
setting, while retaining any other template handlers you have. For example:TEMPLATES = [ # Existing code, leave in-place { 'BACKEND': 'django.template.backends.django.DjangoTemplates', ... }, # New code to add { 'BACKEND': 'django_jinja.backend.Jinja2', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'app_dirname': 'jinja2', }, }, ]Add Quade to your URL configuration, e.g.:
# urls.py urlpatterns = [ ... url(r'^quade/', include('quade.urls')) ]Run migrations:
python manage.py migrate quade
Create a fixtures file,
fixtures.py
, in the root of your project:# fixtures.py import uuid from django.contrib.auth import get_user_model from quade.managers import register User = get_user_model() @register def user(): new_user = User.objects.create( first_name='Alyssa', last_name='Hacker', username='alyssa-{}'.format(uuid.uuid4()) ) return "User #{}".format(new_user.pk)
Update your settings to make Quade aware of your fixtures file:
QUADE = quade.settings(fixtures_file='fixtures')
Enter the Django shell and create a
Scenario
that uses this fixture:from quade.models import Scenario Scenario.objects.create( config=[('user', {})], description='Single User', slug='single-user', status=Scenario.Status.ACTIVE )
Start your project’s webserver and visit the main Quade page. You will be able to generate new users on demand by selecting the “Single User” scenario and executing it.
Begin creating your own fixtures and
Scenarios
!