Learn Django

Account App Setup - Create App

The first step in building the accounts related functionality is to create the Django app. Here are the steps to do that.

Step 1: Create the Accounts App

With your terminal or command prompt open, execute these commands.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# navigate to crmeasy directory
$ cd /<your_path_here>/crmeasy

# activate the virtual environment
$ source venv/bin/activate

#  navigate to the crmapp directory 
(venv)$ cd crmapp/

# create the accounts app
(venv)$ django-admin.py startapp accounts

Step 2: Update the Settings File

The next step is to add the app to the INSTALLED_APPS list in the settings file.

  1. Open the /.../crmeasy/crmapp/settings.py file
  2. Locate INSTALLED_APPS
  3. Add 'crmapp.accounts', to the end of the list

The INSTALLED_APPS should now look like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'crmapp.marketing',
    'crmapp.subscribers',
    'crmapp.accounts',
)

Step 3: Commit Changes

Execute these commands to commit your changes in Git.

1
2
3
4
5
# add files
(venv)$ git add .

# commit files
(venv)$ git commit -m "created accounts app"

Track your progress with a free account