cookiecutter-django/hooks/post_gen_project.py

32 lines
816 B
Python
Raw Normal View History

2022-10-28 19:38:57 +02:00
import os
COMMANDS_TO_RUN = [
2022-12-16 22:11:56 +01:00
"pip install -U pip pip-tools invoke",
"inv update-dependencies",
2022-10-28 19:38:57 +02:00
"pre-commit install",
"pre-commit autoupdate",
"pre-commit run --all-files",
2023-02-28 11:21:33 +01:00
"git add .",
2022-12-16 22:11:56 +01:00
"git commit -m 'Freeze dependencies'",
2022-10-28 19:38:57 +02:00
"pycharm .",
2022-10-28 22:18:38 +02:00
"inv test",
2022-10-28 19:38:57 +02:00
"./src/manage.py migrate",
"./src/manage.py createcachetable",
"./src/manage.py createsuperuser",
"./src/manage.py runserver",
]
def main():
os.system("git init")
os.system("git add .")
os.system("git commit -m 'Initial commit'")
print("\nWe created a virtualenv using {{cookiecutter.python_version}} for you.")
print("Run the following commands:")
print("cd {{cookiecutter.project_slug}} && direnv allow")
print(" && ".join(COMMANDS_TO_RUN))
if __name__ == '__main__':
main()