GithubHelp home page GithubHelp logo

loefsys-tutorial's Introduction

Docker and Loefsys installation tutorial

Prerequisites

Steps

  1. Make sure Docker (Desktop) is running and your command line directory is the root folder of this project.
  2. Copy the .env.example file and rename it to .env. You do not need to change any of the variables.
  3. In loefsys/settings.py, change
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}

to

DATABASES = {"default": {
    'ENGINE': 'django.db.backends.postgresql',
    'NAME': env("DB_NAME"),
    'USER': env("DB_USER"),
    'PASSWORD': env("DB_PASSWORD"),
    'HOST': env("DB_HOST"),
    'PORT': 5432,
}}

This changes the default database backend to PostgreSQL (which we use in the live environment) and use the environment variables in the .env file.

In addition, add the following to the top of settings.py

import environ

env = environ.Env()
env.read_env(".env")

This imports a library environ which handles the use of variables inside the .env directory.

  1. We should now be done with the configuration part! To test if your environment is working run the following in your command line

      $ docker compose up -d
    

This will run the docker-compose.yml file in which the webserver and database are created. The -d flag runs the container in detached mode so that it runs in the background.

  1. If everything is working correctly you should now be able to check out your app in http://localhost:8000/.
  2. You can now proceed with developing the tutorial Django application through the following link: https://docs.djangoproject.com/en/4.2/intro/tutorial01/.

loefsys-tutorial's People

Contributors

sebastiaanram avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.