Contributing to issue #34036

I want to contribute to this issue and I am making changes to the file contrib/admin/static/admin/css/base.css. I created a django project with a local copy of django (as instructed here) but I don’t see the changes in my django repo reflected in my project. For example, if I make the background red in base.css in my django repository, I don’t see the change reflected in my django project.

Would appreciate some help here!

Here are the shell commands I performed to run my django project called mysite:

  511  source djangodev/bin/activate
  512  cd django/tests/
  513  python -m pip install -e ..
  514  python -m pip install -r requirements/py3.txt
  515  cd ~/mysite/
  516  python runserver

Hey @nimra200 — so that looks right.

Can you check the output of the runserver command when it first starts up?

Last login: Mon Nov  7 10:58:53 on ttys000
carlton@Carltons-MacBook-Pro ~ % workon django
(django) django % cd ~/Desktop
(django) Desktop % django-admin startproject example
(django) Desktop % cd example 
(django) example % ./ runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python migrate' to apply them.
November 07, 2022 - 18:07:42
Django version 4.1.4.dev20221102165031, using settings 'example.settings'
Starting development server at
Quit the server with CONTROL-C.

So workon django is ≈ the same as your source djangodev/bin/activate. (I use virtualenvwrapper)

Then I cd to my Desktop folder and create a new project. I then cd to the project folder and start the development server. See this line:

Django version 4.1.4.dev20221102165031, using settings 'example.settings'

That tells me I’m using the development version. (The pip instal -e . you did…)

See also my prompt has (django) at the beginning, which says my virtual env is activated. Does your prompt have that?

Open django/ and add a assert False in there. Does that error show when you try to start runserver? (If so you know it’s loading that code.)

Finally, can you clear your browser cache? (Type “<your browser name> clear cache” into google for steps.)

I can see that my development version is different from yours. Will that cause any issues?

I just checked this. The auto reloader detects changes in your installed Django, so if you add an assert False it will try and reload and fail. Remove it and you can restart.

No, no difference. I’ve just got a different branch checked out.

Given that you’re seeing the dev version, I’d say try the browser cache issue.

Yep. I had to clear the cache to get the result:

That’s not very pleasant is it :stuck_out_tongue_winking_eye:

(First load gave me the cached CSS.)

I don’t know your browser, but e.g. Safari has a menu item to empty the caches.

Firefox has similar in the dev tools settings. (Don’t know about the other one, I’d have to search).

Thanks for the help! This did the trick.

1 Like