When uploading files to the server in pythonanywere I get the following error line. Any ideas on how to solve it?
File "/home/factura/wp/wp/wp/urls.py", line 36, in <module>
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
NameError: name 'static' is not defined
urls.py
from django.contrib import admin
from django.urls import path
from django.conf import settings
urlpatterns = [
path('admin/', admin.site.urls)...
]
if settings.DEBUG:
from django.conf.urls.static import static
**urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)**
Directory structure
├── Projecto
│ ├── migrations
│ │ └── __pycache__
│ ├── __pycache__
│ ├── static
│ │ └── projecto
│ │ ├── css
│ │ ├── img
│ │ ├── js
│ │ └── vendor
│ │ ├── bootstrap
│ │ │ ├── css
│ │ │ └── js
│ │ ├── font-awesome
│ │ │ ├── css
│ │ │ ├── fonts
│ │ │ ├── less
│ │ │ └── scss
│ │ └── jquery
│ └── templates
│ └── root
├── media
│ └── projects
├── facturacion
│ ├── migrations
│ │ └── __pycache__
│ ├── __pycache__
│ └── templates
│ └── factura
└── wp
└── __pycache__
settings.py
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = '/static/'
# Media files
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "media")