youssri.ahmed

Member
Feb 2, 2021
7
0
1
egypt
cPanel Access Level
Website Owner
hi builders
i have problem in my website

its
Failed to load resource: the server responded with a status of 404 (Not Found)

when i write
ls -lah /home/aeraeg/public_html/

i get this results
1612272479319.png
how i can solve this problem?

this is my setting:
""

this is my root

1612273066274.png
1612273092217.png
 

Attachments

Last edited by a moderator:

youssri.ahmed

Member
Feb 2, 2021
7
0
1
egypt
cPanel Access Level
Website Owner
Code:
"""

Django settings for omflow project.

Generated by 'django-admin startproject' using Django 2.2.3.

For more information on this file, see

[URL unfurl="true"]https://docs.djangoproject.com/en/2.2/topics/settings/[/URL]

For the full list of settings and their values, see

[URL unfurl="true"]https://docs.djangoproject.com/en/2.2/ref/settings/[/URL]

"""

import os

from pytz import common_timezones

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Quick-start development settings - unsuitable for production

# See Deployment checklist | Django documentation | Django

# SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'r&[email protected]%)[email protected]%90&2jo$0*&a&57*5$rx)@ar'

# SECURITY WARNING: don't run with debug turned on in production!

DEBUG = True

TEMPLATE_DEBUG = DEBUG

ALLOWED_HOSTS = ["*"]

# Application definition

INSTALLED_APPS = [

     #default

    'django.contrib.admin',

    'django.contrib.auth',

    'django.contrib.contenttypes',

    'django.contrib.sessions',

    'django.contrib.messages',

    'django.contrib.staticfiles',

 

    #local components

    'omuser',

    'ommessage',

    'omformflow',

    'omflow',

    'omdashboard',

    'omformmodel',

    'omservice',

    'ommission',



]

AUTH_USER_MODEL = 'omuser.OmUser'

LOGIN_REDIRECT_URL = '/home/'



this is my roots



MIDDLEWARE = [

    'django.middleware.security.SecurityMiddleware',

    'django.contrib.sessions.middleware.SessionMiddleware',

    'django.middleware.locale.LocaleMiddleware',

    'django.middleware.common.CommonMiddleware',

    'django.middleware.csrf.CsrfViewMiddleware',

    'django.contrib.auth.middleware.AuthenticationMiddleware',

    'django.contrib.messages.middleware.MessageMiddleware',

    'django.middleware.clickjacking.XFrameOptionsMiddleware',

 

]

ROOT_URLCONF = 'omflow.urls'

TEMPLATES = [

    {

        'BACKEND': 'django.template.backends.django.DjangoTemplates',

        'DIRS': [os.path.join(BASE_DIR, 'templates')],

        'APP_DIRS': True,

        'OPTIONS': {

            'context_processors': [

                'django.template.context_processors.debug',

                'django.template.context_processors.request',

                'django.contrib.auth.context_processors.auth',

                'django.contrib.messages.context_processors.messages',

                'django.template.context_processors.i18n',

                'django.template.context_processors.static',

                'django.template.context_processors.media',

            ],

        },

    },

]

WSGI_APPLICATION = 'omflow.wsgi.application'



# Database

# Settings | Django documentation | Django

# Password validation

# Settings | Django documentation | Django

AUTH_PASSWORD_VALIDATORS = [

    {

        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',

    },

    {

        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',

    },

    {

        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',

    },

    {

        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',

    },

]



# Internationalization

# Internationalization and localization | Django documentation | Django

LOCALE_PATHS = (

    os.path.join(BASE_DIR, 'locale'),

)

LANGUAGES = [

    ("en", "English"),("zh-hant", "Traditional_Chinese"),("zh-hans", "Simplified_Chinese"),("ja", "Japanese"),("ar","Arabic")

]



LANGUAGE_CODE = 'en'

#TIME_ZONE = 'Africa/Cairo'

TIME_ZONES = [(tz, tz) for tz in common_timezones]

DATE_FORMAT = '%Y-%m-%d'

DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S'

DATETIME_INPUT_FORMATS = '%Y-%m-%d %H:%M:%S'

USE_I18N = True

USE_L10N = False

# USE_TZ = True

SESSION_EXPIRE_AT_BROWSER_CLOSE = True

# SESSION_COOKIE_AGE = 3600

MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads')

FILE_UPLOAD_TEMP_DIR = BASE_DIR

FILE_UPLOAD_MAX_MEMORY_SIZE = 52428800



# Static files (CSS, JavaScript, Images)

# Managing static files (e.g. images, JavaScript, CSS) | Django documentation | Django



STATICFILES_FINDERS = (

    'django.contrib.staticfiles.finders.FileSystemFinder',

    'django.contrib.staticfiles.finders.AppDirectoriesFinder',

)

STATIC_URL = '/static/'

# static url Mapping folder

STATICFILES_DIRS = (

    os.path.join(BASE_DIR, 'staticfiles'),

    #os.path.join(BASE_DIR, 'omuser', 'staticfiles'),

)



# staticfiles_dirs Mapping folder

#STATIC_ROOT = os.path.join(BASE_DIR, 'static')

STATIC_ROOT = os.path.join(BASE_DIR, '..', 'static')

LOG_DIR = os.path.join(BASE_DIR, 'logs')

LOG_LEVEL = 'ERROR'

LOGGING = {

    'version': 1,

    'disable_existing_loggers': False,

    'formatters': {

        'simple': {

            'format': '[%(asctime)s] - %(levelname)-8s - %(message)s',

            'datefmt': DATETIME_FORMAT,

        },  

    },

    "filters": {

        "infofilter": {

          "()": "omflow.syscom.default_logger.LowLevelFilter",

          "level": 20

        },

        "warnfilter": {

          "()": "omflow.syscom.default_logger.HighLevelFilter",

          "level": 30

        }

    },

    'handlers': {

        'consoleInfo': {

            'class': 'logging.StreamHandler',

            'formatter': 'simple',

            "filters": ["infofilter"]

        },

        'consoleError': {

            'class': 'logging.StreamHandler',

            'formatter': 'simple',

            "stream": "ext://sys.stdout",

            "filters": ["warnfilter"]

        },

        'omlogfile': {

            'class': 'logging.handlers.TimedRotatingFileHandler',

            'filename': os.path.join(LOG_DIR, 'omflow.log'),

            'encoding':'utf-8',

            'formatter': 'simple',

            'when': 'midnight',

            'backupCount': 10,

            'delay': True

       },

        'djangolog': {

            'class': 'logging.handlers.TimedRotatingFileHandler',

            'filename': os.path.join(LOG_DIR, 'djangolog.log'),

            'encoding':'utf-8',

            'formatter': 'simple',

            'when': 'midnight',

            'backupCount': 10,

            'delay': True

       },

    },

    'loggers': {

        'django': {

            'handlers': ['consoleInfo','consoleError','djangolog'],

            'level': LOG_LEVEL,

            'propagate': False

        },

        'omflowlog': {

            'handlers': ['omlogfile'],

            'level': LOG_LEVEL,

            'propagate': False

        },

    },

   

}

DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3","NAME": os.path.join(BASE_DIR, "db.omflow"),"OPTIONS": {"timeout": 300,}}}

#omflow type(server/collector)

OMFLOW_TYPE = "server"

#local info

LOCAL_IP = ""

LOCAL_PORT = ""

UNIQUE_ID = ""

#server info

SERVER_IP = ""

SERVER_PORT = ""

#python.exe filepath

PYTHON_PATH = ""
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,151
523
273
cPanel Access Level
Root Administrator
Hey there! It looks like you may have been able to get this partially resolved as I do see some content loading on the site when I checked just now (although I did remove the website link from your first post). Let us know if you're still seeing issues!
 

youssri.ahmed

Member
Feb 2, 2021
7
0
1
egypt
cPanel Access Level
Website Owner
Hey there! It looks like you may have been able to get this partially resolved as I do see some content loading on the site when I checked just now (although I did remove the website link from your first post). Let us know if you're still seeing issues!
hi cPRex
thanks for your reply
this some of content loading but other is still not
 

youssri.ahmed

Member
Feb 2, 2021
7
0
1
egypt
cPanel Access Level
Website Owner
Always happy to reply :D

If certain areas of the site are loading but others aren't, you may want to check the cPanel >> Errors page to see if there are any details there about permissions or bad file locations.
Hi cPEex
i appologize for slow responding but it was my weekend

the error is:
App 8519 output: /home/aeraeg/.bash_profile: line 16: location: command not found

this is my .bash_profile
Code:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
source /home/aeraeg/virtualenv/python/3.7/bin/activate
location /static/ {/home/aeraeg/python/static}
 
Last edited:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,151
523
273
cPanel Access Level
Root Administrator
Thanks for the details. While that is certainly something that needs investigation, that wouldn't affect the behavior of the website not displaying properly, so it sounds like there may be two separate issues.

One thing you could try is pulling up a static file directly in the browser. For example, if you have an image on the site you could visit yourdomain.com/images/image_name.jpg to make sure that works directly. If so, the issue is likely with the site's code. If not, the browser or logs should provider you with a helpful error message.
 

youssri.ahmed

Member
Feb 2, 2021
7
0
1
egypt
cPanel Access Level
Website Owner
hi cPRex
no all thing in place but static files can't be appear to catch it , ( notes i am on share host so i can't use nginx to solve thei problem so i use django for debug static files , its work correctly but i have this failure in this issue only.
1612871436911.png
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,151
523
273
cPanel Access Level
Root Administrator
Thanks for the additional details. If you're on a shared environment it would be best to reach out to the hosting provider to see if they can get you more details on this, as you wouldn't have enough access to do additional troubleshooting on the machine.
 

youssri.ahmed

Member
Feb 2, 2021
7
0
1
egypt
cPanel Access Level
Website Owner
Hi cPRex
i fiexed 99% of thei problem ( by add static root to url files)

no i found final error here
1613398666339.png


if(to==from){return(to);}if(weightedRange&&Math.random()<=weightStrength){ret=round(Math.random()*(weightedRange[1]-weightedRange[0])+weightedRange[0],decimalPlaces)}else{ret=round(Math.random()*(to-from)+from,decimalPlaces)}return(ret);}var particles(function(){particles=new ParticleEngine('projector');createjs.Ticker.addEventListener("tick",updateCanvas);window.addEventListener('resize',resizeCanvas,false);$('.login-fadein').fadeTo('slow',0.8);function updateCanvas(){particles.render();}function resizeCanvas(){particles.resize();}}());</script>
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,151
523
273
cPanel Access Level
Root Administrator
I'm glad you're making progress on this! That specific output looks like a code issue with the extra ( character in the line, but we aren't able to debug code on our side.

If you open the file with a text editor it will often highlight the open and closing parenthesis and that may help you see where one may be missing.
 

youssri.ahmed

Member
Feb 2, 2021
7
0
1
egypt
cPanel Access Level
Website Owner
hi cPRex
its work now , but i have laste issue , that the passowrd and username can't be store in any browser its resutl can't be log in in allowed user

are this is secureity problem?
 

Attachments

Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,151
523
273
cPanel Access Level
Root Administrator
I do see there is an SSL working on the domain. It seems you just need to set up redirection from http to https in order to get that working well. You can use the cPanel >> Domains page to force the https redirection to happen on the system.

If you are using a tool like WordPress on the domain, you may want to use a plugin to ensure that the WordPress link structure works well with the https redirect.