Forums

Applying an old web app

Hi,

I've build an app in the Ablog folder. Then I delete the Web APP and then I rebuild the web app and point to this folder.

the website is working, but when I visit the admin session through http://adrop.pythonanywhere.com/admin, is not working correctly, and it looks like the css is not working.

What step did I possibly missed during the re-apply?

Thank you.

You need to configure the static files mapping so that your admin static files are served.

I have the following code in my wsgi.py:

  path = '/home/adrop/Ablog' if path not in sys.path:
     sys.path.append(path)
  os.environ['DJANGO_SETTINGS_MODULE'] = 'Ablog.settings'

And I think it's working. Then I have all that related to static files in setting.py:

STATICFILES_DIRS = [
     os.path.join(BASE_DIR,'static'),
     '/home/adrop/Ablog/static/', ]
 MEDIA_ROOT = u'/home/adrop/Ablog/media' MEDIA_URL = '/media/'
 STATIC_ROOT = u'/home/adrop/Ablog/static' STATIC_URL = '/static/'
 STATICFILES_FINDERS = (
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder', )

But it seems all the static files are not working.

And I also run the collectstatics command in bash, but it shows that nothing new to collect.

Could you please help me and take a look at this? Thank you very much

Hi there, can you have a look at the tips here: https://help.pythonanywhere.com/pages/DebuggingStaticFiles/ and come back to us with a single example and the three pieces of information required (if the linked page doesn't lead you to a solution)

Thank you. Problem solved. Sorry that I didn't search carefully, wasting your time. Again, Thank you.

No problem -- we're here to help!