Skip to content

Instantly share code, notes, and snippets.

@blitzblade
Last active October 31, 2019 16:16
Show Gist options
  • Save blitzblade/f567c8c50f9d688b64209e39504ed76d to your computer and use it in GitHub Desktop.
Save blitzblade/f567c8c50f9d688b64209e39504ed76d to your computer and use it in GitHub Desktop.
Python Diary
install requirements with pipenv:
pipenv install -r requirements.txt
run python file in pipenv:
pipenv run python file.py
add manager so you can use migrations (using alembic)
initialize migration:
python manage.py db init
migration creation:
python manage.py db migrate
push to db:
python manage.py db upgrade
run server:
python manage.py runserver
run tests:
python -m unittest discover
import platform
if platform.system() == "Windows":
pass
elif platform.system() == "Linux":
pass
else:
pass
@blitzblade
Copy link
Author

Check if system is windows or linux... you can run platform.system() on Mac to see what it returns :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment