You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cookiecutter-molten/{{cookiecutter.project_slug}}
androiddrew 504bb0ec31 fixed logger name 6 years ago
..
migrations Adding migragtions changing test fixtures 6 years ago
scripts Adding logging, new cookiecutter params for cors and static report, changed factory function 6 years ago
tests Adding migragtions changing test fixtures 6 years ago
{{cookiecutter.project_slug}} fixed logger name 6 years ago
.coveragerc Added TOML settings file and .coveragerc file. 6 years ago
.gitignore Initial commit 6 years ago
LICENSE Removed failure feature when selecting GPL license 6 years ago
README.md Adding migragtions changing test fixtures 6 years ago
alembic.ini Adding logging, new cookiecutter params for cors and static report, changed factory function 6 years ago
dev_requirements.in Initial commit 6 years ago
manage.py Adding migragtions changing test fixtures 6 years ago
requirements.in Adding migragtions changing test fixtures 6 years ago
setup.py Initial commit 6 years ago

README.md

{{ cookiecutter.project_name }}

{{cookiecutter.description}}

First time setup

Create a virtual environment and activate it. Now from the root project directory run ./scripts/bootstrap. This will install pip-tools and sync any dependencies for the first time.

To run the app you will need a postgres database. Create a development and a test database. Update the connection strings within the {{cookiecutter.project_slug}}.settings.toml. At this time, if you choose to, you can remove the demo Todo code and replace it with your own Model. Otherwise create your first alembic migration using the alembic revision --autogenerate -m "your revision message" command. Finally, apply your first migration with alembic upgrade head.

Running the developement server

A manage.py script has been included with a collection of click cli functions to assist in development.

Note: the developement server command is not a production webserver. You will need to c

python manage.py runserver

Using the interactive interpreter

The manage.py script can be used to open an interactive interpreter with a configured molten application from your project.

python manage.py shell

Dependency management

Dependencies are managed via pip-tools.

Adding a dependency

To add a dependency, edit requirements.in (or dev_requirements.in for dev dependencies) and add your dependency then run pip-compile requirements.in.

Syncing dependencies

Run pip-sync requirements.txt dev_requirements.txt.

Migrations

Migrations are managed using alembic.

Generating new migrations

alembic revision --autogenerate -m 'message'

Running the migrations

alembic upgrade head  # to upgrade the local db
env ENVIRONMENT=test alembic upgrade head  # to upgrade the test db
env ENVIRONMENT=prod alembic upgrade head  # to upgrade prod

Testing

Run the tests by invoking py.test in the project root. Make sure you run any pending migrations beforehand.