Last active
October 31, 2019 16:16
-
-
Save blitzblade/f567c8c50f9d688b64209e39504ed76d to your computer and use it in GitHub Desktop.
Python Diary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import platform | |
if platform.system() == "Windows": | |
pass | |
elif platform.system() == "Linux": | |
pass | |
else: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check if system is windows or linux... you can run platform.system() on Mac to see what it returns :)