Skip to content

Commit 3d88f0e

Browse files
authored
Misc (#228)
* update license * Add explicit port forward for devcontainer * fix pyproject error * Update constitution.json * Silence useless startup warning * Add documentation for repository layout * Update link styles * Update "about" page * Update README * Fix contributing webhook url * fix the fix
1 parent 44f994f commit 3d88f0e

18 files changed

Lines changed: 341 additions & 44 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
// "remoteEnv": {"PATH": "/home/dev-user/.local/bin:${containerEnv:PATH}"},
2626
"remoteUser": "dev-user",
2727
"workspaceFolder": "/app",
28+
"forwardPorts": [
29+
8000 // Github codespaces cant' detect this port automatically for some reason
30+
],
2831
"features": {
2932
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
3033
},

.prettierignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ To test your webhook, follow these `instructions`_. (If you have a preferred
127127
tool for exposing your local server, feel free to replace smee with it.) If you
128128
are using smee, be sure to run::
129129

130-
$ smee --url WEBHOOK_PROXY_URL --path /webhooks/github --port 8000
130+
$ smee --url WEBHOOK_PROXY_URL --path /hooks/github/ --port 8000
131131

132132
to set the correct port and path.
133133

LICENSE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
The MIT License (MIT)
3-
Copyright (c) 2024, Matthew Foster Walsh
2+
Copyright (c) 2025, Matthew Foster Walsh
43

54
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
65

README.rst

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Democrasite
22
===========
33

4-
|Built with Cookiecutter Django| |Black code style| |Continuous integration| |Coverage report| |Documentation status|
4+
|Built with Cookiecutter Django| |Ruff| |Continuous integration| |Coverage report| |Documentation status|
55

66
.. |Built with Cookiecutter Django| image:: https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg?logo=cookiecutter
77
:target: https://github.com/pydanny/cookiecutter-django/
88

9-
.. |Black code style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
10-
:target: https://github.com/ambv/black
9+
.. |Ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
10+
:target: //github.com/astral-sh/ruff
1111

1212
.. |Continuous integration| image:: https://github.com/mfosterw/cookiestocracy/actions/workflows/ci.yml/badge.svg
1313
:target: https://github.com/mfosterw/cookiestocracy/actions/workflows/ci.yml
@@ -23,8 +23,8 @@ Democrasite
2323

2424
Democrasite is a website which automatically merges changes based on popular
2525
approval. For more information on the nature and purpose of the project, visit
26-
our `about page`_. This page is meant for people who want to clone the
27-
repository and contribute to the project. This project is approximately in beta
26+
our `about page`_. This page is meant for people who want to fork the
27+
repository and/or contribute to the project. This project is approximately in beta
2828
development (hence the repository being named "cookiestocracy" - a reference
2929
to cookiecutter and `kakistocracy`_). The alpha version is `here`_ and the
3030
full version doesn't exist yet.
@@ -55,7 +55,7 @@ Getting Started
5555
The easiest way to explore the repository is to open it in GitHub Codespaces with the
5656
button above. Once you've given the container some time to set up (it should take about
5757
three minutes), navigate to the ports tab right above the terminal and hover over port
58-
3000, then click on the browser icon that appears. You should see the development
58+
8000, then click on the browser icon that appears. You should see the development
5959
version of the homepage! (With no data yet, see below).
6060

6161
Please read the `contribution guide`_ to set up a local development environment with
@@ -64,6 +64,20 @@ following the instructions in the guide.
6464

6565
.. _`contribution guide`: https://cookiestocracy.readthedocs.io/en/latest/CONTRIBUTING.html
6666

67+
.. warning::
68+
Firefox's "advanced tracking protection" can cause problems connecting to the
69+
codespace. If you are experiencing errors, you can disable it for that page by
70+
clicking on the shield icon to the left of the URL and switching off Advanced
71+
Tracking Protection
72+
73+
74+
Understanding the repository
75+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76+
77+
Check out ``repo_map.txt`` in the root of the repository for a display of the
78+
repository layout and brief explanations for the purpose of each non-obvious file and
79+
directory.
80+
6781

6882
Management Commands
6983
-------------------
@@ -80,7 +94,7 @@ Loading initial data
8094

8195
To load some initial sample data into the database, run::
8296

83-
$ python manage.py loaddata initial.json
97+
$ python manage.py loaddata democrasite activitypub
8498

8599
Setting up your users
86100
^^^^^^^^^^^^^^^^^^^^^

config/settings/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Base settings to build other settings files upon."""
22

3+
import warnings
34
from pathlib import Path
45

56
import environ
@@ -36,8 +37,11 @@
3637

3738
# DATABASES
3839
# ------------------------------------------------------------------------------
40+
with warnings.catch_warnings():
41+
warnings.simplefilter("ignore") # environ raises an unhelpful warning here
42+
db_url = env.db("DATABASE_URL", default=None)
3943
# https://docs.djangoproject.com/en/dev/ref/settings/#databases
40-
if db_url := env.db("DATABASE_URL", default=None):
44+
if db_url:
4145
DATABASES = {"default": db_url}
4246
else:
4347
DATABASES = {

constitution.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
{
22
"constitution.json": null,
3-
"config/settings/base.py": [[340, 359]],
4-
"config/urls.py": [[9, 16]],
3+
"config/settings/base.py": [[412, 431]],
4+
"config/urls.py": [[14, 33]],
55
"democrasite/static/js/vote.js": null,
66
"democrasite/templates/base.html": null,
7-
"democrasite/users/models.py": [[7, 13]],
8-
"democrasite/users/urls.py": null,
7+
"democrasite/users/models.py": [[19, 35]],
98
"democrasite/webiscite/constitution.py": null,
10-
"democrasite/webiscite/models.py": [[11, 84]],
11-
"democrasite/webiscite/tasks.py": [
12-
[43, 80],
13-
[89, 96],
14-
[112, 176]
15-
],
16-
"democrasite/webiscite/urls.py": [[16, 22]],
17-
"democrasite/webiscite/views.py": [[110, 133]]
9+
"democrasite/webiscite/models.py": [[106, 439]],
10+
"democrasite/webiscite/tasks.py": [[23, 78]],
11+
"democrasite/webiscite/urls.py": [[10, 16]],
12+
"democrasite/webiscite/views.py": [[127, 171]]
1813
}

democrasite/contrib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
22
To understand why this file is here, please read:
33
4-
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
4+
https://cookiecutter-django.readthedocs.io/en/latest/5-help/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
55
"""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
22
To understand why this file is here, please read:
33
4-
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
4+
https://cookiecutter-django.readthedocs.io/en/latest/5-help/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
55
"""

democrasite/contrib/sites/migrations/0003_set_site_domain_and_name.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
To understand why this file is here, please read:
33
4-
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
4+
https://cookiecutter-django.readthedocs.io/en/latest/5-help/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
55
"""
66

77
from django.conf import settings

0 commit comments

Comments
 (0)