This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame, sys, random, time # PyGame Module imported Here | |
# check for initializing errors | |
check_errors = pygame.init() | |
if check_errors[1] > 0: | |
print("(!) Had {0} initializing errors, exiting...".format(check_errors[1])) | |
sys.exit(-1) | |
else: | |
print("(+) PyGame successfully initialized!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Settings.py | |
---------------------------------------------------------------------------------- | |
os.path.join(BASE_DIR, 'templates') | |
# STATIC_ROOT = os.path.join(BASE_DIR, 'static') | |
MEDIA_ROOT = os.path.join(BASE_DIR, 'media') | |
MEDIA_URL = '/media/' | |
LOGIN_REDIRECT_URL = 'dashboard:dashboard' | |
LOGOUT_REDIRECT_URL = 'accounts:sign_in' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------------------------------------- | |
Model | |
----------------------------------------------------------------------------------- | |
class OnlyActiveManager(models.Manager): | |
def get_queryset(self): | |
return super(OnlyActiveManager, self).get_queryset().filter(status='active') | |
class Device(models.Model): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import string | |
domains = ["hotmail.com", "gmail.com", "mail.com", "yahoo.com", 'tman.com'] | |
letters = string.ascii_lowercase[:26] | |
def get_random_domain(): | |
return random.choice(domains) |