OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to serve static files for django-cms on DigitalOcean

  • Thread starter Thread starter Rockbot
  • Start date Start date
R

Rockbot

Guest
I have deployed a django-cms app on DigitalOcean following the steps in this tutorial:

https://www.digitalocean.com/community/tutorials/how-to-deploy-django-to-app-platform

The app is up and running but static-files are not served.

I created the additional static site refering to the same github repository and it is up and running too.

settings.py

Code:
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")

STATICFILES_DIRS = [
    BASE_DIR / "project_name" / "static",
]

I did collect the static files with python manage.py collectstatic and the folder and files are present in the intended location.

How do I "connect" the app on DigitalOcean to my static files?
<p>I have deployed a django-cms app on DigitalOcean following the steps in this tutorial:</p>
<p><a href="https://www.digitalocean.com/community/tutorials/how-to-deploy-django-to-app-platform" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-deploy-django-to-app-platform</a></p>
<p>The app is up and running but static-files are not served.</p>
<p>I created the additional static site refering to the same github repository and it is up and running too.</p>
<p><strong>settings.py</strong></p>
<pre><code>STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")

STATICFILES_DIRS = [
BASE_DIR / "project_name" / "static",
]
</code></pre>
<p>I did collect the static files with <code>python manage.py collectstatic</code> and the folder and files are present in the intended location.</p>
<p>How do I "connect" the app on DigitalOcean to my static files?</p>
 

Latest posts

U
Replies
0
Views
1
user2774120
U
P
Replies
0
Views
1
Pramod Karandikar
P
Top