Init hacking

This commit is contained in:
decentral1se 2021-03-17 15:33:34 +01:00
commit 62243b568d
Signed by: decentral1se
GPG Key ID: 92DAD76BD9567B8A
21 changed files with 145 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/static/

25
manage.py Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env python
import os
import sys
from djangoldp.conf import ldpsettings
if __name__ == "__main__":
ldpsettings.configure('settings.yml')
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django
except ImportError:
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?"
)
raise
execute_from_command_line(sys.argv)

0
server/__init__.py Normal file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

2
server/admin.py Normal file
View File

@ -0,0 +1,2 @@
from django.contrib import admin
from djangoldp.admin import DjangoLDPAdmin

View File

@ -0,0 +1,31 @@
# Generated by Django 2.2.18 on 2021-02-05 10:22
from django.db import migrations, models
import djangoldp.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Todo',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('urlid', djangoldp.fields.LDPUrlField(blank=True, null=True, unique=True)),
('is_backlink', models.BooleanField(default=False, help_text='set automatically to indicate the Model is a backlink')),
('allow_create_backlink', models.BooleanField(default=True, help_text='set to False to disable backlink creation after Model save')),
('name', models.CharField(max_length=255)),
('deadline', models.DateTimeField()),
],
options={
'abstract': False,
'default_permissions': ('add', 'change', 'delete', 'view', 'control'),
'depth': 0,
},
),
]

View File

@ -0,0 +1,17 @@
# Generated by Django 2.2.19 on 2021-03-15 10:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('server', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='todo',
options={'default_permissions': ['add', 'change', 'delete', 'view', 'control']},
),
]

View File

@ -0,0 +1,16 @@
# Generated by Django 2.2.19 on 2021-03-15 10:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('server', '0002_auto_20210315_1108'),
]
operations = [
migrations.DeleteModel(
name='Todo',
),
]

View File

Binary file not shown.

2
server/models.py Normal file
View File

@ -0,0 +1,2 @@
from django.db import models
from djangoldp.models import Model

12
server/urls.py Normal file
View File

@ -0,0 +1,12 @@
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r"^", include("djangoldp.urls")),
url(r"^admin/", admin.site.urls),
]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

17
server/wsgi.py Normal file
View File

@ -0,0 +1,17 @@
import os
from django.conf import settings as django_settings
from django.core.wsgi import get_wsgi_application
from djangoldp.conf import ldpsettings
if not django_settings.configured:
ldpsettings.configure()
application = get_wsgi_application()
try:
from djangoldp.activities.services import ActivityQueueService
ActivityQueueService.start()
except:
pass

22
settings.yml Normal file
View File

@ -0,0 +1,22 @@
dependencies:
ldppackages:
server:
DEBUG: true
ALLOWED_HOSTS:
- "*"
SECRET_KEY: "ak$t4x@9pcs$ypwt_m38)vcg^m=q@j7*2rs2gu7%h0wwcv)(y2"
DATABASES:
default:
ENGINE: django.db.backends.postgresql_psycopg2
NAME: djangoldp
USER: postgres
PASSWORD: passw0rd
LDP_RDF_CONTEXT: https://cdn.happy-dev.fr/owl/hdcontext.jsonld
ROOT_URLCONF: server.urls
STATIC_ROOT: static
MEDIA_ROOT: media
INSTALLED_APPS:
- server
- djangoldp_crypto