django-sites

Where do I set the domain for my Django Sites framework site, when I only have one?

假装没事ソ 提交于 2019-11-30 08:24:58
I have a Django project for a simple blog/forum website I’m building. I’m using the syndication feed framework , which seems to generate the URLs for items in the feed using the domain of the current site from the Sites framework . I was previously unaware of the Sites framework. My project isn’t going to be used for multiple sites, just one. What I want to do is set the domain property of the current site. Where in my Django project should I do that? Somewhere in /settings.py? If I understand correctly, Sites framework data is stored in the database, so if I want to store this permanently, I

Where do I set the domain for my Django Sites framework site, when I only have one?

那年仲夏 提交于 2019-11-29 07:05:31
问题 I have a Django project for a simple blog/forum website I’m building. I’m using the syndication feed framework, which seems to generate the URLs for items in the feed using the domain of the current site from the Sites framework. I was previously unaware of the Sites framework. My project isn’t going to be used for multiple sites, just one. What I want to do is set the domain property of the current site. Where in my Django project should I do that? Somewhere in /settings.py? 回答1: If I

Multiple Django sites with shared codebase and DB

▼魔方 西西 提交于 2019-11-29 02:10:20
I have created a Django proyect with 20 sites (one different domain per site) for 20 different countries. The sites share everything: codebase, database, urls, templates, etc. The only thing they don't share are small customizations (logo, background color of the CSS theme, language code, etc.) that I set in each of the site settings file (each site has one settings file, and all of these files import a global settings file with the common stuff). Right now, in order to run the sites in development mode I'll do: django-admin.py runserver 8000 --settings=config.site_settings.site1 django-admin

Getting Site Matching Query Does Not Exist Error after creating django admin

核能气质少年 提交于 2019-11-28 03:32:48
I'm going through the standard Django tutorial to create an admin for an app. After commenting the admin related stuff in settings and running syncdb I'm getting this message: DoesNotExist at /admin/ Site matching query does not exist. Can anyone help me figure this out? The Site object for your Django project is missing. Each Django project has a Site object which contains the site's name and domain. It is usually automatically created when creating a Django project (in particular, when the syncdb command runs) but in your case it seems that didn't happen. To fix it: Open the Django shell for

How to get unique users across multiple Django sites powered by the “sites” framework?

淺唱寂寞╮ 提交于 2019-11-27 18:01:44
I am building a Django site framework which will power several independent sites, all using the same apps but with their own templates. I plan to accomplish this by using multiple settings-files and setting a unique SITE_ID for them, like suggested in the Django docs for the django.contrib.sites framework However, I don't want a user from site A to be able to login on site B. After inspecting the user table created by syncdb, I can see no column which might restrict a user to a specific site. I have also tried to create a user, 'bob', on one site and then using the shell command to list all

Django Sites Framework: Initial Data Migration Location

南笙酒味 提交于 2019-11-27 17:41:45
问题 Before Django 1.7, when using the Django Sites Framework one could/should define the initial data using Initial Fixtures. myproject/fixtures/initial_data.json [ { "pk": 1, "model": "sites.site", "fields": { "domain": "domain1", "name": "name1" } }, { "pk": 2, "model": "sites.site", "fields": { "domain": "domain2", "name": "name2" } }, { "pk": 3, "model": "sites.site", "fields": { "domain": "domain3", "name": "name3" } } ] Since it is a global project setting, I added a "fixtures" folder to

Multiple Django sites with shared codebase and DB

夙愿已清 提交于 2019-11-27 16:34:06
问题 I have created a Django proyect with 20 sites (one different domain per site) for 20 different countries. The sites share everything: codebase, database, urls, templates, etc. The only thing they don't share are small customizations (logo, background color of the CSS theme, language code, etc.) that I set in each of the site settings file (each site has one settings file, and all of these files import a global settings file with the common stuff). Right now, in order to run the sites in

Django 'Sites' Model - what is and why is 'SITE_ID = 1'?

大兔子大兔子 提交于 2019-11-27 10:46:38
问题 I am trying to work with Sites Model of Django. I dont quite understand why SITE_ID should be SITE_ID = 1 . in the docs: The ID, as an integer, of the current site in the django_site database table. This is used so that application data can hook into specific sites and a single database can manage content for multiple sites. why 1 ? what is the current site ? this is not clearly explained in the docs. lets say, I have www.somecoolsite.com and some other subdomains like www.wow.coolsite.com

Getting Site Matching Query Does Not Exist Error after creating django admin

梦想的初衷 提交于 2019-11-27 00:05:46
问题 I'm going through the standard Django tutorial to create an admin for an app. After commenting the admin related stuff in settings and running syncdb I'm getting this message: DoesNotExist at /admin/ Site matching query does not exist. Can anyone help me figure this out? 回答1: The Site object for your Django project is missing. Each Django project has a Site object which contains the site's name and domain. It is usually automatically created when creating a Django project (in particular, when

How to get unique users across multiple Django sites powered by the “sites” framework?

穿精又带淫゛_ 提交于 2019-11-26 19:15:22
问题 I am building a Django site framework which will power several independent sites, all using the same apps but with their own templates. I plan to accomplish this by using multiple settings-files and setting a unique SITE_ID for them, like suggested in the Django docs for the django.contrib.sites framework However, I don't want a user from site A to be able to login on site B. After inspecting the user table created by syncdb, I can see no column which might restrict a user to a specific site.