| djangox | ||
| pages | ||
| static/images | ||
| templates | ||
| users | ||
| LICENSE | ||
| manage.py | ||
| notes.md | ||
| Pipfile | ||
| Pipfile.lock | ||
| README.md | ||
DjangoX
DjangoX - A framework for launching new Django projects quickly.
Comes with a custom user model, social authentication, and email/password for sign up and log in.
Features
- Django 2.0 and Python 3.6
- Pipenv for virtualenvs
- User registration via django-allauth
- Add social auth via Google, Facebook, etc
- Bootstrap v4
- Custom user model with email and no username
First-time setup
-
Make sure Python 3.6x and Pipenv are already installed. See here for help.
-
Install packages with
pipenv install -
Activate a virtual environment with
pipenv shell -
Set up the initial migration for our custom user models in
users$ python manage.py makemigrations users
-
Build the database schema:
$ python manage.py migrate
-
Create a superuser:
$ python manage.py createsuperuser
-
Confirm everything is working:
$ python manage.py runserver
Load the site at http://127.0.0.1:8000.
Click on links for "Sign up" or "Log in."
-
This is optional but I also recommend logging into admin and changing the default site:
Go to http://127.0.0.1:8000/admin. You may need to logout and then login with your superuser account.
Navigate to http://127.0.0.1:8000/admin/sites/site/ and change the default "example.com" to "127.0.0.1" and the name to "<YOUR_PROJECT_NAME>" for local development.
Recommendations
-
Use django-environ for environment variables
-
Update EMAIL_BACKEND to configure an SMTP backend
-
Make the admin more secure
Adding Social Authentication
- Configuring Google
- Configuring Facebook
- Configuring Github
django-allauthsupports many, many other providers in the official docs
Acknowledgments
This project is heavily inspired by cookiecutter-django. It's my own preferred template for starting new projects built out of a personal desire to actually understand all the config magic in cookiecutter-django.
