Commit 2a23b839 authored by Marc Feger's avatar Marc Feger
Browse files

Merge feedingChickenWithChicken into main

parents 6eea45af 454ca64d
Pipeline #75194 failed with stages
in 33 seconds
......@@ -24,8 +24,8 @@ yarn-error.log*
*.eslintcache
*/media/account/images/
the_social_network/django_static
social_network/django_static
pypi/*/
the_social_network/dist
the_social_network/the_social_network.egg-info
\ No newline at end of file
social_network/dist
social_network/the_social_network.egg-info
\ No newline at end of file
......@@ -33,7 +33,7 @@ test:
script:
- echo "Testing ..."
- docker-compose -f docker-compose.ci.yml pull
- docker-compose -f docker-compose.ci.yml run web sh -c "poetry run python manage.py makemigrations && poetry run python manage.py migrate && poetry run python manage.py test core -v 2"
- docker-compose -f docker-compose.ci.yml run web sh -c "poetry run python manage.py makemigrations && poetry run python manage.py migrate && poetry run python manage.py test the_social_network -v 2"
deploy:
only:
......@@ -43,9 +43,7 @@ deploy:
- test
script:
- echo "Deploying ..."
- cd ./the_social_network
- mv ./the_social_network ./not_needed
- mv ./core ./the_social_network
- cd ./social_network
- apk add py-pip
- pip install poetry
- poetry --version
......
# The Social Network
`the_social_network/` is the backend of the most thinkable fronted for social networks, which was developed with [Django](https://www.djangoproject.com/) and [Django Rest Framework](https://www.django-rest-framework.org/)
`social_network/` is the backend of the most thinkable fronted for social networks, which was developed with [Django](https://www.djangoproject.com/) and [Django Rest Framework](https://www.django-rest-framework.org/)
This subproject is the basis for any possible type of social networks.
The `core/` subfolder is the core of this project an is managed to working as a starting point for any further works on basic social networks.
The `the_social_network/` subfolder is the core of this project an is managed to working as a starting point for any further works on basic social networks.
Use the [Postman-Documentation](https://documenter.getpostman.com/view/13331140/TzRNFVaC) and run it locally for a detailed overview about the API.
Make sure the database is seeded with corresponding data.
......
version: "3"
services:
web:
build: ./the_social_network
build: ./social_network
image: ${REGISTRY}/feger/the-social-network/web:latest
volumes:
- ./the_social_network:/code
\ No newline at end of file
- ./social_network:/code
......@@ -3,11 +3,11 @@ version: '3'
services:
the_social_network:
container_name: the_social_network
build: ./the_social_network
build: ./social_network
restart: always
command: sh -c "poetry run python manage.py collectstatic --noinput && poetry run python manage.py runserver 0.0.0.0:9000"
volumes:
- ./the_social_network:/code
- ./social_network:/code
networks:
- webnet
ports:
......
......@@ -6,7 +6,7 @@ import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'the_social_network.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'social_network.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
......
"""
ASGI config for the_social_network project.
ASGI config for social_network project.
It exposes the ASGI callable as a module-level variable named ``application``.
......@@ -11,6 +11,6 @@ import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'the_social_network.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'social_network.settings')
application = get_asgi_application()
"""
Django settings for the_social_network project.
Django settings for social_network project.
Generated by 'django-admin startproject' using Django 3.1.2.
......@@ -42,7 +42,7 @@ INSTALLED_APPS = [
'corsheaders',
'rest_framework',
'rest_framework.authtoken',
'core',
'the_social_network',
]
MIDDLEWARE = [
......@@ -56,7 +56,7 @@ MIDDLEWARE = [
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'the_social_network.urls'
ROOT_URLCONF = 'social_network.urls'
TEMPLATES = [
{
......@@ -74,7 +74,7 @@ TEMPLATES = [
},
]
WSGI_APPLICATION = 'the_social_network.wsgi.application'
WSGI_APPLICATION = 'social_network.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
......@@ -133,3 +133,8 @@ REST_FRAMEWORK = {
# Folder to store media data
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
"""the_social_network URL Configuration
"""social_network URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
......@@ -21,8 +21,8 @@ from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
url(r'^authentication/', include('core.urls.authenticationUrls')),
url(r'^accounts/', include('core.urls.accountUrls')),
url(r'^search/', include('core.urls.searchUrls')),
url(r'^contents/', include('core.urls.contentUrls')),
url(r'^authentication/', include('the_social_network.urls.authenticationUrls')),
url(r'^accounts/', include('the_social_network.urls.accountUrls')),
url(r'^search/', include('the_social_network.urls.searchUrls')),
url(r'^contents/', include('the_social_network.urls.contentUrls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
"""
WSGI config for the_social_network project.
WSGI config for social_network project.
It exposes the WSGI callable as a module-level variable named ``application``.
......@@ -11,6 +11,6 @@ import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'the_social_network.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'social_network.settings')
application = get_wsgi_application()
......@@ -2,4 +2,4 @@ from django.apps import AppConfig
class AuthenticationConfig(AppConfig):
name = 'core'
name = 'the_social_network'
......@@ -26,8 +26,8 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
('from_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='from_account', to='core.account')),
('to_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='to_account', to='core.account')),
('from_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='from_account', to='the_social_network.account')),
('to_account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='to_account', to='the_social_network.account')),
],
options={
'ordering': ('-created',),
......@@ -36,7 +36,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='account',
name='related_to',
field=models.ManyToManyField(blank=True, default=None, related_name='related_by', through='core.Relationship', to='core.Account'),
field=models.ManyToManyField(blank=True, default=None, related_name='related_by', through='the_social_network.Relationship', to='the_social_network.Account'),
),
migrations.CreateModel(
name='Statement',
......@@ -44,7 +44,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.CharField(max_length=120)),
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.account')),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='the_social_network.account')),
],
options={
'ordering': ('-created',),
......@@ -63,8 +63,8 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
('hashtag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='hashtag', to='core.hashtag')),
('statement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.statement')),
('hashtag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='hashtag', to='the_social_network.hashtag')),
('statement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='the_social_network.statement')),
],
options={
'ordering': ('-created',),
......@@ -73,15 +73,15 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='statement',
name='tagged',
field=models.ManyToManyField(blank=True, default=None, related_name='tags', through='core.HashtagTagging', to='core.Hashtag'),
field=models.ManyToManyField(blank=True, default=None, related_name='tags', through='the_social_network.HashtagTagging', to='the_social_network.Hashtag'),
),
migrations.CreateModel(
name='AccountTagging',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='account', to='core.account')),
('statement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.statement')),
('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='account', to='the_social_network.account')),
('statement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='the_social_network.statement')),
],
options={
'ordering': ('-created',),
......@@ -90,7 +90,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='statement',
name='mentioned',
field=models.ManyToManyField(blank=True, default=None, related_name='mentions', through='core.AccountTagging', to='core.Account'),
field=models.ManyToManyField(blank=True, default=None, related_name='mentions', through='the_social_network.AccountTagging', to='the_social_network.Account'),
),
migrations.CreateModel(
name='Reaction',
......@@ -98,8 +98,8 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
('vote', models.PositiveSmallIntegerField(choices=[(1, 'like'), (2, 'dislike')], default=1)),
('child', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='child', to='core.statement')),
('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parent', to='core.statement')),
('child', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='child', to='the_social_network.statement')),
('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parent', to='the_social_network.statement')),
],
options={
'ordering': ('-created',),
......@@ -108,6 +108,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='statement',
name='reactions',
field=models.ManyToManyField(blank=True, default=None, related_name='reaction_of', through='core.Reaction', to='core.Statement'),
field=models.ManyToManyField(blank=True, default=None, related_name='reaction_of', through='the_social_network.Reaction', to='the_social_network.Statement'),
),
]
......@@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
('the_social_network', '0001_initial'),
]
operations = [
......
Supports Markdown
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