Its a little rough I admit, and I welcome any feedback for improvements. As a result, I'm now able to run commands like the following anywhere once I have my virtual environment loaded.
(spock)jbisbee@tacquito:~/src/spock$ manage dbshell
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 95
Server version: 5.5.31-0ubuntu0.12.04.2 (Ubuntu)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Edit: I've gotten some feedback and I realize I didn't sell the real reason behind dynamically setting the DJANGO_SETTINGS_MODULE variable. I use Django at work and we have moved from the generic one file settings.py to a settings directory which looks something like this
settings/
base.py
dev.py # imports from base.py
test.py # imports from base.py
production.py # imports from base.py
jbisbee.py # imports from dev.py
This way you can have cascading Django settings with overrides at multiple levels. This bash function I wrote finds the settings directory and will set DJANGO_SETTINGS_MODULE to the user's specific dev settings (or dev if the user can't be found)
DJANGO_SETTINGS_MODULE=projectname.settings.jbisbee
Disclaimer: If you manage your Django project's settings differently let me know. I'd love to make the determine_django_module_settings more flexible and patches are more than welcome!
The History of the Casino - One of the Most Popular Casinos
ReplyDeleteA relative newcomer to the world of online gambling, Wynn Las Vegas opened its 바카라 사이트 doors to a septcasino.com new audience gri-go.com of over 600,000 in 2017. This was the casinosites.one first casino https://tricktactoe.com/