Show us your cookiecutters!


#1

Hey everyone! I was lurking around the issues and forum the other day and found a few people wanting to talk about project layouts. So I decided to dust off a cookie cutter I was toying with and put it out there for people to use.

I have a preference for Postgres as my backend store and I like to see ISO 8601 strings in my serialized JSON so that is what I have provided. I have also implemented some basic fixtures in a conftest file to jump start people’s tests. The wsgi_app.py is accountable for importing the application factory and creating your app with the appropriate settings, which will also make it easier to use WSGI middleware.

Let me know what you think and I want to see any cookiecutters you guys have built!:rocket:


#2

#3

Hello,
I propose this cookiecutter adapted for apistar with django
For now, I use the patched version from audiolion https://github.com/encode/apistar/pull/314
Based on pipenv, I added the following for apistar
Apistar option:

this add:

    only for python 3.6
    config directory for settings, urls, get_env
    a sample pseudo app : models, urls, schema, views
    pytest fixture for apistar's session injection
    sample test
    Add to Makefile:
        migrate : does migrations and migrate
        run : run apistar
    added packages :
        apistar, django, psycopg2
        pytest-django
        pytest-pythonpath
        django-reset-migrations: allways usefull
        django-extensions : for shell_plus server_plus
        todo : manage.py

#4

Hello,
Django is always always complaining (app not configured, secret-key, …) so I made some changes to base the layout :
I splitted django conf and apistar conf so I can configure django separatly first at start.
Django is loaded one time before anything else so there is no matter using django stuff for apistar.

I added apistar-shell which gives the “session” component from django_orm in a ipython shell

What do you think about it ? Thanks for your opinion :

Jimmy


#5

Here’s mine: https://github.com/Bogdanp/apistar_cookiecutter

It’s fairly minimal, but it comes w/ a production-ready Dockerfile, CORS, Sentry and Prometheus metrics support. No DB as that tends to vary between projects.