You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
782 B
39 lines
782 B
Development Setup: |
|
$ sudo apt install python3 python3-pip python-virtualenv python3-virtualenv |
|
$ virtualenv -p python3 env |
|
$ . env/bin/activate |
|
$ pip install -r requirements.txt |
|
|
|
Django clone setup: |
|
$ python manage.py makemigrations |
|
$ python manage.py migrate |
|
$ python manage.py createsuperuser |
|
$ DEBUG=true python manage.py runserver 0.0.0.0:8000 |
|
|
|
|
|
Logging: |
|
|
|
use logger.exception |
|
|
|
Machine learning: |
|
comma.ai switched to pyTorch |
|
|
|
|
|
How to make a package: |
|
https://news.t0.vc/ZBPS |
|
|
|
|
|
Timezones |
|
========= |
|
|
|
NEVER USE .replace(tzinfo= EXCEPT FOR WITH UTC! |
|
|
|
Assigning timezone to parsed string: |
|
- example, you get a text timestamp and parse it with strptime |
|
- solution: |
|
t = datetime.strptime(timestamp, '%Y-%m-%d %H:%M:%S') |
|
tz = pytz.timezone('America/Edmonton') |
|
result = tz.localize(t) |
|
|
|
|
|
|
|
|