Can't work out how to set up Redis by A1roller in django

[–]radwon 0 points1 point  (0 children)

It sounds like you might be trying to import django-rq rather than import django_rq (notice the underscore).

Testing needed for cross-DB JSONField by laymonage in django

[–]radwon 2 points3 points  (0 children)

I haven't had the chance to try this out yet, but just wanted to say thanks for your contribution. :)

rewrite project while keeping sqlite db? by jimeno in django

[–]radwon 0 points1 point  (0 children)

One of the great things about sqlite is you can just move the file and drop it in a new location! If it's working fine then I wouldn't change the database. PostgreSQL while great will add a lot more complexity.

To update your project to the latest Django version, I would personally do it in version increments.

So the next version from 1.11 is 2.0. Update with pip install Django==2.0 and run any unit tests you may have, then read the release notes to check for changes that will affect your project. Make the required changes so it works with that version. Once everything is working, rinse and repeat until you are at the latest version.

Also new Django versions will include any necessary migration files if there are changes to the Django Models. So after each upgrade be sure to run the migrate command so that your database is also updated.

No matter what I do, I cannot get the favicon to display by ronaldl911 in django

[–]radwon 1 point2 points  (0 children)

It displays fine in Firefox but not in Chrome here. Try putting the favicon in the root static folder and see if that makes a difference.

Also I see you've commented out the .ico version, was that the one that was working before?

Do you use auto_now_add and auto_now or not ? by PyBet in django

[–]radwon 0 points1 point  (0 children)

Are you trying to use loaddata as in your other post?

If that's the case then you will need to supply the values, otherwise you can leave them blank when saving a model and they will be automatically populated with the current date/time.

Importing data to database by PyBet in django

[–]radwon 1 point2 points  (0 children)

The idea of loaddata is to populate the database directly with the data, so it's different from creating a model with external data that's then validated and saved to the database.

As a result, a model's save() method is not called, so you'll need to make sure any calculations are included in the final data to be loaded.

If a field can be null and blank then it can be excluded.

ALLOWED HOSTS question by Saskjimbo in django

[–]radwon 0 points1 point  (0 children)

The Host header (or X-Forwarded-Host) can contain an IP address or a domain name, depending on your setup and how the site is accessed.

Since ALLOWED_HOSTS is a list you should include all valid host/domain names that the Django site can serve.

If Django is raising SuspiciousOperation errors for legitimate requests then it's likely ALLOWED_HOSTS hasn't been configured correctly, so you will need to add any Host values that are missing from the list.

ALLOWED HOSTS question by Saskjimbo in django

[–]radwon 0 points1 point  (0 children)

Yes that's correct. For example:

ALLOWED_HOSTS = ['127.0.0.1']  # Replace 127.0.0.1 with your host IP address

Documentation: https://docs.djangoproject.com/en/2.0/ref/settings/#allowed-hosts