Installation#

Creation of virtual environment#

To create virtual environment, move to the directory you want and do this command in your terminal:

$ python -m venv venv

Activation and deactivation of virtual environment#

To activate virtual environment, use this command in your terminal:

$ source venv/Scripts/activate

To deactivate vitual envrionment, use this command in your terminal:

(.venv) $ diactivate

Clone code source repository#

To pull code on your computer you can use:

(.venv) $ git clone git@github.com:Alexandre-Kolobov/Projet_13.git

Note

You have to create an account on GitHub

Installation of dependencies#

Before use the app you have to install all python dependencies: .. code-block:: console

(.venv) $ pip install -r requirements.txt

Here the content of requirements file:
alabaster==0.7.13
asgiref==3.7.2
Babel==2.14.0
beautifulsoup4==4.12.2
certifi==2023.11.17
charset-normalizer==3.3.2
colorama==0.4.6
coverage==7.3.2
dj-database-url==2.1.0
Django==5.0
django-environ==0.11.2
django-heroku==0.3.1
docutils==0.20.1
entrypoints==0.3
exceptiongroup==1.2.0
flake8==3.7.0
furo==2023.9.10
idna==3.6
imagesize==1.4.1
iniconfig==2.0.0
Jinja2==3.1.2
MarkupSafe==2.1.3
mccabe==0.6.1
packaging==23.2
pluggy==1.3.0
psycopg2==2.9.9
pycodestyle==2.5.0
pyflakes==2.1.1
Pygments==2.17.2
pytest==7.4.3
pytest-cov==4.1.0
pytest-django==3.9.0
python-decouple==3.8
pytz==2023.3.post1
requests==2.31.0
sentry-sdk==1.38.0
six==1.16.0
snowballstemmer==2.2.0
soupsieve==2.5
Sphinx==7.2.6
sphinx-basic-ng==1.0.0b2
sphinxcontrib-applehelp==1.0.7
sphinxcontrib-devhelp==1.0.5
sphinxcontrib-htmlhelp==2.0.4
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.6
sphinxcontrib-serializinghtml==1.1.9
sqlparse==0.4.4
tomli==2.0.1
typing_extensions==4.8.0
tzdata==2023.3
urllib3==2.1.0
whitenoise==6.6.0

Sentry#

It is an application monitoring and debugging platform. To set up it for our website you have to:

  • Create a sentry account.

  • Create a new DJANGO project.

  • Retrieve and save the given Sentry DNS key

Set up environment varibales#

You have to set up 2 environment varibales: DJANGO_SECRET_KEY and SENTRY_KEY

  • SENTRY_KEY corresponding to Sentry DNS key that you get

  • DJANGO_SECRET_KEY is a confidential key in Django for securing passwords, cookies, and preventing CSRF attacks.

Note

You have to set up it twice: for working localy and on Heroku