diff --git a/README.md b/README.md index e9f9a2b..2d590d6 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,50 @@ RaspberryPi Club Website in Django -## Stuff we used to make our site +## Building and developing + +### Quickstart + +1) clone the repo and cd into the folder +2) Build the image locally: `docker compose build` +3) Bring up the dtabase container: `docker compose up database_default -d` +4) Generate the tables and apply patches: `docker compose run --rm -it web python manage.py migrate` +5) Create a superuser to use: `docker compose run --rm -it web python manage.py createsuperuser` +6) Bring up the actual web engine: `docker compose up -d` + +## Stuff we used to make our site engine Here are some links to docs and sources of the tools, modules, etc that we used to make our website/application. If/when we use/add more - we will add links to them here as well. +Docker + +- https://docs.docker.com/manuals/ + +Github + +- https://github.com/ + +Django + +- Django: https://www.djangoproject.com/ +- Package index for common published options: https://djangopackages.org/ + +Python (Django is build with Python) + +- https://docs.python.org/3/ +- https://pypi.org/ + +PostgreSQL (our database of choice for production) + +- https://www.postgresql.org/ + +DjangoCMS (a Django plugin/module providing content management features) + - https://user-guide.django-cms.org/en/latest/ +- https://docs.django-cms.org/en/latest/introduction/01-install.html + +Django-material-kit (a nice theme to start with) + - https://github.com/app-generator/django-material-kit - https://github.com/app-generator/django-theme-material-kit -- https://docs.django-cms.org/en/latest/introduction/01-install.html - - https://docs.django-cms.org/en/latest/index.html -- https://django-organizations.readthedocs.io/en/latest/index.html -- https://django-userena-ce.github.io/django-userena-ce/installation.html \ No newline at end of file + diff --git a/backend/settings.py b/backend/settings.py index 0ecc8ff..9912c9f 100644 --- a/backend/settings.py +++ b/backend/settings.py @@ -84,6 +84,10 @@ # Django Debug Toolbar 'debug_toolbar', + + # User accounts/profiles + 'guardian', + ] MIDDLEWARE = [ @@ -247,6 +251,23 @@ 'localhost', # For Docker on Windows and macOS ] +AUTHENTICATION_BACKENDS = ( + 'guardian.backends.ObjectPermissionBackend', + 'django.contrib.auth.backends.ModelBackend', +) +#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' +#EMAIL_USE_TLS = True +#EMAIL_HOST = 'smtp.gmail.com' +#EMAIL_PORT = 587 +#EMAIL_HOST_USER = 'yourgmailaccount@gmail.com' +#EMAIL_HOST_PASSWORD = 'yourgmailpassword' +#DEFAULT_FROM_EMAIL = EMAIL_HOST_USER +#SERVER_EMAIL = EMAIL_HOST_USER + +#AUTH_PROFILE_MODULE = 'accounts.UserProfile' + + +# Django Debug Toolbar fix for use inside a container DEBUG_TOOLBAR_CONFIG = { 'SHOW_TOOLBAR_CALLBACK': lambda _request: DEBUG } \ No newline at end of file diff --git a/backend/urls.py b/backend/urls.py index 7e20624..c88ea29 100644 --- a/backend/urls.py +++ b/backend/urls.py @@ -6,7 +6,7 @@ urlpatterns = [ path('admin/', admin.site.urls), - path("material/", include('theme_material_kit.urls')), + path('material/', include('theme_material_kit.urls')), ] + debug_toolbar_urls() if settings.DEBUG: diff --git a/requirements.txt b/requirements.txt index f34a494..26d61cf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -176,4 +176,6 @@ str2bool==1.1 django-theme-material-kit==1.0.25 +guardian==0.2.2 + django-debug-toolbar \ No newline at end of file