deepakdinesh1123 / django-loadtest

1 stars 0 forks source link

Making the template reusable #1

Open carltongibson opened 2 years ago

carltongibson commented 2 years ago

Looking at the ticket_33735 branch, we can't just have a single version of the project. (One needs to install different versions of Django, and use different APIs etc.)

SO... (one idea) if we can leverage the startproject --template option we would enable easily creating different versions of the bootstrap project.

Structure:

README
docs/
   using-docker
   understanding-results
template/
    ... The Sarter Project as a template ... 
examples/
   basic_app/
         docker files etc.
   ticket_33735/
       requirements.txt
       README.md
       ...

I'd keep the stater template plain Django, and then have a doc about how to add docker files and such — I might just want to run locally, or use tox, or ...

Then, once we learn a bit more, we can add a doc about understanding the results... A basic Django app, under gunicorn, runs a bit like this...

At the basic project level, we have instructions to use startproject with your project name in the examples folder, make your changes, and run locust on that. Folks could make PRs to add (or at least Show and Tell) interesting examples.

That would mean that we wouldn't be stuck unable to merge incompatible versions, since each folder in examples/ would essentially be a freestanding project.

How does that sound? It looks to me like if we had a basic project plus a template, we'd have a really solid project to present at the end (in a couple of weeks) that you could write a blog post about etc.

In the meantime I want to be using this to add a few examples myself.

carltongibson commented 2 years ago

The Django project and app templates are here:

https://github.com/django/django/tree/main/django/conf

So, a project, with an app, with base views in place, and the locust file to run the benchmark, plus a README. — that would be about right, right? 😜

deepakdinesh1123 commented 2 years ago

@carltongibson I have added a draft of the template with the project ticket_33735 here please take a look at it.