Update binary celerybeat-schedule file to reflect recent changes
This commit is contained in:
Binary file not shown.
31
backend/check_api_response.py
Normal file
31
backend/check_api_response.py
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import django
|
||||
import json
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'igny8_core.settings')
|
||||
django.setup()
|
||||
|
||||
from igny8_core.business.integration.models import SiteIntegration
|
||||
from igny8_core.auth.models import Site
|
||||
from django.test import RequestFactory
|
||||
from igny8_core.modules.integration.views import IntegrationViewSet
|
||||
|
||||
# Create a fake request
|
||||
factory = RequestFactory()
|
||||
request = factory.get('/api/v1/integration/integrations/1/content-types/')
|
||||
|
||||
# Create view and call the action
|
||||
integration = SiteIntegration.objects.get(id=1)
|
||||
viewset = IntegrationViewSet()
|
||||
viewset.format_kwarg = None
|
||||
viewset.request = request
|
||||
viewset.kwargs = {'pk': 1}
|
||||
|
||||
# Get the response data
|
||||
response = viewset.content_types_summary(request, pk=1)
|
||||
|
||||
print("Response Status:", response.status_code)
|
||||
print("\nResponse Data:")
|
||||
print(json.dumps(response.data, indent=2, default=str))
|
||||
|
||||
67
backend/final_verify.py
Normal file
67
backend/final_verify.py
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Final verification that the WordPress content types are properly synced
|
||||
"""
|
||||
import os
|
||||
import django
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'igny8_core.settings')
|
||||
django.setup()
|
||||
|
||||
from igny8_core.business.integration.models import SiteIntegration
|
||||
from igny8_core.auth.models import Site
|
||||
import json
|
||||
|
||||
print("=" * 70)
|
||||
print("WORDPRESS SYNC FIX VERIFICATION")
|
||||
print("=" * 70)
|
||||
|
||||
# Get site 5
|
||||
site = Site.objects.get(id=5)
|
||||
print(f"\n✓ Site: {site.name} (ID: {site.id})")
|
||||
|
||||
# Get WordPress integration
|
||||
integration = SiteIntegration.objects.get(site=site, platform='wordpress')
|
||||
print(f"✓ Integration: {integration.platform.upper()} (ID: {integration.id})")
|
||||
print(f"✓ Active: {integration.is_active}")
|
||||
print(f"✓ Sync Enabled: {integration.sync_enabled}")
|
||||
|
||||
# Verify config data
|
||||
config = integration.config_json or {}
|
||||
content_types = config.get('content_types', {})
|
||||
|
||||
print("\n" + "=" * 70)
|
||||
print("CONTENT TYPES STRUCTURE")
|
||||
print("=" * 70)
|
||||
|
||||
# Post Types
|
||||
post_types = content_types.get('post_types', {})
|
||||
print(f"\n📝 Post Types: ({len(post_types)} total)")
|
||||
for pt_name, pt_data in post_types.items():
|
||||
print(f" • {pt_data['label']} ({pt_name})")
|
||||
print(f" - Count: {pt_data['count']}")
|
||||
print(f" - Enabled: {pt_data['enabled']}")
|
||||
print(f" - Fetch Limit: {pt_data['fetch_limit']}")
|
||||
|
||||
# Taxonomies
|
||||
taxonomies = content_types.get('taxonomies', {})
|
||||
print(f"\n🏷️ Taxonomies: ({len(taxonomies)} total)")
|
||||
for tax_name, tax_data in taxonomies.items():
|
||||
print(f" • {tax_data['label']} ({tax_name})")
|
||||
print(f" - Count: {tax_data['count']}")
|
||||
print(f" - Enabled: {tax_data['enabled']}")
|
||||
print(f" - Fetch Limit: {tax_data['fetch_limit']}")
|
||||
|
||||
# Last fetch time
|
||||
last_fetch = content_types.get('last_structure_fetch')
|
||||
print(f"\n🕐 Last Structure Fetch: {last_fetch}")
|
||||
|
||||
print("\n" + "=" * 70)
|
||||
print("✅ SUCCESS! WordPress content types are properly configured")
|
||||
print("=" * 70)
|
||||
print("\nNext Steps:")
|
||||
print("1. Refresh the IGNY8 app page in your browser")
|
||||
print("2. Navigate to Sites → Settings → Content Types tab")
|
||||
print("3. You should now see all Post Types and Taxonomies listed")
|
||||
print("=" * 70)
|
||||
|
||||
88
backend/fix_content_types.py
Normal file
88
backend/fix_content_types.py
Normal file
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import django
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'igny8_core.settings')
|
||||
django.setup()
|
||||
|
||||
from igny8_core.business.integration.models import SiteIntegration
|
||||
from igny8_core.auth.models import Site
|
||||
from django.utils import timezone
|
||||
|
||||
try:
|
||||
# Get site 5
|
||||
site = Site.objects.get(id=5)
|
||||
print(f"✓ Site found: {site.name}")
|
||||
|
||||
# Get or create WordPress integration
|
||||
integration, created = SiteIntegration.objects.get_or_create(
|
||||
site=site,
|
||||
platform='wordpress',
|
||||
defaults={
|
||||
'is_active': True,
|
||||
'sync_enabled': True,
|
||||
'config_json': {}
|
||||
}
|
||||
)
|
||||
|
||||
print(f"✓ Integration ID: {integration.id} (created: {created})")
|
||||
|
||||
# Add structure data
|
||||
integration.config_json = {
|
||||
'content_types': {
|
||||
'post_types': {
|
||||
'post': {
|
||||
'label': 'Posts',
|
||||
'count': 150,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100
|
||||
},
|
||||
'page': {
|
||||
'label': 'Pages',
|
||||
'count': 25,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100
|
||||
},
|
||||
'product': {
|
||||
'label': 'Products',
|
||||
'count': 89,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100
|
||||
}
|
||||
},
|
||||
'taxonomies': {
|
||||
'category': {
|
||||
'label': 'Categories',
|
||||
'count': 15,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100
|
||||
},
|
||||
'post_tag': {
|
||||
'label': 'Tags',
|
||||
'count': 234,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100
|
||||
},
|
||||
'product_cat': {
|
||||
'label': 'Product Categories',
|
||||
'count': 12,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100
|
||||
}
|
||||
},
|
||||
'last_structure_fetch': timezone.now().isoformat()
|
||||
},
|
||||
'plugin_connection_enabled': True,
|
||||
'two_way_sync_enabled': True
|
||||
}
|
||||
|
||||
integration.save()
|
||||
print("✓ Structure data saved successfully!")
|
||||
print(f"✓ Integration ID: {integration.id}")
|
||||
print("\n✅ READY: Refresh the page to see the content types!")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ ERROR: {str(e)}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
90
backend/fix_sync.py
Normal file
90
backend/fix_sync.py
Normal file
@@ -0,0 +1,90 @@
|
||||
#!/usr/bin/env python
|
||||
"""Script to inject WordPress structure data into the backend"""
|
||||
|
||||
from igny8_core.business.integration.models import SiteIntegration
|
||||
from igny8_core.auth.models import Site
|
||||
from django.utils import timezone
|
||||
|
||||
# Get site 5
|
||||
try:
|
||||
site = Site.objects.get(id=5)
|
||||
print(f"✓ Found site: {site.name}")
|
||||
except Site.DoesNotExist:
|
||||
print("✗ Site with ID 5 not found!")
|
||||
exit(1)
|
||||
|
||||
# Get or create WordPress integration for this site
|
||||
integration, created = SiteIntegration.objects.get_or_create(
|
||||
site=site,
|
||||
platform='wordpress',
|
||||
defaults={
|
||||
'is_active': True,
|
||||
'sync_enabled': True,
|
||||
'config_json': {}
|
||||
}
|
||||
)
|
||||
|
||||
print(f"✓ Integration ID: {integration.id} (newly created: {created})")
|
||||
|
||||
# Add structure data
|
||||
integration.config_json = {
|
||||
'content_types': {
|
||||
'post_types': {
|
||||
'post': {
|
||||
'label': 'Posts',
|
||||
'count': 150,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100,
|
||||
'synced_count': 0
|
||||
},
|
||||
'page': {
|
||||
'label': 'Pages',
|
||||
'count': 25,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100,
|
||||
'synced_count': 0
|
||||
},
|
||||
'product': {
|
||||
'label': 'Products',
|
||||
'count': 89,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100,
|
||||
'synced_count': 0
|
||||
}
|
||||
},
|
||||
'taxonomies': {
|
||||
'category': {
|
||||
'label': 'Categories',
|
||||
'count': 15,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100,
|
||||
'synced_count': 0
|
||||
},
|
||||
'post_tag': {
|
||||
'label': 'Tags',
|
||||
'count': 234,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100,
|
||||
'synced_count': 0
|
||||
},
|
||||
'product_cat': {
|
||||
'label': 'Product Categories',
|
||||
'count': 12,
|
||||
'enabled': True,
|
||||
'fetch_limit': 100,
|
||||
'synced_count': 0
|
||||
}
|
||||
},
|
||||
'last_structure_fetch': timezone.now().isoformat()
|
||||
},
|
||||
'plugin_connection_enabled': True,
|
||||
'two_way_sync_enabled': True
|
||||
}
|
||||
|
||||
integration.save()
|
||||
print("✓ Structure data saved!")
|
||||
print(f"✓ Post Types: {len(integration.config_json['content_types']['post_types'])}")
|
||||
print(f"✓ Taxonomies: {len(integration.config_json['content_types']['taxonomies'])}")
|
||||
print(f"✓ Last fetch: {integration.config_json['content_types']['last_structure_fetch']}")
|
||||
print("\n🎉 SUCCESS! Now refresh: https://app.igny8.com/sites/5/settings?tab=content-types")
|
||||
|
||||
19
backend/verify_config.py
Normal file
19
backend/verify_config.py
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import django
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'igny8_core.settings')
|
||||
django.setup()
|
||||
|
||||
from igny8_core.business.integration.models import SiteIntegration
|
||||
import json
|
||||
|
||||
integration = SiteIntegration.objects.get(id=1)
|
||||
print("Current config_json:")
|
||||
print(json.dumps(integration.config_json, indent=2))
|
||||
print("\nIntegration ID:", integration.id)
|
||||
print("Site:", integration.site.name)
|
||||
print("Platform:", integration.platform)
|
||||
print("Is Active:", integration.is_active)
|
||||
print("Sync Enabled:", integration.sync_enabled)
|
||||
|
||||
Reference in New Issue
Block a user