B
B
bituke2021-05-26 10:08:52
linux
bituke, 2021-05-26 10:08:52

How to quickly deploy someone else's django project?

I have Windows 10, the customer sent me a project, asked me to complete a couple of tasks. The project is naturally based on a database that I don't have, it has a bunch of different libraries installed, celery, rabbitmq, apache, and so on and so forth. I just need to run it in test mode first, how can I do it as quickly and efficiently as possible? Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Arman, 2019-01-05
@fnps

set $base /var/www/lfp/data/www/domain.com;
root $base/var/www/lfp/data/www/domain.com;

if I understand correctly, then
I don't think there is such a way.
in fact, as I understood the first field (path) to the project path, and the second (document root) where the access point lies and you need to write relative to the first path

V
Vladimir Kuts, 2021-05-26
@bituke

With the help of docker containers
If the project developer is not crooked (often there are projects where there is not even a list of dependencies like requirements.txt), then writing the correct docker-compose.yml will save the father of Russian democracy)
For example, what do we have there? DB?
look at DATABASES in the settings.py of the project. What do we have there? django.db.backends.postgresql?
Ok - a container named postgres with postgres has been raised. In the environment variables, the password, user, and database name were passed. Registered in the settings HOST postgres, etc.
What's next? cache on redis?
Raised a container with redis named redis - made the corresponding change in CACHES in the same settings.py
celery - worker and beat - smashed into different containers with python
In one startanul started something like
celery -A имя_проекта worker
in another
celery -A имя_проекта beat
apache - to start in developer mode - it is not needed yet .. You can start a little later when you more or less understand the project ...
No test fixtures and data for the database? It doesn't matter - arm yourself with Faker and factory_boy for example. Throw an object on the model to create fake entities - and go ...
And so - a few steps - and you have an application that starts to show signs of life - well, then - according to the symptoms ...

L
Larisa .•º, 2021-05-26
@barolina

The project should at least have fixtures for the test database

M
mkone112, 2021-05-26
@mkone112

Well...no way? Without a test database, this is unlikely to work, how it is organized there is unknown. Ask the customer for instructions for the project. In general, there is not enough data to answer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question