A membership website for charities written in Django and Wagtail. Charities can create a profile and events.
A membership website for charities written in Django.
Charity owners can create an account and add a profile for their charity. The site admin has to approve all charity organization profiles.
Once approved, the charity owner can login and create ‘event’ objects to tell the world about upcoming fundraising events.
New to Django and/ or Wagtail? To setup Django and Wagtail with Bootstrap and a bespoke database see my other repo for a step by step guide: https://github.com/richardgourley/django-wagtail-stepbystep
virtualenv charityorganizationeventwebsite -p python3`
cd charityorganizationeventwebsite
source bin/activate
pip install django
django-admin start charityorganizationeventwebsite
cd charityorganizationeventwebsite
pip install -r requirements.txt
Set up a database table and assign priveliges.
Create a file called ‘.env’ and add:
SECRET_KEY=12345etc.
DEBUG=True
DB_NAME=mysite
DB_USER=newusername
DB_PASSWORD=password
DB_HOST=127.0.0.1
PORT=3306
Install python decouple, any database client you require (MySQL example used here)
pip install python-decouple
pip install mysqlclient
Install django-countries
pip install django-countries
See files in ‘/settings’ dir to see how to set up python-decouple ‘config’, django-countries, abstract user and bespoke database.
python manage.py startapp accounts
python manage.py startapp events
NOTE: Setup custom user code from the app ‘accounts’ before the first migration:
See https://learndjango.com/tutorials/django-custom-user-model for more on custom user models.
Usual python web application creation
python manage.py makemigrations accounts
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
There is some debate over whether to use a Custom User model or to create a one-to-one field for a model called ‘Profile’ linked to a user.
Here are some useful links that discuss the topic further: