Skip to content

Commit

Permalink
change project name from boilerplate default name to 'labrin_task'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenan7 committed Feb 10, 2021
1 parent a5a2e37 commit eae25e2
Show file tree
Hide file tree
Showing 112 changed files with 66 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ indent_size = 4

[*.py]
line_length = 79
known_first_party = my_awesome_project,config
known_first_party = labrin_task,config
multi_line_output = 3
default_section = THIRDPARTY
recursive = true
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ tags

### Project template

my_awesome_project/media/
labrin_task/media/

.pytest_cache/

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Running type checks with mypy:

::

$ mypy my_awesome_project
$ mypy labrin_task

Test coverage
^^^^^^^^^^^^^
Expand Down Expand Up @@ -78,7 +78,7 @@ To run a celery worker:

.. code-block:: bash
cd my_awesome_project
cd labrin_task
celery -A config.celery_app worker -l info
Please note: For Celery's import magic to work, it is important *where* the celery commands are run. If you are in the same folder with *manage.py*, you should be right.
Expand Down
4 changes: 2 additions & 2 deletions config/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from django.core.asgi import get_asgi_application

# This allows easy placement of apps within the interior
# my_awesome_project directory.
# labrin_task directory.
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent
sys.path.append(str(ROOT_DIR / "my_awesome_project"))
sys.path.append(str(ROOT_DIR / "labrin_task"))

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")

Expand Down
2 changes: 1 addition & 1 deletion config/celery_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")

app = Celery("my_awesome_project")
app = Celery("labrin_task")

# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
Expand Down
2 changes: 1 addition & 1 deletion config/routing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter

from my_awesome_project.chat.routing import websocket_urlpatterns
from labrin_task.chat.routing import websocket_urlpatterns

application = ProtocolTypeRouter(
{"websocket": AuthMiddlewareStack(URLRouter(websocket_urlpatterns))}
Expand Down
24 changes: 11 additions & 13 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import environ

ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
# my_awesome_project/
APPS_DIR = ROOT_DIR / "my_awesome_project"
# labrin_task/
APPS_DIR = ROOT_DIR / "labrin_task"
env = environ.Env()

READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False)
Expand Down Expand Up @@ -42,7 +42,7 @@
# https://docs.djangoproject.com/en/dev/ref/settings/#databases

DATABASES = {
"default": env.db("DATABASE_URL", default="postgres:///my_awesome_project")
"default": env.db("DATABASE_URL", default="postgres:///labrin_task")
}
DATABASES["default"]["ATOMIC_REQUESTS"] = True

Expand Down Expand Up @@ -77,17 +77,17 @@
]

LOCAL_APPS = [
"my_awesome_project.chat.apps.ChatConfig",
"my_awesome_project.users.apps.UsersConfig",
"my_awesome_project.fileapp.apps.FileappConfig",
"labrin_task.chat.apps.ChatConfig",
"labrin_task.users.apps.UsersConfig",
"labrin_task.fileapp.apps.FileappConfig",
]
# https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS

# MIGRATIONS
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#migration-modules
MIGRATION_MODULES = {"sites": "my_awesome_project.contrib.sites.migrations"}
MIGRATION_MODULES = {"sites": "labrin_task.contrib.sites.migrations"}

# AUTHENTICATION
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -190,7 +190,7 @@
"django.template.context_processors.static",
"django.template.context_processors.tz",
"django.contrib.messages.context_processors.messages",
"my_awesome_project.utils.context_processors.settings_context",
"labrin_task.utils.context_processors.settings_context",
],
},
}
Expand Down Expand Up @@ -296,11 +296,9 @@
# https://django-allauth.readthedocs.io/en/latest/configuration.html
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
# https://django-allauth.readthedocs.io/en/latest/configuration.html
ACCOUNT_ADAPTER = "my_awesome_project.users.adapters.AccountAdapter"
ACCOUNT_ADAPTER = "labrin_task.users.adapters.AccountAdapter"
# https://django-allauth.readthedocs.io/en/latest/configuration.html
SOCIALACCOUNT_ADAPTER = (
"my_awesome_project.users.adapters.SocialAccountAdapter"
)
SOCIALACCOUNT_ADAPTER = "labrin_task.users.adapters.SocialAccountAdapter"


# Your stuff...
Expand All @@ -319,7 +317,7 @@

CELERY_BEAT_SCHEDULE = {
"delete_files_older_than_x_days": {
"task": "my_awesome_project.fileapp.tasks.delete_old_files",
"task": "labrin_task.fileapp.tasks.delete_old_files",
"schedule": 20.0,
}
}
Expand Down
8 changes: 3 additions & 5 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from django.views import defaults as default_views
from django.views.generic import TemplateView

from my_awesome_project.fileapp.views import file_list_view
from labrin_task.fileapp.views import file_list_view

urlpatterns = [
path("", file_list_view, name="home"),
path(
"files/",
include("my_awesome_project.fileapp.urls"),
include("labrin_task.fileapp.urls"),
),
path(
"about/",
Expand All @@ -21,9 +21,7 @@
# Django Admin, use {% url 'admin:index' %}
path(settings.ADMIN_URL, admin.site.urls),
# User management
path(
"users/", include("my_awesome_project.users.urls", namespace="users")
),
path("users/", include("labrin_task.users.urls", namespace="users")),
path("accounts/", include("allauth.urls")),
# Your stuff: custom urls includes go here
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Expand Down
4 changes: 2 additions & 2 deletions config/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from django.core.wsgi import get_wsgi_application

# This allows easy placement of apps within the interior
# my_awesome_project directory.
# labrin_task directory.
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent
sys.path.append(str(ROOT_DIR / "my_awesome_project"))
sys.path.append(str(ROOT_DIR / "labrin_task"))
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
Expand Down
6 changes: 3 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build -c .
SOURCEDIR = .
BUILDDIR = ./_build
APP = ../my_awesome_project
APP = ../labrin_task


.PHONY: help livehtml apidocs Makefile
Expand All @@ -22,7 +22,7 @@ livehtml:

# Outputs rst files from django application code
apidocs:
sphinx-apidoc -o $(SOURCEDIR)/api ../my_awesome_project
sphinx-apidoc -o $(SOURCEDIR)/api ../labrin_task

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Expand Down
12 changes: 6 additions & 6 deletions docs/howto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ How To - Project Documentation
Get Started
----------------------------------------------------------------------

Documentation can be written as rst files in the `my_awesome_project/docs/_source`.
Documentation can be written as rst files in the `labrin_task/docs/_source`.


To build and serve docs, use the command:
::
make livehtml
from inside the `my_awesome_project/docs` directory.

make livehtml

from inside the `labrin_task/docs` directory.


Changes to files in `docs/_source` will be picked up and reloaded automatically.
Expand All @@ -30,6 +30,6 @@ For an in-use example, see the `page source <_sources/users.rst.txt>`_ for :ref:

To compile all docstrings automatically into documentation source files, use the command:
::

make apidocs

2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=_source
set BUILDDIR=_build
set APP=..\my_awesome_project
set APP=..\labrin_task

if "%1" == "" goto help

Expand Down
8 changes: 4 additions & 4 deletions docs/users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Users
======================================================================

Starting a new project, it’s highly recommended to set up a custom user model,
even if the default User model is sufficient for you.
Starting a new project, it’s highly recommended to set up a custom user model,
even if the default User model is sufficient for you.

This model behaves identically to the default user model,
This model behaves identically to the default user model,
but you’ll be able to customize it in the future if the need arises.

.. automodule:: my_awesome_project.users.models
.. automodule:: labrin_task.users.models
:members:
:noindex:

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class ChatConfig(AppConfig):
name = "my_awesome_project.chat"
name = "labrin_task.chat"
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.contrib.auth import get_user_model
from django.db.models.query_utils import Q

from my_awesome_project.fileapp.models import FileModel
from labrin_task.fileapp.models import FileModel

from .models import ChatMessages

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.contrib.auth import get_user_model
from django.db.models import CASCADE, SET_NULL, CharField, ForeignKey

from my_awesome_project.common import TimeStampedModel
from my_awesome_project.fileapp.models import FileModel
from labrin_task.common import TimeStampedModel
from labrin_task.fileapp.models import FileModel

User = get_user_model()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions my_awesome_project/conftest.py → labrin_task/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from my_awesome_project.users.models import User
from my_awesome_project.users.tests.factories import UserFactory
from labrin_task.users.models import User
from labrin_task.users.tests.factories import UserFactory


@pytest.fixture(autouse=True)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class FileappConfig(AppConfig):
name = "my_awesome_project.fileapp"
name = "labrin_task.fileapp"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ManyToManyField,
)

from my_awesome_project.common import TimeStampedModel
from labrin_task.common import TimeStampedModel

User = get_user_model()
# User = settings.AUTH_USER_MODEL
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from django.test import TestCase
from django.test.utils import override_settings

from my_awesome_project.fileapp.models import FileModel
from my_awesome_project.fileapp.tasks import delete_old_files
from labrin_task.fileapp.models import FileModel
from labrin_task.fileapp.tasks import delete_old_files

User = get_user_model()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _

from my_awesome_project.users.forms import UserChangeForm, UserCreationForm
from labrin_task.users.forms import UserChangeForm, UserCreationForm

User = get_user_model()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@


class UsersConfig(AppConfig):
name = "my_awesome_project.users"
name = "labrin_task.users"
verbose_name = _("Users")

def ready(self):
try:
import my_awesome_project.users.signals # noqa F401
import labrin_task.users.signals # noqa F401
except ImportError:
pass
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from django.urls import reverse

from my_awesome_project.users.models import User
from labrin_task.users.models import User

pytestmark = pytest.mark.django_db

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from my_awesome_project.users.forms import UserCreationForm
from my_awesome_project.users.tests.factories import UserFactory
from labrin_task.users.forms import UserCreationForm
from labrin_task.users.tests.factories import UserFactory

pytestmark = pytest.mark.django_db

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from my_awesome_project.users.models import User
from labrin_task.users.models import User

pytestmark = pytest.mark.django_db

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pytest
from celery.result import EagerResult

from my_awesome_project.users.tasks import get_users_count
from my_awesome_project.users.tests.factories import UserFactory
from labrin_task.users.tasks import get_users_count
from labrin_task.users.tests.factories import UserFactory

pytestmark = pytest.mark.django_db

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from django.urls import resolve, reverse

from my_awesome_project.users.models import User
from labrin_task.users.models import User

pytestmark = pytest.mark.django_db

Expand Down
Loading

0 comments on commit eae25e2

Please sign in to comment.