Commit 98d1c0d9 authored by rakvat's avatar rakvat

initial django

parent 17381be9
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
django = "==2.2"
psycopg2 = "*"
[requires]
python_version = "3.6"
{
"_meta": {
"hash": {
"sha256": "db73527e20f003c0866aea1c670790acc3647405e2a3c2f1fdbc116156f9d2d3"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.6"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"django": {
"hashes": [
"sha256:7c3543e4fb070d14e10926189a7fcf42ba919263b7473dceaefce34d54e8a119",
"sha256:a2814bffd1f007805b19194eb0b9a331933b82bd5da1c3ba3d7b7ba16e06dc4b"
],
"index": "pypi",
"version": "==2.2"
},
"psycopg2": {
"hashes": [
"sha256:00cfecb3f3db6eb76dcc763e71777da56d12b6d61db6a2c6ccbbb0bff5421f8f",
"sha256:076501fc24ae13b2609ba2303d88d4db79072562f0b8cc87ec1667dedff99dc1",
"sha256:4e2b34e4c0ddfeddf770d7df93e269700b080a4d2ec514fec668d71895f56782",
"sha256:5cacf21b6f813c239f100ef78a4132056f93a5940219ec25d2ef833cbeb05588",
"sha256:61f58e9ecb9e4dc7e30be56b562f8fc10ae3addcfcef51b588eed10a5a66100d",
"sha256:8954ff6e47247bdd134db602fcadfc21662835bd92ce0760f3842eacfeb6e0f3",
"sha256:b6e8c854cdc623028e558a409b06ea2f16d13438335941c7765d0a42b5bedd33",
"sha256:baca21c0f7344576346e260454d0007313ccca8c170684707a63946b27a56c8f",
"sha256:bb1735378770fb95dbe392d29e71405d45c8bdcfa064f916504833a92ab03c55",
"sha256:de3d3c46c1ee18f996db42d1eb44cf1565cc9e38fb1dbd9b773ff6b3fa8035d7",
"sha256:dee885602bb200bdcb1d30f6da6c7bb207360bc786d0a364fe1540dd14af0bab"
],
"index": "pypi",
"version": "==2.8.2"
},
"pytz": {
"hashes": [
"sha256:303879e36b721603cc54604edcac9d20401bdbe31e1e4fdee5b9f98d5d31dfda",
"sha256:d747dd3d23d77ef44c6a3526e274af6efeb0a6f1afd5a69ba4d5be4098c8e141"
],
"version": "==2019.1"
},
"sqlparse": {
"hashes": [
"sha256:40afe6b8d4b1117e7dff5504d7a8ce07d9a1b15aeeade8a2d10f130a834f8177",
"sha256:7c3dca29c022744e95b547e867cee89f4fce4373f3549ccd8797d8eb52cdb873"
],
"version": "==0.3.0"
}
},
"develop": {}
}
......@@ -7,6 +7,16 @@
## Tech Setup
### Django app
```
pipenv shell
python manage.py runserver
```
### Diagrams
The diagrams are generated with [PlantUML](http://plantuml.com):
```
cd diagrams && java -jar plantuml.jar *.txt
......
......@@ -40,6 +40,7 @@ This is the basic framework that hopefully many people can agree on and that giv
### Implementation
People continue living where and how they want. Instead of voting for a party that will make decisions, those who want to take part in decisions get organized (by going to meetings or in online communication) in various groups or send someone they trust to those groups:
1. Consumption councils communicate the needs of people in a specific area (consumption community). (Of course, individuals can also communicate their own needs if they are not part of a council).
2. Production collectives (or individuals) communicate what they are able to produce and what kind of resources they need for production (this includes care and reproduction work).
3. Coordination committees plan how the needs could be met best with the available resources and production capacities. In the case of scarce resources, they will have to find solutions that are as fair as possible for everyone involved. In the case of distribution conflicts, they meditate between consumption councils and production collectives until everyone involved can live with the proposed solution. The coordination committee does not force a decision on the people but supports them in finding a decision that is best for everyone. (The plans should not be as rigid as Soviet 5-year plans and way more decentralized but they need to include long term planning for scarce and toxic resources as well as dynamic day-to-day adaption possibilities.)
......@@ -66,6 +67,7 @@ The goal of free and solidary communities has to be present in the ways that are
The idea of transformation via reforms implemented by the government sounds unrealistic because the goal is a society without government and the government will probably not be willing to remove itself. Some social improvements can be reached with reforms, system change probably not.
A forceful and violent revolution sounds unrealistic too for multiple reasons:
1. With today's technology (surveillance and weapons) we can no longer hope to just storm the Bastille - the government/military can decide to kill those movements if they want to with their resources.
2. The use of force is not compatible with the goal and will just generate more violence instead of a free society.
3. If force is required, it means that not enough people agreed with the goals of the transformation yet and those might try to create new leaders and governments after the revolution.
......@@ -97,6 +99,7 @@ Right-wing movements are racist, elitist, sexist, and exclusionary (they might o
3. Projects help to start new projects by supporting them with knowledge and resources.
The seed level can get more traction and become dominant by (some ideas just to show that there are many ways):
0. Spreading the idea in many languages and in various social, cultural, and artistic styles.
1. Building bigger projects and autonomous regions that implement the ideas of free and solidary societies.
2. The same approach could be applied to small cities ("Projekt A" in Neustadt was an example of that).
......@@ -121,7 +124,8 @@ Start with various approaches everywhere. Now.
## References
This text is influenced by
This text is influenced by:
- Simon Sutterlütti/Stefan Meretz: Kapitalismus aufheben and https://keimform.de
- Ursula K. Le Guin: The Dispossessed
- P.M.: bolo'bolo
......
"""
Django settings for fsoso_web project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '&258t*l(*e4#4zvdb1b$hop(+h_5px0tbznx5vr2xpu9j61#+7'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'web.apps.WebConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'fsoso_web.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'fsoso_web.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'fsoso',
'USER': 'fsoso_user',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '',
}
}
# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/'
"""fsoso_web URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('web/', include('web.urls')),
path('admin/', admin.site.urls),
]
"""
WSGI config for fsoso_web project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fsoso_web.settings')
application = get_wsgi_application()
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fsoso_web.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
from django.contrib import admin
from .models import Good
class GoodAdmin(admin.ModelAdmin):
fields = ['name', 'description', 'expires_at']
admin.site.register(Good, GoodAdmin)
from django.apps import AppConfig
class WebConfig(AppConfig):
name = 'web'
# Generated by Django 2.2 on 2019-05-19 17:51
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Good',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('description', models.TextField()),
('expires_at', models.DateTimeField(verbose_name='expires at')),
],
),
]
from django.utils import timezone
from django.db import models
class Good(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
expires_at = models.DateTimeField('expires at')
def __str__(self):
return self.name
def is_expired(self):
return self.expires_at < timezone.now()
@classmethod
def non_expired(cls):
return cls.objects.filter(expires_at__gte=timezone.now())
from django.test import TestCase
# Create your tests here.
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
]
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. This is FSoSo taking")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment