-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoc-notes-takahe
1671 lines (1483 loc) · 96.3 KB
/
poc-notes-takahe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
11/29/2022 - 5:30 (UTC -7)
Starting install
OS: FreeBSD 13.1-RELEASE
PKGs to install (as tested):
-py39-dj-database-url-1.0.0
-py39-django41-4.1.2
-py39-sentry-sdk-1.5.12
-py39-pydantic-1.10.2
-postgresql14-server-14.5
-postgresql14-client-14.5
-"allow.sysvipc=1" in jail properties to run Postgresql
-py39-pip-22.2.2
-pip install pydantic[email]
-pip install django-htmx
-pip install pyld
-libxslt (PKG)
-pip install psycopg2
***Additional Notes***
-all pip commands were run as a "regular" user in the wheel group. Pip was installed
via PKG as well as django.
-all packages installed via PKG and pip were pulled from requirements.txt
***Code Added***
settings.py - line 94:
added host (jail) IP for PGHOST
settings.py - line 100:
"allow_reuse=True"
All the above modules (pip) and packages (pkg) installed as expected. However,
when starting the application with the following command:
john@bsdlabs-takahe:~ $ python3.9 manage.py runserver 192.168.254.108:8080
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/threading.py", line 917, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.9/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "/usr/local/lib/python3.9/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 398, in execute
autoreload.check_errors(django.setup)()
File "/usr/local/lib/python3.9/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 116, in populate
app_config.import_models()
File "/usr/local/lib/python3.9/site-packages/django/apps/config.py", line 269, in import_models
self.models_module = import_module(models_module_name)
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/home/john/activities/models/__init__.py", line 1, in <module>
from .fan_out import FanOut, FanOutStates # noqa
File "/usr/home/john/activities/models/fan_out.py", line 23
match (fan_out.type, fan_out.identity.local):
^
SyntaxError: invalid syntax
Error could be the result of using Django 4.1.2/Python 3.9
Reinstalling with Python 3.10
11-30-2022 5:08pm (UTC -7)
OS: FreeBSD 13.1-RELEASE in an ezjail
*** Switching to ports because PKG does not show python 3.10
***Please note that pip has to be run from a zip application in order
to work with python310, from what I have found. PIP Zip Application Download link:
https://bootstrap.pypa.io/pip/pip.pyz
Applications installed:
-python310-3.10.8_1 - ports; default options
-pip.pyz - from above link then "python3.10 -m pip.pyz ..."
-pre-commit~=2.20.0 - from requirements-dev.txt; python3.10 ~/pip.pyz install pre-commit
-black==22.10.0 - from requirements-dev.txt; python3.10 ~/pip.pyz install black
-flake8==5.0.4 - from requirements-dev.txt; not available via pip or GitHub; available version is 6.0
-flake8-6.0.0 - installed in place of flake8-5.0.4
-isort-5.10.1 - from requirements-dev.txt; python3.10 ~/pip.pyz install isort
-mock~=4.0.3 - from requirements-dev.txt; python3.10 ~/pip.pyz install mock
-pytest-asyncio~=0.20.2 - from requirements-dev.txt; python3.10 ~/pip.pyz install pytest-asyncio
-pytest-django~=4.5.2 - from requirements-dev.txt; python3.10 ~/pip.pyz install pytest-django
-pytest-httpx~=0.21 - from requirements-dev.txt; installed pytest-httpx 0.21.2; python3.10 ~/pip.pyz install pytest-httpx
-Django - python -m pip install Django
Tried running the application with the command:
python3.10 manage.py runserver 192.168.254.108:8080
Result was ModuleNotFoundError: No module named 'dj_database_url'
python3.10 ~/pip.pyz install dj_database_url
ModuleNotFoundError: No module named 'sentry_sdk'
python3.10 ~/pip.pyz install sentry-sdk
ModuleNotFoundError: No module named 'pydantic'
python3.10 ~/pip.pyz install pydantic
ImportError: email-validator is not installed, run `pip install pydantic[email]`
python3.10 ~/pip.pyz install pydantic[email]
ModuleNotFoundError: No module named 'django_htmx'
python3.10 ~/pip.pyz install django-htmx
ModuleNotFoundError: No module named 'pyld'
python3.10 ~/pip.pyz install pyld
Error: Please make sure the libxml2 and libxslt development packages are installed.
Installed libxml2 from ports; default options
Installed libxslt from ports; default options
python3.10 ~/pip.pyz install pyld
No module named 'psycopg2'
python3.10 ~/pip.pyz install psycopg2
Error: pg_config executable not found.
sudo pkg install postgresql14-client-14.5 postgresql14-server-14.5
python3.10 ~/pip.pyz install psycopg2
Success
python3.10 ~/pip.pyz install pyld
Success
Tried running the application with the command:
python3.10 manage.py runserver 192.168.254.108:8080
ModuleNotFoundError: No module named 'urlman'
python3.10 ~/pip.pyz install urlman
Tried running the application with the command:
python3.10 manage.py runserver 192.168.254.108:8080
ModuleNotFoundError: No module named 'bleach'
python3.10 ~/pip.pyz install bleach
ModuleNotFoundError: No module named 'cryptography'
error: can't find Rust compiler
sudo pkg install rust
python3.10 ~/pip.pyz install cryptography
Successfully installed cffi-1.15.1 cryptography-38.0.4 pycparser-2.21
Tried running the application with the command:
python3.10 manage.py runserver 192.168.254.108:8080
ModuleNotFoundError: No module named 'PIL'
python3.10 ~/pip.pyz install Pillow
The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.
12-1-222 - Starting over and using just ports... ;-;
Ports installed:
-python310 - default options
-instantiated python3.10 venv - "python3.10 -m venv ~/.virtualenvs/takahe"
***The following were executed in the python venv - To launch: ". ~/.virtualenv/takahe/bin/activate"
-Django via pip.pyz - "python3.10 ~/pip.pyz install Django"; Django 4.1.3 installed
-Postgresql14-server (ports) - default options
***pip3.10 -r not working on install, installing pip requirements manually***
-pyld~=2.0.3 - Error
Error: Please make sure the libxml2 and libxslt development packages are installed.
***libxml2-2.10.3_1 already installed (ports)***
***libxslt-1.1.37 installed (ports)***
-pyld installed (very old version in ports); pip3.10 install pyld~=2.0.3
-pillow~=9.3.0 - Error
The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.
-py-pillow/py39-pillow (ports - v.9.2.0) - default options
-urlman (old version in ports) - pip3.10 install urlman~=2.0.1
-cryptography (old version in ports) - pip3.10 install cryptography~=38.0
-httpx (ports; version 0.23.0) - default options
-uvicorn~=0.19 (slightly older version in ports - 0.18.3) - pip3.10 install uvicorn~=0.19
-gunicorn (ports)- default options
-psycopg2 (ports; version 2.9.4) - default options
-bleach (ports) - default options
-pydantic (ports)- default options
-django-htmx~=1.13.0 (couldn't find in ports) - pip3.10 install django-htmx~=1.13.0
-django-storages[google,boto3] (ports) - default options
-whitenoise (ports) - default options
-sphinx (couldn't find in ports) - pip3.10 install sphinx~=5.3.0
-sentry-sdk (older version in ports) - pip3.10 install sentry-sdk~=1.11.0
-dj_database_url (ports) - default options
-python-dotenv (ports) - default options
-email-validator (ports) - default options
Tried to run with the commands:
python3.10 manage.py runserver 192.168.254.108:8080
ModuleNotFoundError: No module named 'dj_database_url'
python3.9 manage.py runserver 192.168.254.108:8080
ModuleNotFoundError: No module named 'sentry_sdk'
-dj_database_url - pip3.10 install dj_database_url~=1.0.0
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
ModuleNotFoundError: No module named 'pydantic'
-pydantic - pip3.10 install pydantic~=1.10.2
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
ImportError: email-validator is not installed, run `pip install pydantic[email]`
-email-validator - pip3.10 install email-validator~=1.3.0
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'
-psycopg2 - pip3.10 install psycopg2~=2.9.5
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
ModuleNotFoundError: No module named 'bleach'
-bleach - pip3.10 install bleach~=5.0.1
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
ModuleNotFoundError: No module named 'httpx'
-httpx - pip3.10 install httpx~=0.23
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
ModuleNotFoundError: No module named 'PIL'
-pillow - pip3.10 install pillow~=9.3.0
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
Error: connection to server at "192.168.254.108", port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
root@bsdlabs-takahe:~ # netstat -4
Active Internet connections
Proto Recv-Q Send-Q Local Address Foreign Address (state)
udp4 0 0 127.0.0.8.32193 127.0.0.8.32193
-Assigned password "takahe" to settings.py and Postgres DB
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
Error: connection to server at "192.168.254.108", port 5432 failed: Connection >
Is the server running on that host and accepting TCP/IP connections?
$ pg_ctl -D /var/db/postgres/data14/ stop
waiting for server to shut down.... done
server stopped
$ pg_ctl -D /var/db/postgres/data14/ start
waiting for server to start....2022-12-03 08:17:16.185 UTC [25922] LOG: ending log output to stderr
2022-12-03 08:17:16.185 UTC [25922] HINT: Future log output will go to log destination "syslog".
done
server started
-Added "john" postgres user and updated settings.py
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: connection to server at "192.168.254.108", port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 137, in inner_run
self.check_migrations()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/core/management/base.py", line 564, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/migrations/executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/migrations/loader.py", line 58, in __init__
self.build_graph()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/migrations/loader.py", line 235, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 81, in applied_migrations
if self.has_table():
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 57, in has_table
with self.connection.cursor() as cursor:
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 323, in cursor
return self._cursor()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 299, in _cursor
self.ensure_connection()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 281, in ensure_connection
with self.wrap_database_errors:
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: connection to server at "192.168.254.108", port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
postgres=# GRANT ALL ON DATABASE takahe TO john;
GRANT
postgres=# exit
$ pg_ctl -D /var/db/postgres/data14/ restart
waiting for server to shut down.... done
server stopped
waiting for server to start....2022-12-03 08:25:02.536 UTC [26023] LOG: ending log output to stderr
2022-12-03 08:25:02.536 UTC [26023] HINT: Future log output will go to log destination "syslog".
done
server started
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
Traceback (most recent call last):
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: connection to server at "192.168.254.108", port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 137, in inner_run
self.check_migrations()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/core/management/base.py", line 564, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/migrations/executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/migrations/loader.py", line 58, in __init__
self.build_graph()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/migrations/loader.py", line 235, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 81, in applied_migrations
if self.has_table():
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 57, in has_table
with self.connection.cursor() as cursor:
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 323, in cursor
return self._cursor()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 299, in _cursor
self.ensure_connection()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 281, in ensure_connection
with self.wrap_database_errors:
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/home/john/.virtualenvs/takahe/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: connection to server at "192.168.254.108", port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
-Changed user 'john' password to '1234'
Tried to run with the command:
python3.10 manage.py runserver 192.168.254.108:8080
same errors as abovew
Pg runs on localhost by default. Either switch it to all interfaces (dont do this in prod), or modify Django DATABASE url to use localhost
Change Postgres listening address to "*"
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/base.py", line 475, in check
all_issues = checks.run_checks(
File "/home/john/.local/lib/python3.10/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/home/john/.local/lib/python3.10/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/home/john/.local/lib/python3.10/site-packages/django/core/checks/urls.py", line 24, in check_resolver
return check_method()
File "/home/john/.local/lib/python3.10/site-packages/django/urls/resolvers.py", line 494, in check
for pattern in self.url_patterns:
File "/home/john/.local/lib/python3.10/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/john/.local/lib/python3.10/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/john/.local/lib/python3.10/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/home/john/takahe/urls.py", line 9, in <module>
from users.views import activitypub, admin, auth, follows, identity, settings
File "/usr/home/john/users/views/admin/__init__.py", line 20, in <module>
from users.views.admin.settings import BasicSettings # noqa
File "/usr/home/john/users/views/admin/settings.py", line 5, in <module>
from users.views.settings import SettingsPage
File "/usr/home/john/users/views/settings/__init__.py", line 6, in <module>
from users.views.settings.profile import ProfilePage # noqa
File "/usr/home/john/users/views/settings/profile.py", line 8, in <module>
from PIL import Image, ImageOps
ModuleNotFoundError: No module named 'PIL'
john@bsdlabs-takahe:~ $ python3.10 -m pip install pillow~=9.3.0
/usr/local/bin/python3.10: No module named pip
Installed pip3.9 from PKG
Installed pillow~=9.3.0 via pip3.9 - only way it would installed after
installing from ports earlier
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/base.py", line 475, in check
all_issues = checks.run_checks(
File "/home/john/.local/lib/python3.10/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/home/john/.local/lib/python3.10/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/home/john/.local/lib/python3.10/site-packages/django/core/checks/urls.py", line 24, in check_resolver
return check_method()
File "/home/john/.local/lib/python3.10/site-packages/django/urls/resolvers.py", line 494, in check
for pattern in self.url_patterns:
File "/home/john/.local/lib/python3.10/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/john/.local/lib/python3.10/site-packages/django/urls/resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/john/.local/lib/python3.10/site-packages/django/urls/resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/home/john/takahe/urls.py", line 9, in <module>
from users.views import activitypub, admin, auth, follows, identity, settings
File "/usr/home/john/users/views/admin/__init__.py", line 20, in <module>
from users.views.admin.settings import BasicSettings # noqa
File "/usr/home/john/users/views/admin/settings.py", line 5, in <module>
from users.views.settings import SettingsPage
File "/usr/home/john/users/views/settings/__init__.py", line 6, in <module>
from users.views.settings.profile import ProfilePage # noqa
File "/usr/home/john/users/views/settings/profile.py", line 8, in <module>
from PIL import Image, ImageOps
ModuleNotFoundError: No module named 'PIL'
My guess is that we need pip3.10 to install the pillow module. Researching...
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
"python3.10 -m pip" now works
python3.10 -m pip install pillow~=9.3.0
python3.10 manage.py runserver 192.168.254.108:8080
Error: connection to server at "192.168.254.108", port 5432 failed: FATAL: no pg_hba.conf entry for host "192.168.254.108", user "john", database "takahe", no encryption
Performing system checks...
System check identified no issues (0 silenced).
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/john/.local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/home/john/.local/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/home/john/.local/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: connection to server at "192.168.254.108", port 5432 failed: FATAL: no pg_hba.conf entry for host "192.168.254.108", user "john", database "takahe", no encryption
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 137, in inner_run
self.check_migrations()
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/base.py", line 564, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/home/john/.local/lib/python3.10/site-packages/django/db/migrations/executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/john/.local/lib/python3.10/site-packages/django/db/migrations/loader.py", line 58, in __init__
self.build_graph()
File "/home/john/.local/lib/python3.10/site-packages/django/db/migrations/loader.py", line 235, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/john/.local/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 81, in applied_migrations
if self.has_table():
File "/home/john/.local/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 57, in has_table
with self.connection.cursor() as cursor:
File "/home/john/.local/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 323, in cursor
return self._cursor()
File "/home/john/.local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 299, in _cursor
self.ensure_connection()
File "/home/john/.local/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 281, in ensure_connection
with self.wrap_database_errors:
File "/home/john/.local/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/john/.local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 282, in ensure_connection
self.connect()
File "/home/john/.local/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 263, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 215, in get_new_connection
connection = Database.connect(**conn_params)
File "/home/john/.local/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: connection to server at "192.168.254.108", port 5432 failed: FATAL: no pg_hba.conf entry for host "192.168.254.108", user "john", database "takahe", no encryption
pg_hba.conf:
TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
host takahe john 192.168.254.108/32 trust
# IPv4 local connections:
host takahe john 192.168.254.108/32 trust
Restarted postgresql with new pg_hba.conf
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/john/.local/lib/python3.10/site-packages/django/core/servers/basehttp.py", line 47, in get_internal_wsgi_application
return import_string(app_path)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/module_loading.py", line 30, in import_string
return cached_import(module_path, class_name)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/module_loading.py", line 15, in cached_import
module = import_module(module_path)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/home/john/takahe/wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "/home/john/.local/lib/python3.10/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
return WSGIHandler()
File "/home/john/.local/lib/python3.10/site-packages/django/core/handlers/wsgi.py", line 125, in __init__
self.load_middleware()
File "/home/john/.local/lib/python3.10/site-packages/django/core/handlers/base.py", line 40, in load_middleware
middleware = import_string(middleware_path)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/module_loading.py", line 30, in import_string
return cached_import(module_path, class_name)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/module_loading.py", line 15, in cached_import
module = import_module(module_path)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'whitenoise'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 157, in inner_run
handler = self.get_handler(*args, **options)
File "/home/john/.local/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 31, in get_handler
handler = super().get_handler(*args, **options)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 78, in get_handler
return get_internal_wsgi_application()
File "/home/john/.local/lib/python3.10/site-packages/django/core/servers/basehttp.py", line 49, in get_internal_wsgi_application
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: WSGI application 'takahe.wsgi.application' could not be loaded; Error importing module.
Successfully installed whitenoise-6.2.0
December 06, 2022 - 07:14:55
Django version 4.1.3, using settings 'takahe.settings'
Starting development server at http://192.168.254.108:8080/
Quit the server with CONTROL-C.
/home/john/.local/lib/python3.10/site-packages/whitenoise/base.py:115: UserWarning: No directory at: /usr/home/john/static-collected/
warnings.warn(f"No directory at: {root}")
Created directory ~/static-collected
"Internal Server Error" in browser
Quit the server with CONTROL-C.
[06/Dec/2022 07:16:40] "GET / HTTP/1.1" 500 2096
[06/Dec/2022 07:16:40] "GET /static/fonts/raleway/raleway.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:40] "GET /static/css/style.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:40] "GET /static/fonts/font_awesome/all.min.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:40] "GET /static/js/hyperscript.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:16:40] "GET /static/js/htmx.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:16:40] "GET /favicon.ico HTTP/1.1" 500 2096
[06/Dec/2022 07:16:56] "GET /local/ HTTP/1.1" 500 2096
[06/Dec/2022 07:16:56] "GET /static/css/style.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:56] "GET /static/js/htmx.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:16:56] "GET /static/js/hyperscript.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:16:56] "GET /static/fonts/raleway/raleway.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:56] "GET /static/fonts/font_awesome/all.min.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:56] "GET /static/js/htmx.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:16:58] "GET /local/ HTTP/1.1" 500 2096
[06/Dec/2022 07:16:58] "GET /static/js/htmx.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:16:58] "GET /static/css/style.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:58] "GET /static/fonts/font_awesome/all.min.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:58] "GET /static/fonts/raleway/raleway.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:58] "GET /static/js/hyperscript.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:16:58] "GET /static/js/htmx.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:16:59] "GET /explore/ HTTP/1.1" 500 2096
[06/Dec/2022 07:16:59] "GET /static/css/style.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:59] "GET /static/js/hyperscript.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:16:59] "GET /static/js/htmx.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:16:59] "GET /static/fonts/raleway/raleway.css HTTP/1.1" 500 2096
[06/Dec/2022 07:16:59] "GET /static/fonts/font_awesome/all.min.css HTTP/1.1" 500 2096
[06/Dec/2022 07:17:05] "GET /auth/login/ HTTP/1.1" 500 2096
[06/Dec/2022 07:17:06] "GET /static/css/style.css HTTP/1.1" 500 2096
[06/Dec/2022 07:17:06] "GET /static/js/hyperscript.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:17:06] "GET /static/fonts/font_awesome/all.min.css HTTP/1.1" 500 2096
[06/Dec/2022 07:17:06] "GET /static/js/htmx.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:17:06] "GET /static/fonts/raleway/raleway.css HTTP/1.1" 500 2096
-chmod -R 777 /home/john/static
Quit the server with CONTROL-C.
[06/Dec/2022 07:20:41] "GET / HTTP/1.1" 500 2096
[06/Dec/2022 07:20:41] "GET /static/fonts/raleway/raleway.css HTTP/1.1" 500 2096
[06/Dec/2022 07:20:41] "GET /static/css/style.css HTTP/1.1" 500 2096
[06/Dec/2022 07:20:41] "GET /static/fonts/font_awesome/all.min.css HTTP/1.1" 500 2096
[06/Dec/2022 07:20:41] "GET /static/js/hyperscript.min.js HTTP/1.1" 500 2096
[06/Dec/2022 07:20:41] "GET /static/js/htmx.min.js HTTP/1.1" 500 2096
def homepage(request):
if request.user.is_authenticated:
return Home.as_view()(request)
else:
return LoggedOutHomepage.as_view()(request)
class LoggedOutHomepage(TemplateView):
template_name = "index.html"
def get_context_data(self):
return {
"identities": Identity.objects.filter(
local=True,
discoverable=True,
).order_by("-created")[:20],
}
The above is from /home/joohn/core/views.py which shows there should be an "index.html" template
index.html relevant info is:
{% extends "base.html" %}
{% block title %}Welcome{% endblock %}
{% block content %}
<div class="about">
<img class="banner" src="{{ config.site_banner }}">
{{ config.site_about|safe|linebreaks }}
</div>
<h2>People</h2>
{% for identity in identities %}
{% include "activities/_identity.html" %}
{% endfor %}
{% endblock %}
One issue I see is that there is no activities/_indentity.html
Found _identity.html
After running "python3.10 manage.py migrate" the page loads.
Most of the styles (css and fonts) aren't loading, working on that.
Tried creating an account, but did not receive a confirmation e-mail with
account information.
Need to create superuser
python3.9 manage.py creatsuperuser --username=jauntyd --email=jauntyd@hotmail.com
ModuleNotFoundError: No module named 'sentry_sdk'
python3.10 -m pip install sentry_sdk
Requirement already satisfied: sentry_sdk in ./.local/lib/python3.10/site-packages (1.11.1)
Requirement already satisfied: certifi in ./.local/lib/python3.10/site-packages (from sentry_sdk) (2022.9.24)
Requirement already satisfied: urllib3>=1.26.11 in ./.local/lib/python3.10/site-packages (from sentry_sdk) (1.26.13)
Successfully created superuser
Create User form needs an action defined....working on it
Pointed Create button at email sample form which gave a 404 error for the action arg:
<form action="/email/send.py" method="POST">
root@bsdlabs-takahe:/home/john # cd email
root@bsdlabs-takahe:/home/john/email # ls
send.py
Email sends to console via class based view, but only when app starts. Still working on it...
views:
class NewAccount(View):
#template_name="templates/auth/signup.html"
send_mail('subject', 'another message', 'from@from.from', ['to@to.to'],)
urls:
path("signup/", core.NewAccount.as_view()),
view:
class NewAccount(TemplateView):
template_name="templates/auth/signup.html"
Looks better, but 500 error now
As of right now: 500 error without "send_mail" function and
only "sends" message to console when the app starts with send_mail.
Probably user error - working on it.
***12/12/22 - Fresh install (only updated takahe code, no modification of python)***
-Turned on DEBUG and adjusted DB username and password
Traceback (most recent call last):
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 74, in execute
super().execute(*args, **options)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 81, in handle
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 92, in __getattr__
self._setup(name)
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 79, in _setup
self._wrapped = Settings(settings_module)
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 190, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/home/john/takahe/takahe/settings.py", line 9, in <module>
import django_cache_url
ModuleNotFoundError: No module named 'django_cache_url'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/home/john/takahe/manage.py", line 38, in <module>
main()
File "/usr/home/john/takahe/manage.py", line 34, in main
execute_from_command_line(sys.argv)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/base.py", line 415, in run_from_argv
connections.close_all()
File "/home/john/.local/lib/python3.10/site-packages/django/utils/connection.py", line 84, in close_all
for conn in self.all(initialized_only=True):
File "/home/john/.local/lib/python3.10/site-packages/django/utils/connection.py", line 76, in all
return [
File "/home/john/.local/lib/python3.10/site-packages/django/utils/connection.py", line 73, in __iter__
return iter(self.settings)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/connection.py", line 45, in settings
self._settings = self.configure_settings(self._settings)
File "/home/john/.local/lib/python3.10/site-packages/django/db/utils.py", line 148, in configure_settings
databases = super().configure_settings(databases)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/connection.py", line 50, in configure_settings
settings = getattr(django_settings, self.settings_name)
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 92, in __getattr__
self._setup(name)
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 79, in _setup
self._wrapped = Settings(settings_module)
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 190, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/home/john/takahe/takahe/settings.py", line 9, in <module>
import django_cache_url
ModuleNotFoundError: No module named 'django_cache_url'
-python3.10 -m pip install django_cache_url
-python3.10 manage.py runserver 192.168.254.108:8080
Traceback (most recent call last):
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 74, in execute
super().execute(*args, **options)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 81, in handle
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 92, in __getattr__
self._setup(name)
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 79, in _setup
self._wrapped = Settings(settings_module)
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 190, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/home/john/takahe/takahe/settings.py", line 9, in <module>
import django_cache_url
ModuleNotFoundError: No module named 'django_cache_url'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/home/john/takahe/manage.py", line 38, in <module>
main()
File "/usr/home/john/takahe/manage.py", line 34, in main
execute_from_command_line(sys.argv)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/john/.local/lib/python3.10/site-packages/django/core/management/base.py", line 415, in run_from_argv
connections.close_all()
File "/home/john/.local/lib/python3.10/site-packages/django/utils/connection.py", line 84, in close_all
for conn in self.all(initialized_only=True):
File "/home/john/.local/lib/python3.10/site-packages/django/utils/connection.py", line 76, in all
return [
File "/home/john/.local/lib/python3.10/site-packages/django/utils/connection.py", line 73, in __iter__
return iter(self.settings)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/connection.py", line 45, in settings
self._settings = self.configure_settings(self._settings)
File "/home/john/.local/lib/python3.10/site-packages/django/db/utils.py", line 148, in configure_settings
databases = super().configure_settings(databases)
File "/home/john/.local/lib/python3.10/site-packages/django/utils/connection.py", line 50, in configure_settings
settings = getattr(django_settings, self.settings_name)
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 92, in __getattr__
self._setup(name)
File "/home/john/.local/lib/python3.10/site-packages/django/conf/__init__.py", line 79, in _setup
self._wrapped = Settings(settings_module)