Skip to content

nnndk/python-course-portfolio

 
 

Repository files navigation

Portfolio

Portfolio is a little website about you and your awesome projects powered by Django. Also, it has a blog :)

Requirements:

Install the appropriate software:

  1. Docker Desktop.
  2. Git.
  3. PyCharm (optional).

Installation

Clone the repository to your computer:

git clone https://github.com/mnv/python-course-portfolio.git
  1. To configure the application copy .env.sample into .env file:

    cp .env.sample .env

    This file contains environment variables that will share their values across the application. The sample file (.env.sample) contains a set of variables with default values. So it can be configured depending on the environment.

  2. Build the container using Docker Compose:

    docker compose build

    This command should be run from the root directory where Dockerfile is located. You also need to build the docker container again in case if you have updated requirements.txt.

  3. Now it is possible to run the project inside the Docker container:

    docker compose up

    When containers are up server starts at http://0.0.0.0:8000. You can open it in your browser.

  4. To run application correctly set up the database using commands: Connect to the application Docker-container:

    docker compose exec app bash

    Apply migrations to create tables in the database:

    ./manage.py migrate

Usage

  1. To manage your new portfolio website you need to add superuser. Connect to the application Docker-container (if you are outside the container):
    docker compose exec app bash
    Create superuser:
    ./manage.py createsuperuser
  2. Go to http://0.0.0.0:8000/admin and manage your jobs and blog posts.

Automation commands

The project contains a special Makefile that provides shortcuts for a set of commands:

  1. Build the Docker container:

    make build
  2. Generate Sphinx documentation run:

    make docs-html
  3. Autoformat source code:

    make format
  4. Static analysis (linters):

    make lint
  5. Autotests:

    make test
  6. Run autoformat, linters and tests in one command:

    make all

Run these commands from the source directory where Makefile is located.

Documentation

The project integrated with the Sphinx documentation engine. It allows the creation of documentation from source code. So the source code should contain docstrings in reStructuredText format.

To create HTML documentation run this command from the source directory where Makefile is located:

make docs-html

After generation documentation can be opened from a file docs/build/html/index.html.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

Portfolio-website powered by Django.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 60.9%
  • HTML 31.3%
  • Makefile 4.0%
  • Dockerfile 3.2%
  • JavaScript 0.6%