Author: mblum6180_l6d6qy

  • Django Deployment on DreamHost

    Django Deployment on DreamHost

    Important Notes Before You Begin

    • SQLite on DreamHost: SQLite may not work on DreamHost platforms. It’s recommended to use MySQL as your database backend for production environments.
    • MySQL Client Installation: The mysqlclient library, a requirement for connecting Django to a MySQL database, won’t install unless Python is a custom installation. Ensure you follow the steps above to install a custom version of Python.
    • Preferred Python Version: Django and Passenger tend to work best with Python 3.10. Make sure to install this version for optimal compatibility.

    Setting Up MySQL Database

    Follow these steps to set up a MySQL database for your Django project:

      1. Install MySQL: Ensure that MySQL is installed on your system. On most Linux distributions, you can install it using the package manager.
      2. Create a Database and User: Log in to MySQL and create a new database and user specifically for your Django project.
    mysql -u root -p
    CREATE DATABASE mydatabase;
    CREATE USER 'mydatabaseuser'@'localhost' IDENTIFIED BY 'mypassword';
    GRANT ALL PRIVILEGES ON mydatabase.* TO 'mydatabaseuser'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;
    

    Download and Extract Python

    Begin by downloading the Python package and extracting its contents.

    cd ~
    mkdir tmp
    cd tmp
    wget https://www.python.org/ftp/python/3.10.13/Python-3.10.13.tgz
    tar zxvf Python-3.10.13.tgz
    cd Python-3.10.1
    

    Compile and Install

    Configure the Python source code on your system and compile it. This step prepares Python for installation.

    ./configure --prefix=$HOME/opt/python-3.10.13 --enable-optimizations
    make
    make install
    

    Update PATH

    Ensure your system recognizes the custom Python version by updating the PATH environment variable.

    echo "export PATH=$HOME/opt/python-3.10.13/bin:$PATH" >> ~/.bash_profile
    
    Activate Python

    Activate the new Python version and confirm the installation.

    source ~/.bash_profile
    which python3
    

    Install Pip and Virtualenv

    Install Pip and Virtualenv to manage packages and environments.

    python3 -m pip install --upgrade pip
    pip3 install virtualenv
    

    Create a Virtual Environment

    Set up a virtual environment for your Python projects to isolate dependencies.

    cd ~/example.com
    virtualenv -p /home/username/opt/python-3.10.13/bin/python3 venv
    source venv/bin/activate
    

    Install Django and Dependencies

    Finally, install Django and any necessary dependencies like mysqlclient for your projects.

    pip3 install Django
    pip3 install mysqlclient
    

    Create the Project

    Start a new Django project within the virtual environment.

    cd ~/example.com
    source ~/example.com/venv/bin/activate
    python3 venv/bin/django-admin startproject projectname
    

    Configure Passenger WSGI

    Create a passenger_wsgi.py file in the top-level site directory with the following content to set up Passenger WSGI.

    import sys, os
    INTERP = "/home/username/example.com/venv/bin/python3"
    if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
    
    cwd = os.getcwd()
    sys.path.append(cwd)
    sys.path.append(cwd + '/projectname') #You must add your project here
    
    sys.path.insert(0,cwd+'/venv/bin')
    sys.path.insert(0,cwd+'/venv/lib/python3.10/site-packages')
    
    os.environ['DJANGO_SETTINGS_MODULE'] = "projectname.settings"
    from django.core.wsgi import get_wsgi_application
    application = get_wsgi_application()
    

    Edit Project Settings

    Modify the Django project’s settings.py file to include necessary configurations.

    ALLOWED_HOSTS = ['example.com' , 'www.example.com', 'localhost', '127.0.0.1']
    
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            'NAME': 'mydatabase',
            'USER': 'mydatabaseuser',
            'PASSWORD': 'mypassword',
            'HOST': 'mysql.example.com',
            'PORT': '3306',
        }
    }
    
    STATIC_ROOT = '/home/username/example.com/public/static/'
    

    Setup Static Files

    Prepare the static files directory and collect all static files from your Django project.

    cd ~/example.com/public
    mkdir static
    cd ~/example.com/projectname/
    python3 manage.py collectstatic
    

    Initialize Database

    Run migrate to set up the database schema for your Django project.

    python3 manage.py migrate
    

    Create a Superuser

    Create an administrative user for your Django project’s admin panel.

    python3 manage.py createsuperuser
    

    Notify Passenger on Changes

    After any configuration change, notify Passenger by creating a restart.txt file in the /tmp directory.

    mkdir tmp
    touch tmp/restart.txt
    
  • Pachinko

    Pachinko

    This is a digital re-creation of the popular Japanese mechanical game Pachinko. Built using Unity, this game aims to deliver an engaging and entertaining experience for both die-hard Pachinko fans and new players alike.

  • Send Martin Tower to Mars!

    Send Martin Tower to Mars!

    Launch the iconic skyscraper to space, and land safely on Mars

    Welcome to the Send Martin Tower to Mars!, an 8-bit style adventure game where you get to launch the iconic Martin Tower into space and guide it to a safe landing on the red planet. With retro graphics and challenging gameplay, this game will put your skills to the test as you navigate through space and dodge obstacles on your way to Mars. Get ready to embark on a mission like no other, and show the universe what Martin Tower is made of!

  • Gallery View: Rotunda ‘Nature and Machine’

    Gallery View: Rotunda ‘Nature and Machine’

    https://www.lvpnews.com/20221223/gallery-view-rotunda-nature-and-machine

    Published December 23. 2022 07:15PM by ED COURRIER Special to The Press “Nature and Machine” featured photographs by Lehigh Valley artist Matthew Blum at the Rotunda Gallery, Town Hall, Bethlehem. The exhibit is a result of Blum’s camerawork and darkroom experiments, including palladium, cyanotype, albumen, ambrotype, gumoil and silver gelatin processes. “With my photography, I prefer traditional ways of photography printing. Depending on the subject, I’ll use the best-suited camera as a brush to capture the scene. Once captured, each photograph is hand-printed individually in the darkroom,” according to Blum’s artist’s statement. “What makes this photography show so unique is that Matthew uses a variety of darkroom techniques that truly elevates it from the typical genre of photography,” says DePietro, who co-curated the exhibition with Richard Begbie. “I like this space as it’s circular,” Blum says of the Rotunda Gallery and the exhibition’s subject matter. “They balance each other out.” On the “Nature” side of the gallery, Blum’s “Pinhole Trees” (2021; silver gelatin print, 11 in. x 14 in.) was photographed with a pinhole camera he created on a 3-D printer. The image was shot with a three-second exposure at Lake Muhlenberg, Cedar Beach Park, Allentown. Images of trees, bison, shells and blossoms make up the flora and fauna half of the exhibit. The “Machine” side features a silver gelatin “Boombox,” as well as vintage vehicles, typewriter keys, piano and Bethlehem Steel plant images. Blum, an Allentown-based artist, first began working in film-making. He later developed an interest in still photography and built a modest 35mm darkroom. His darkroom expanded to a large format 4 by 5 setup. The exhibition, sponsored by the Bethlehem Fine Arts Commission, concluded Dec. 21. Rotunda Gallery, Town Hall, 10 E. Church St., Bethlehem. Gallery hours: 8 a.m. – 4 p.m. Monday – Friday, Closed weekends and holidays. Information: www.bfac-lv.org “Gallery View” is a column about artists, exhibitions and galleries.

  • NATURE AND MACHINE

    NATURE AND MACHINE

    In this exhibition, Matthew explores aspects of Nature and Machine. By using various processes such as palladium, cyanotype, and silver gelatin,
    he matches the feeling of each subject to the image.

    “With my photography, I prefer traditional ways of photography printing. Depending on the subject, I’ll use the best suited camera as a brush to capture the scene. Once captured each photograph is hand-printed individually in the darkroom.”

    Allentown native Matthew Blum is a visual artist who has exhibited in prestigious galleries around the Lehigh Valley. He got his start in the arts by working on local feature movies. While working in film-making he did
    a range of tasks such as editing and director of photography. From film-making, his interest in still photography developed with an eye for storytelling.
    His exploration into film began with a modest 35mm
    darkroom. Later that darkroom set up grew to large format 4 X 5. Today,his preferred printing processes include palladium,cyanotype,and silver gelatin.