Quick Start

Getting Started

Before creating django project you must first create virtualenv.

$ python3.9 -m pip install virtualenv
$ python3.9 -m virtualenv venv

To activate virtual environment in ubuntu:

$ source venv/bin/activate

To deactivate virtual environment use:

$ deactivate

Start Project

First create a Django project

$ mkdir GeneratorTutorials
$ cd GeneratorTutorials
$ django-admin startproject kernel .

Next we have to create a sample app that we want to generate code for it (it is required for development. you will run tests on this app)

$ python manage.py startapp products

Now we have to add ‘products’ to INSTALLED_APPS in settings.py

INSTALLED_APPS = [
  ...
  'products',
  ...
]

Install Generator

First install package

$ pip install django-sage-painless

Then add ‘sage_painless’ to INSTALLED_APPS in settings.py

These apps should be in your INSTALLED_APPS:

  • rest_framework

  • drf_yasg

  • django_seed

INSTALLED_APPS = [
  ...
  'sage_painless',
  ...
  'rest_framework',
  'drf_yasg',
  'django_seed',
  ...
]