Edit approved email points to localhost - django

After approving a change in the Wagtail admin, the editor receives an email letting them know the page is published. The problem is the link to the page doesn't use the site domain, but localhost:
You can view the page here: http://localhost/learn/good-stuff-to-learn/
I have both BASE_URL and WAGTAILAPI_BASE_URL configured in my settings.py. Is there another setting I missed?
Django 1.11.10
Wagtail 1.13.1

Update the domain in the Wagtail admin, under Settings -> Sites.

Related

Django inserts wrong domain to activation email, facebook auth and filebrowser

I've set up a Django project on a nginx server. But..
Django detects request.get_host() in signup and activation views as localhost and sends email (for activation and password reset) with links like http://localhost/....
I've set up Facebook authorization via social-auth-app-django. But Facebook tries to open redirect_uri in localhost
(...redirect_uri=http:localhost/oauth/complete/facebook...)
Inside django admin TinyMCE editor Filebrowser also refers to localhost..
How to fix these problems? Or it seems one solution can fix all of them.
Thank you for your time and help.
Did you tried changing your Site.domain and Site.name in admin panel or via shell? from django.contrib.sites.models import Site
https://docs.djangoproject.com/en/2.1/ref/contrib/sites/
It's used in many cases such as emails by default.

How do I change my weblate site url

I installed my own weblate server somewhere, then I switched my nginx configuration to a domain name. I went into weblate's django admin, in sites section and updated the site entry to point to the right location.
I couldn't find anything related to this within settings.py. There's a default site id, but it's already set to 1.
After doing this, urls to projects were still using old url.
Update site entry in django admin and Restart the weblate django application. After restarting weblate, the new url from database started working.
There is also this documented section:
https://docs.weblate.org/en/latest/admin/management.html#changesite
Which should refresh website.

why my Django blog admin interface don't have "blog posts "and 'sites'

Following online tutorial, I create a very simple django blog. It seems all right, but after I log into 127.0.0.1:8000/admin/ , I can't find the place to add posts.
My django blog interface(I don't have enough reputation to add picture):
Django administration
Welcome,xxx change password / log out
Site administration
Authentication and Authorization
Groups Add Change
Users Add Change
Recent Actions
My Actions
None available.
Does anyone know why my administration interface don't have "add post"??? thanks in advance!! :)
I use:
Django 1.7
Operation: win 7 32
Seems like you haven't registered your posts model in the Django admin
https://docs.djangoproject.com/en/dev/intro/tutorial02/#make-the-poll-app-modifiable-in-the-admin
or your posts app isn't installed in your settings.py
https://docs.djangoproject.com/en/dev/intro/tutorial01/#activating-models
And the sites framework is no longer activated by default since Django 1.6
add admin.autodiscover() at urls.py. details here: https://docs.djangoproject.com/en/dev/ref/contrib/admin/

Django powered site and micro sites – do I have to create a separate project for each microsite?

I'm looking to build a Django website with the main site on example.com. On this domain, a user can register using an email and password and start writing blog posts at example.com/blog. Admins will be able to login into the Django Admin to alter posts and change content on the other pages of example.com.
The website will have one microsite each year on subdomains, e.g., 2013.example.com, 2014.example.com, etc. Admins will be able to edit content using the Django Admin.
I'm going to deploy the Django project onto Heroku.
The question that I would answered is whether I should create a new Django app and Heroku deployment for each microsite and the main site? Or, whether I can create it all as one Django project?
The latter seems to make more sense to me, but unsure how I would go about it.

Opencart admin login redirects to cart

I have a fresh install of opencart 1.5.5.1
When I access the admin, I get the login page, I login and get redirected to /admin/index.php?route=common/login which displays the homepage of the cart and not the admin panel.
How can I access the admin panel?
This happens if you try to log in and have a redirect in place to go from the non-www version to the www version of your domain (or vice-versa). If you have this, you will need to adjust your /admin/config.php to use the correct domain (ie so no redirect is necessary)
Check your admin htacess file!
In my case this was the problem.
So navigate here:
/admin
And search this file:
.htacess.txt
Remove txt and you be fine!