Jump to content

sopython

Members
  • Posts

    15
  • Joined

  • Last visited

sopython's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks for the detailed information. I updated the dispatch.wsgi. Now it works. Thank you so much!
  2. Thanks for pointing this. I have changed the doc root to aistocks, now the error becomes 500
  3. Oh, yes, this is the reason. I use aistocks in all places now, then it changes back to the 404 error :-(
  4. yes, I found there is another .htaccess in aiStocks/aiStocks, so I deleted it, then the error changed from 404 to 500. I don't know the 500 error is caused by error in .htassecc or in dispatch.wsgi.
  5. 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
  6. 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!
  7. Oh, yes, that's the reason. It works after adding the exception. Thanks!
  8. 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"%}");
  9. Actually, there is no strong reason, I just want to organize the code. So forget about it, I think I can work on current directory tree. Thank you!
  10. 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'.
  11. Yes, I have deleted Hello1&2, now there is one subdomain, it is pyStone. It still doesn't work.
  12. 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...