Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 user profiles #12

Merged
merged 6 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 41 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

21 changes: 21 additions & 0 deletions backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@

# Django Debug Toolbar
'debug_toolbar',

# User accounts/profiles
'guardian',

]

MIDDLEWARE = [
Expand Down Expand Up @@ -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 = '[email protected]'
#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
}
2 changes: 1 addition & 1 deletion backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,6 @@ str2bool==1.1
django-theme-material-kit==1.0.25


guardian==0.2.2

django-debug-toolbar
Loading