Jump to content

sopython

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by sopython

  1. Yes, I followed this guide, but I use the directory structure like below, becuase I want to set the site for a subdomain.

    ../hello/├── db.sqlite3├── hello/│   ├── __init__.py│   ├── __pycache__/│   │   ├── ...│   ├── settings.py│   ├── urls.py│   └── wsgi.py└── manage.py

     

  2. Hi, I tried to deploy a site using Django+Python on Tommy for a subdomain, but it shows:

    "Not Found

    The requested URL was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."

     

    I updated the .htaccess and wsgi following the " Getting started with Django 1.11", but it seems not work. Is it becuase that the Django version is 2.X now? Thanks!

     

     

  3. I want to use a static file. So I create a static folder under the project folder and put the file under the static folder. And I also added the needed info in settings.py, url.py and the html. But it still doesn't work. Is the something wrong in my files? Or there is something which need the admin's configure?

     

    What have been added in settings.py:

     

    INSTALLED_APPS = [
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',

    ... ...

    STATIC_URL = '/static/'

    STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected')
     
    STATICFILES_DIRS = [
        os.path.join(BASE_DIR, "static"),
      ]

    STATICFILES_FINDERS = (
        "django.contrib.staticfiles.finders.FileSystemFinder",
        "django.contrib.staticfiles.finders.AppDirectoriesFinder"

     

    *****************************************************************************

    What added in url.py:

     

    from django.conf.urls.static import static

     

    **************************************************

    What added in html:

     

    {% load static %}

     

    background-image: url("{% static "pyStocks/imgs/background-cloth.png"%}");

     

     

  4. Hi Krydos,

     

    I did the following changes:

    1) create a sub-folder pyStone under pyStone

    2) move dispathc.wsgi , urls.py and settings.py into the new pyStone

    3) update the .htaccess (add pyStone in the path)

     

    Then the failure raised again, and the error info is:

    [Fri Mar 29 15:57:40.169951 2019] [wsgi:error] [pid 27149:tid 140458021799680] [client 58.33.178.52:51715]   File "/home1/sopython/public_html/pyStone/pyStone/dispatch.wsgi", line 9, in <module>
    [Fri Mar 29 15:57:40.169519 2019] [wsgi:error] [pid 27149:tid 140458021799680] [client 58.33.178.52:51715] mod_wsgi (pid=27149): Exception occurred processing WSGI script '/home1/sopython/public_html/pyStone/pyStone/dispatch.wsgi'.
    [Fri Mar 29 15:57:40.169458 2019] [wsgi:error] [pid 27149:tid 140458021799680] [client 58.33.178.52:51715] mod_wsgi (pid=27149): Target WSGI script '/home1/sopython/public_html/pyStone/pyStone/dispatch.wsgi' cannot be loaded as Python module.
    [Fri Mar 29 15:57:40.168364 2019] [wsgi:info] [pid 27149:tid 140458021799680] [client 58.33.178.52:51715] mod_wsgi (pid=27149, process='', application='pystone.sopython.heliohost.org|/pystone/dispatch.wsgi'): Loading WSGI script '/home1/sopython/public_html/pyStone/pyStone/dispatch.wsgi'.
     

  5. I have tried the tutorial on wiki.helionet.org/Django, it works well. But now I want to deploy two Django apps on two subdomains on heliohost. I created two subdomians (e.g. Hello1 and Hello2), and the sub-folders Hello1 and Hello2 were created under public_html. Then I upload the Django apps to these subfolders and did the similar configurations to the .htaccess, dispatch.wsgi, etc separately. but it didn't work.

     

    Is there any tutorial for this kind of situation? 

     

    Thanks!

×
×
  • Create New...