• Stars
    star
    530
  • Rank 83,070 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Django For Everybody Sample Code

DJ4E Samples

This is a set of Django projects that provide free sample code to support the www.dj4e.com web site.

You can see some of the samples working at

http://samples.dj4e.com

Setting up a Virtual Environment on the Mac

Install virtualenv, if you use homebrew you can:

brew install virtualenv

Then checkout this repository:

cd ...wherever...
git clone https://github.com/csev/dj4e-samples.git
cd dj4e-samples
virtualenv .venv
source .venv/bin/activate
python --version
pip install -r requirements4.txt

python manage.py migrate
python manage.py createsuperuser --username dj4e-samples
# python manage.py changepassword dj4e-samples
# dj4e_nn_!

Running Locally on the Mac

If you have Django installed on your local computer you can test any of the sample applications by going into the folder and starting the server:

cd dj4e-samples
source .venv/bin/activate   # If needed
python manage.py runserver

And visit http://localhost:8000.

Setting up a Virtual Environment on Python Anywhere

The instructions for setting up a virtual environment on PythonAnywhere in the Linux shell are:

mkvirtualenv django4 --python=/usr/bin/python3.11
pip install django==4.2.3 ## this may take a couple of minutes

To activate the environment type:

workon django4

Then check this out into some folder:

cd ~/django_projects    # Create the folder if needed
git clone https://github.com/csev/dj4e-samples.git
cd dj4e-samples
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser --username dj4e-samples
# python manage.py changepassword dj4e-samples
# dj4e_nn_!
python manage.py runscript gview_load
python manage.py runscript many_load

These samples may be updated from time to time so you might want to get updates using git pull. Also if there are bugs, you are welcome to submit a Pull Request on github.

All of the documentation material is copyright CC-BY 3.0 and the code is copyright MIT by whomever wrote the code or documentation. You are welcome to use this in any way you see fit and paste code from this repo into your applications.

Running on PythonAnywhere

Once you have checked out the code under django_projects, and ran the migrations and load scripts, go under the Web tab, update the config files to point to your new application:

Source code:                /home/--your-account--/django_projects/dj4e-samples
Working Directory:          /home/--your-account--/django_projects/dj4e-samples

Use this as your WGSI configuration file:

import os
import sys

path = os.path.expanduser('~/django_projects/dj4e-samples')
if path not in sys.path:
    sys.path.insert(0, path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'dj4e-samples.settings'
from django.core.wsgi import get_wsgi_application
from django.contrib.staticfiles.handlers import StaticFilesHandler
application = StaticFilesHandler(get_wsgi_application())

You can edit these files and settings in the Web tab to switch between your various projects on PythonAnywhere. Make sure to reload under the Web tab after every file or configuration change.

More Repositories

1

py4e

Web site for www.py4e.com and source to the Python 3.0 textbook
JavaScript
2,817
star
2

cc4e

C Programming for Everybody
C++
261
star
3

wa4e

Course materials for www.wa4e.com
PHP
208
star
4

net-intro

Introduction to Network Technology
PostScript
175
star
5

uninstall-python3

A Simple Shell Script to Uninstall Python 3 versions from Mac OS/X
Shell
120
star
6

dj4e

Django for Everybody
PHP
95
star
7

py4inf

Python for Informatics: Exploring Information
HTML
38
star
8

pythonauto

An IMS LTI based Python Autograder, initially to support my Python For Informatics Book MOOC
PHP
37
star
9

pg4e

PostgreSQL For Everybody
Jupyter Notebook
35
star
10

sakai-scripts

A Repo of my scripts that I use to make my life as a Sakai developer easier
Shell
15
star
11

csonline

This is my registration system for my self-hosted MOOC Infrastructure
CSS
15
star
12

dazzleSketch

A JavaScript library that allows one to sketch over reveal.js presentations or any web page - OmniDazzle meets JavaScript
JavaScript
14
star
13

gift2qti

A simple tool to convert Quiz Questions from the GIFT format to the QTI 2.0 format
PHP
12
star
14

ca4e

Computer Architecure for Everybody
Rich Text Format
8
star
15

cc4e-private

Private Materials for C Programming for Everybody
C
7
star
16

xmosaic-1.2

XMosaic-1.2 (1993) - Running Native under X-Windows on Mac OS/X
C
6
star
17

dj4e-projects

Communicate about projects related to the Django Courses
Python
6
star
18

dj4e-advanced

Advanced Sample Code for DJ4e
Python
5
star
19

pythonlearn

Web site for the Python for Informatics (Python 2) textbook
HTML
5
star
20

wc-experiment

Chuck's Web Components Experiment
HTML
4
star
21

tsugi-jpa-lib

The Library Code for Tsugi Java
Java
4
star
22

wikiextract

Extract Wiki Content from Coursera Wiki
Groff
4
star
23

tsugi-01

This is a next-generation Learning Management System focused on simplicity (Archived)
PHP
4
star
24

obi-sample

This is a very very simple badge management system for the Mozilla Open Badges Project in PHP
PHP
4
star
25

localsearchphp

A simple in-site search for php sites - crawls the site and presents a simple search interface
PHP
4
star
26

youmap

Software to Make a Map of a YouTube Channel
HTML
3
star
27

webauto

This is my automatic grading program for web sites
PHP
3
star
28

tsugi-jpa-sample

Sample Appication for Java Tsugi
Java
3
star
29

ihts

Internet History, Technology and Security
PHP
3
star
30

mmorps

Massive MultiPlayer Online Rock-Paper-Scissors
PHP
3
star
31

dj-lmp1

This is a repository for experimentation
Python
3
star
32

itunes

A Simple Process to Make RSS Feeds for iTunes
Python
2
star
33

RPS

My Android RPS Application
Java
2
star
34

tsugi-web

The web site for www.tsugi.org
CSS
2
star
35

py4inf-web

The web content for www.py4inf.com - This is the Python2.x content
HTML
2
star
36

networks-code

This is a repository of sample code for SI301
JavaScript
2
star
37

tsugi-php-mod

Several Tsugi PHP Modules
JavaScript
2
star
38

maven-jetty-jdbc-servlet

A simple servlet that uses Maven, JDBC, and Jetty to say 'Hello world'
Java
2
star
39

dr-chuck

Resume and related stuff
HTML
2
star
40

gift2

The second version of the GIFT Editor
PHP
2
star
41

sakai-book

Sakai: Building an Open Source Community
TeX
2
star
42

talks

Dr. Chucks Talks
Rich Text Format
2
star
43

playground

A place for me to do stuff for testing
2
star
44

GoogleLogin

A simple bit of code to use Google's new OAuth For Login
PHP
2
star
45

djtutorial

My Solutions to https://docs.djangoproject.com/en/2.1/intro/
JavaScript
2
star
46

web2py-hack

A place to record all my web2py hacking - will be deleted later
Python
2
star
47

lti4web2py

An IMS Learning Tools Interoperability (LTI) 1.x Provider Application for Web2Py
Python
2
star
48

egr124

EGR124 - Internet and Technology - 1997 - Course Archive
HTML
2
star
49

tsugi-sakai

Initial outline of the Sakai version of Tsugi APIs - Not yet implemented
Java
1
star
50

sakai-lti-test

A clone of the Sakai PHP Unit Test code for LTI (Now moved to tsugi.org)
PHP
1
star
51

zap

Zap
JavaScript
1
star
52

apps

The top level page for umsi apps
PHP
1
star
53

simple-spring-mvc

A Simple Spring MVC example
Java
1
star
54

pdfjstest

Just a place to test Mozilla's PDFJS code
JavaScript
1
star
55

basiclti-oidc-test

An experiment in Spring MVC
Java
1
star
56

pg4e-docker

Scripts / Dockers Setting up PG4E In Production and Test
Shell
1
star
57

cb2k

Clipboard 2000 archive
HTML
1
star
58

conversations

Conversations
Java
1
star
59

sakaiger

The sakaiger.com web site
HTML
1
star
60

cloudcollab

Automatically exported from code.google.com/p/cloudcollab
Java
1
star
61

runestore

Making an app store for runestone
PHP
1
star
62

react-tsugi-attend-tool

TypeScript
1
star
63

rattend

React Experimental Attendance Tool
PHP
1
star
64

wa4e-net

The web site for www.wa4e.net
HTML
1
star
65

whrwe-cordova

A Cordova Version of whrwe.com
Java
1
star
66

checkskew

A bash script to check the clock skew between a system and timeapi.org
Shell
1
star
67

sandbox

Playing with Kubernetes Sandbox
Shell
1
star
68

smoker

An experimental smoke tester
Python
1
star
69

js4e-samples

Sample code for JavaScript for Everybody
Python
1
star
70

whrwe-swift

The Swift Application for WhRWe
Swift
1
star
71

dj-lmp

The Django LeMans Prototype / Learning Platform
1
star
72

board

A Simple Leaderboard Tool for Tsugi
PHP
1
star
73

charles-auth

Python
1
star
74

charles-elasticsearch

Python
1
star
75

charles-ui

JavaScript
1
star
76

charles-server

Python
1
star