Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
django collectstatic picking files from wrong location

I am beginner in Python and Django. I am using Windows10 and I have installed Python 3.10.0 and pip 21.3.1. I installed Django using following commands

pip install virtualenvwrapper-win
mkvirtualenv firstdjango
pip install django
django-admin startproject demo

then I created APP for just simple static HTML page and now I am trying to use static files. I created a folder having name "static" on root and placed all css, js etc files in it and in settings.py, I mentioned following.

STATIC_URL = '/static/'
STATICFILES_DIR = [
    os.path.join(BASE_DIR, 'static')
]
STATIC_ROOT = os.path.join(BASE_DIR,'assets')

Now when I hit

python manage.py collectstatic

then it is not copying, what is in my static folder to assests folder.

When I tried to check from where collectstatic is trying to copy using following command

python manage.py findstatic -v 3 dummy

then I got following

C:\Users\dell\Envs\firstdjango\lib\site-packages\django\contrib\admin\static

but my project location is E:\django\demo

I am not getting, why collectstatic is not able to copy correct files and hence I do not get correct paths of my css, js and images in my web page.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I suspect that your virutalenv and your project aren't in the same location

you can try the following method :

pip install virtualenv  // install virtualenv
virtualenv env          //create your virutalenv
\pathto\env\Scripts\activate // activate your virtualenv

pip install django  
django-admin startproject demo
cd demo

And then collect your statifiles

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!