Skip to content

Commit 205fc04

Browse files
committed
adding models
1 parent b5072b1 commit 205fc04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+13396
-28
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Ignore Python bytecode
2+
__pycache__
3+
*.pyc
4+
*.pyo
5+
*.pyd
6+
7+
# django_project stuff
8+
src/django_project/*.sqlite3
9+
src/django_project/*.log
10+
src/django_project/local_test
11+
src/django_project/tests

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ var/
1919
.installed.cfg
2020
*.egg
2121
/venv/
22+
/venv*/
23+
2224

2325
# PyInstaller
2426
# Usually these files are written by a python script from a template
@@ -65,7 +67,14 @@ target/
6567

6668
# Project Specific
6769
local_test
68-
envs/.env.local
69-
django_project/django_logs
70+
src/envs/*
71+
!src/envs/.env.template
72+
src/logs
7073
django_project/yarn.lock
7174
django_project/__version__.py
75+
src/docker/.env*
76+
src/docker/db.yaml
77+
src/django_project/core/static/node_modules
78+
src/django_project/core/static/package.json
79+
src/django_project/core/static/package-lock.json
80+
*.sass-cache/*

LICENSE

Lines changed: 674 additions & 21 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 115 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,115 @@
1-
# django_repo_template
2-
standardized git template for creating new django projects
1+
# SpokanePython.com
2+
Home of SpokanePython, an online hub for Spokane's tech events and groups. It's not just a website; it's a community-driven, open-source initiative aimed at fostering learning and collaboration among aspiring and seasoned tech enthusiasts.
3+
4+
5+
See the live site here:
6+
https://www.spokanepython.com
7+
8+
<br/>
9+
10+
## Code Quality
11+
| Workflow | Description | Status |
12+
|----------|-------------------------|------------------------------------------------------------------------------|
13+
|Bandit|security checks|![Bandit](https://github.com/SpokaneTech/SpokanePythonWeb/actions/workflows/bandit.yaml/badge.svg)|
14+
|Isort|python import ordering|![Isort](https://github.com/SpokaneTech/SpokanePythonWeb/actions/workflows/isort.yaml/badge.svg)|
15+
|Mypy|static type checking|![Mypy](https://github.com/SpokaneTech/SpokanePythonWeb/actions/workflows/mypy.yaml/badge.svg)|
16+
|Radon|code complexity analysis|![Radon](https://github.com/SpokaneTech/SpokanePythonWeb/actions/workflows/radon.yaml/badge.svg)|
17+
|Ruff Format|code formatting|![Format](https://github.com/SpokaneTech/SpokanePythonWeb/actions/workflows/ruff_format.yaml/badge.svg)|
18+
|Ruff Lint|static code analysis|![Lint](https://github.com/SpokaneTech/SpokanePythonWeb/actions/workflows/ruff_lint.yaml/badge.svg)|
19+
20+
21+
<br/>
22+
23+
## Local Development
24+
25+
### prerequisites
26+
1. git installed on system
27+
2. python installed on system (3.10+ recommended)
28+
29+
30+
### local git setup
31+
1. clone the repo:
32+
33+
```
34+
git clone git@github.com:SpokaneTech/SpokanePythonWeb.git
35+
```
36+
37+
2. git config (optional)
38+
To enable pre-commit code quality checks, update the location of git hooks with the following command:
39+
40+
```shell
41+
git config core.hooksPath .github/hooks
42+
```
43+
44+
Note: to make a commit with the precommit hooks temporarily disabled, run the following:
45+
46+
```
47+
git commit --no-verify
48+
```
49+
50+
<br/>
51+
52+
53+
### local environment setup steps
54+
55+
1. cd into the repo directory
56+
```
57+
cd SpokanePythonWeb
58+
```
59+
60+
2. create a python virtual environment
61+
```
62+
python -m venv venv
63+
```
64+
65+
3. activate the python virtual environment
66+
67+
for linux, mac, or wsl:
68+
```
69+
source venv/bin/activate
70+
```
71+
for powershell:
72+
73+
```powershell
74+
venv\Scripts\activate
75+
```
76+
77+
4. install the python dependencies
78+
```
79+
pip install .[dev]
80+
```
81+
** mac users may need to use quotes, such as ```pip install ."[dev]"```
82+
83+
5. (optional) create a custom .env file and update contents as applicable
84+
```
85+
cp src/envs/.env.template src/envs/.env.local
86+
```
87+
88+
6. cd to the django_project directory
89+
```
90+
cd src/django_project
91+
```
92+
93+
7. create a local database by running django migrations
94+
```
95+
./manage.py migrate
96+
```
97+
98+
8. create a local admin user
99+
```
100+
./manage.py add_superuser --group admin
101+
```
102+
103+
9. (optional) add platforms and groups to your local database
104+
```
105+
./manage.py runscript initialize_data
106+
```
107+
108+
10. start the local demo server
109+
```
110+
./manage.py runserver
111+
```
112+
113+
open a browser and navigate to http://127.0.0.1:8000 (log in with admin/admin)
114+
115+
** you can stop the local demo server anytime via ```ctrl + c ```

pyproject.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
[project]
22
dependencies = [
33
"django~=5.2",
4-
"django-auditlog==2.2.0",
54
"django-braces",
6-
"django-debug-toolbar",
75
"django-environ",
86
"django-extensions",
97
"django-filter",
@@ -76,10 +74,16 @@ profile = "black"
7674

7775

7876
[tool.mypy]
79-
exclude = ["venv/*", "^django_project/*/migrations/*"]
77+
exclude = [
78+
"venv/*",
79+
"src/django_project/local_test",
80+
"src/django_project/.*/migrations/.*",
81+
"src/django_project/.*/scripts/.*",
82+
]
8083
ignore_missing_imports = true
8184

8285

86+
8387
[tool.pytest.ini_options]
8488
addopts = "-s -v -x --strict-markers -m 'not extra'"
8589
testpaths = ["django_project"]

src/django_project/core/__init__.py

Whitespace-only changes.

src/django_project/core/asgi.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for spokane_python project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
15+
16+
application = get_asgi_application()

0 commit comments

Comments
 (0)