Skip to content
A framework to help you launch new Django projects quickly and securely.
Python HTML JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pages
rdjango_project
static
templates
users
.gitattributes
.gitignore
LICENSE
README.md
manage.py
requirements.txt

README.md

rDjango

rDjango is a framework to help you launch new Django projects quickly and securely. Comes with complete user authentication.

This project is a fork of DjangoX by William Vincent.

Main differences between DjangoX and rDjango

  • Project Settings are configured to use Local Settings files to protect secrets from version control.
  • Postgres is included in Pipfile for easy inclusion.
  • Username instead of email for login.
  • OG and Twitter meta tags for social sharing.
  • Font Awesome included.
  • Bootstrap 4 alerts that automatically disappear in three seconds.

Set Up

  1. Make sure Python 3.7x is already installed.

  2. Clone repo and configure virtual environment:

$ git clone https://github.com/raytraylor/rdjango.git
$ mv rdjango your_site_name
$ cd your_site_name
$ rm -rf .git
$ rm LICENSE README.md
$ python3 -m venv env
$ source env/bin/activate
$ pip install --upgrade pip && pip install -r requirements.txt
  1. Add local settings file:

touch rdjango_project/local_settings.py

SECRET_KEY = 'your_secret_key'

DEBUG = True

ALLOWED_HOSTS = []

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'your_database_name',
        'USER': 'your_database_username',
        'PASSWORD': 'your_database_password',
        'HOST': 'your_database_host',
        'PORT': 'your_database_port',
    }
}

# Email Configuration
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# or
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# EMAIL_HOST = 'your_email_host'
# EMAIL_PORT = your_email_port_number
# EMAIL_HOST_USER = 'your_email_address'
# EMAIL_HOST_PASSWORD = 'your_email_app_password'
# EMAIL_USE_TLS = True
# DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
  1. Set up initial migration for custom user models:
(rdjango) $ python manage.py makemigrations users
(rdjango) $ python manage.py migrate
  1. Create a superuser:
(rdjango) $ python manage.py createsuperuser
  1. Confirm everything is working:
(rdjango) $ python manage.py runserver

Load the site at http://127.0.0.1:8000.

  1. Change site name:

Go to http://127.0.0.1:8000/admin/ then click login > Sites > example.com > change it to your_domain.com > Save.

All Changes from DjangoX

Virtual Environment

  • Using Venv instead of Pipenv.

Removed Debug Toolbar

  • Code is commented out in rdjango_project/settings.py and rdjango_project/urls.py in case you'd like to use Debug Toolbar.

Installation

  • See commented out sections in rdjango_project/settings.py
  • psycopg2-binary added for PostgreSQL.

Settings

Added -

Commented out -

  • Security Key
  • Debug
  • Allowed Hosts
  • Databases
  • Email Backend

Changed time zone to New York.

Made these changes to Sign Up / Login settings -

ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USERNAME_REQUIRED = True
ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE = True
ACCOUNT_SESSION_REMEMBER = True
ACCOUNT_AUTHENTICATION_METHOD = 'username'
ACCOUNT_UNIQUE_EMAIL = True

Added Message Tags for Bootstrap -

from django.contrib.messages import constants as messages
MESSAGE_TAGS = {
    messages.ERROR: 'danger'
}

Import Local Settings -

try:
    from .local_settings import *
except ImportError:
    raise Exception("A local_settings.py file is required to run this project")

Account Buttons

In templates/account changed button color from btn-success to btn-dark on -

login.html, logout.html, password_change.html, password_reset_from_key.html, password_reset.html, password_set.html, signup.html.

Sign Up instead of Sign up

Capitalized Up in signup.html.

Removed Pictures and Favicons

static/images/falconx.png 
static/images/home_2.2.png 
static/images/signup_2.2.png
static/images/favicon 13-09-05-007.ico

Removed About Page

Removed about from from pages/urls.py, pages/views.py, and templates/pages/about.html.

_base.html

  • your_site_name formatting for you to fill in.
  • OG meta tags and Twitter meta tags
  • Meta tags for favicons from Real Favicon Generator.
  • Updated Bootstrap version.
  • Added Font Awesome.
  • 'Login' instead of 'Log in' and 'Log Out' instead of 'Log out'.
  • Added line break after Nav; also added alert section and main tags.
  • Line break before nav and added right-align section to footer.
  • Full version of jQuery and newer version of JavaScript CDN files.

Home Page

  • Removed image link.

Naming

  • Changed djangox to rdjango to differentiate and because rDjango sounds like 'Our Django' which it is.
You can’t perform that action at this time.