Getting Started

Setting Up Development Environment 🧑‍💻


Prerequisites

Here's required technology and languages to get started:

Assets compile require the build tools. These libraries are required as below:


Install Python

Python is the programming language that Django is built with. Django is a Python web framework. See What Python version can I use with Django? for details.

To check if Python is already installed on your system, open your terminal/command prompt and run:

python --version

If Python is not installed, follow these steps to install it:

Mac & Windows:
  1. Download Python for macOS from the official website: python.org/downloads
  2. Run the installer and make sure to check the box that says "Add Python to PATH" before clicking "Install Now."
Linux:

For Linux, you can use your package manager to install Python. For example, on Ubuntu, you can use:

sudo apt-get update
sudo apt-get install python3

Install PIP

Linux, Mac & Windows:

To check if PIP is already installed on your system, open your terminal/command prompt and run:

pip --version

Installing Pip using get-pip.py

  1. Download the script, from https://bootstrap.pypa.io/get-pip.py.
  2. Open a terminal/command prompt, cd to the folder containing the get-pip.py file and run:
python get-pip.py
# For Python 2 or lower
python get-pip.py

# For Python 3
python3 get-pip.py
C:> py get-pip.py

Build Assets

Before running the application we need to build theme assets from full-version/src/ or starter-kit/src/ folder:

  1. Open terminal/command prompt and change directory to src/
  2. cd src
  3. Install dependencies with either one, yarn or npm:
  4. # For Yarn
    yarn
    
    # For npm
    npm install --legacy-peer-deps
  5. You can use below commands to bundle theme assets. The below command will compile all the assets(sass, js, media) to src/assets folder:
  6. Task (yarn or gulp) lists for development build.

    Yarn Task Gulp Task Description
    yarn watch gulp watch Watch files for changes and automatically recompile them when it changed.
    yarn build gulp build Compile sources and copy assets.

    Task (yarn or gulp) lists for production build. It will generate minified assets for production deployment.

    Yarn Task Gulp Task Description
    yarn build:prod gulp build --env=production Run build task in production environment.
For more details refer Available Tasks

Run Django

First, ensure you are in the correct directory. You should be in either the "full-version" or "starter-kit" folder. Once you are in the appropriate folder, proceed with the following instructions:

  1. Create a virtualenv:
  2. python -m venv .venv
  3. Activate the virtualenv you have just created:
  4. source .venv/bin/activate
    source .venv/bin/activate
    source .venv/Scripts/activate
  5. Install development requirements:
  6. pip install -r requirements.txt
  7. Apply migrations:
  8. python manage.py migrate
  9. Run application through django development server:
  10. python manage.py runserver

    Keep your prompt running by default application is served on http://localhost:8000

    To execute the application on a particular IP address(For ex: http://0.0.0.0:8000), include the desired IP address within the `ALLOWED_HOSTS` parameter in the settings.py file.

    python manage.py runserver 0.0.0.0:8000
© 2017- ThemeSelection, Hand-crafted & Made with ❤️