How do I change my weblate site url - django

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.

Related

Django, website with changed prefix, how to fix urls globally

I recently deployed my app locally with the help of Apache. I use server name and sufix to get to the content as http://my-server/app. The Problem is every button ignores what the root of my app is. So from my main view at my-server/app I try to redirect to /second_page and it sends me to server/second_page instead of server/app/second_page. Do I have to change every form by hand or is there any way to configure it through settings.py or urls.py?

Serve multiple Django applications from one server

Good morning. I have a dedicated ubuntu server behind my company's firewall. It is using Django, Gunicorn, and Nginx to serve an Intranet application to employees. The original app responds to the URL [server_name]/[original_application_name]. I want to serve additional apps from this server. I have followed this tutorial as I did when setting up the original app.
I can run Gunicorn and serve the app, I have created a second systemd service file that appears steady (copied from the original app with paths changed - service runs), same for a new 'sites-available' file in Nginx (copied from original and modified), new .sock file exists, binding appears successful. However, I have yet to hit on the right configuration combination between settings.py [allowed_hosts], [new_app].service, and nginx etc.
The original app is running and when I try a URL related to the new app it gives an error saying it cannot find the request in the url.py of the original app. The new app would be used by the IT dept. Ideally, the new URL would be something like: it.[server_name]/[new_application_name].
I have looked through other cases with this problem but most use Apache or are on a public hosting site. I have seen this but it requires a "socket file". My original app is not using a socket file. I was hoping to do this without interfering with the original app. Is a "socket file" required? How can I configure this to serve both apps? Never having done this, what will the new URL be? The URL for the admin site in both apps is 'admin/', how can I accommodate this? Thanks!
I combined into one file as you suggested and I am almost there! I have original site responding at [server_name]/inventory and new site responding at [server_name]/assets. Great! My only problem is the admin page. In both apps the admin site is called admin! So, [server_name]/admin brings up the original site. How can I get to the new admin page?

Multiple Domains django app on heroku

Django have nice sites framework, so i thought can it posissible to store on heroku app with multi-settings structure and join it with differents domains on one heroku instance?
According to the docs, you can use Django sites framework with Heroku if you set SITE_ID = None. In that case Django will automatically detect current site based on request.get_host() method. So you only have to add specific hosts in admin panel.
The SITE_ID setting specifies the database ID of the Site object associated with that particular settings file. If the setting is omitted, the get_current_site() function will try to get the current site by comparing the domain with the host name from the request.get_host() method.
https://docs.djangoproject.com/en/1.8/ref/contrib/sites/

Changed domain for Django app, can't reach url

I recently moved my website from django to an e-commerce platform. I would still like to use Django and Python for various web-tools so after pointing the website domain at the new host I added a subdomain of tools.domain.com. I then changed the "domain" collumn in the django_site table to the new subdomain "tools.domain.com" and restarted the app. I can get to my admin area and login but when I attempt to access the url of the tool as defined in urls.py i get a "Page unavailable" error. I haven't edited settings.py or url.py.
What am I missing in this process?

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.