Well, since this is the django group, I'll suppose that *${application}* is 
a template variable (Maybe it's a template used by ant when compiling the 
flex app).

If this index is indeed handled by a django view, you could then configure 
the basePath / host like this:

1. You could add it to your settings.py or even better some kind of 
local_settings.py if you have that kind of setup. Then the index view would 
pass on that setting to the template so that you can pass it through 
flashvars.
2. You could also use the Sites app already integrated into django. So each 
deploy would properly configure the site domain (through the admin site), 
and you'll pass that through flashvars.

Just some ideas, hope it helps.


On Monday, June 4, 2012 10:47:02 AM UTC-3, fred wrote:
>
> That’s a nice clean solution requiring only a minimal edit on a 
> redeploy(server move). 
>
>  
>
> I had previously tried to semi-automate this using the javascript code 
> below; but that did not provide a host or hostname; however I’m not really 
> a javascript guru and may have missed something.
>
>  
>
>             var flashvars = {};
>
>             flashvars.hostname = window.location.hostname;
>
>             flashvars.host     = window.location.host; 
>
>             flashvars.port     = window.location.port;
>
>             flashvars.mode     = "fred put this in to test";
>
>             var params = {};
>
>             params.quality = "high";
>
>             params.bgcolor = "${bgcolor}";
>
>             params.allowscriptaccess = "sameDomain";
>
>             params.allowfullscreen = "true";
>
>             var attributes = {};
>
>             attributes.id = "${application}";
>
>             attributes.name = "${application}";
>
>             attributes.align = "middle";
>
>             swfobject.embedSWF(
>
>                 "${swf}.swf", "flashContent", 
>
>                 "${width}", "${height}", 
>
>                 swfVersionStr, xiSwfUrlStr, 
>
>                 flashvars, params, attributes);
>
>  
>
>  
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Joni Bekenstein
> *Sent:* Friday, June 01, 2012 9:40 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: django 1.4, wsgi, flex deploy best practices
>
>  
>
> You can configure a basePath through flashvars as you said, but you don't 
> have to make django serve the index.html to set that dynamically. You can 
> put it by hand, allowing you to deploy on different servers in a decoupled 
> manner.
>
>  
>
> Maybe I'm missing something here but I don't see anything wrong with that 
> approach. I almost always use flashvars to specify at least one location, 
> probably for a configuration file, which contains the paths to the backend 
> services, external assets, etc. 
>
>  
>
> Another thing you could do is configure a CNAME record so that 
> backend.frontendserver.com points to backendserver.com. 
>
>  
>
>
> El jueves, 31 de mayo de 2012 15:54:35 UTC-3, fred escribió:
>
> I use Flex for the client side and XML between client and server.  I am a 
> “one man team” and so elegance sometimes gets sacrifices for “it works”.   
> My typical deploy has been
>
> /var/www/html/my flex swf and html code
>
> And
>
> /home/projectname/current/djangositename
>
>  
>
> This works well, except that I have to use absolute URL’s in Flex 
> (including the server name) because Flex will use either absolute or 
> relative to the location of the .swf file.  This means I have to rebuild 
> for different servers.
>
>  
>
> Are there any recommendations of “best practices”
>
> 1.       I could have the django view return the html page that includes 
> the swf file.  This has the advantage of allowing django to pass in some 
> flashvars to the application,  the disadvantage is closer coupling (at 
> least for deploy) of client and server; or
>
> 2.       I could use the url redirect to allow a relative reference to 
> get redirected to my django home.
>
>  
>
> I’m not an Apache expert and so I defer to the community which is more 
> experienced with these issues for a clean, generic solution I can use going 
> forward as I port to Django 1.4 and CentOs 6.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/KqN3HWLknioJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

On Monday, June 4, 2012 10:47:02 AM UTC-3, fred wrote:
>
> That’s a nice clean solution requiring only a minimal edit on a 
> redeploy(server move). 
>
>  
>
> I had previously tried to semi-automate this using the javascript code 
> below; but that did not provide a host or hostname; however I’m not really 
> a javascript guru and may have missed something.
>
>  
>
>             var flashvars = {};
>
>             flashvars.hostname = window.location.hostname;
>
>             flashvars.host     = window.location.host; 
>
>             flashvars.port     = window.location.port;
>
>             flashvars.mode     = "fred put this in to test";
>
>             var params = {};
>
>             params.quality = "high";
>
>             params.bgcolor = "${bgcolor}";
>
>             params.allowscriptaccess = "sameDomain";
>
>             params.allowfullscreen = "true";
>
>             var attributes = {};
>
>             attributes.id = "${application}";
>
>             attributes.name = "${application}";
>
>             attributes.align = "middle";
>
>             swfobject.embedSWF(
>
>                 "${swf}.swf", "flashContent", 
>
>                 "${width}", "${height}", 
>
>                 swfVersionStr, xiSwfUrlStr, 
>
>                 flashvars, params, attributes);
>
>  
>
>  
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Joni Bekenstein
> *Sent:* Friday, June 01, 2012 9:40 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: django 1.4, wsgi, flex deploy best practices
>
>  
>
> You can configure a basePath through flashvars as you said, but you don't 
> have to make django serve the index.html to set that dynamically. You can 
> put it by hand, allowing you to deploy on different servers in a decoupled 
> manner.
>
>  
>
> Maybe I'm missing something here but I don't see anything wrong with that 
> approach. I almost always use flashvars to specify at least one location, 
> probably for a configuration file, which contains the paths to the backend 
> services, external assets, etc. 
>
>  
>
> Another thing you could do is configure a CNAME record so that 
> backend.frontendserver.com points to backendserver.com. 
>
>  
>
>
> El jueves, 31 de mayo de 2012 15:54:35 UTC-3, fred escribió:
>
> I use Flex for the client side and XML between client and server.  I am a 
> “one man team” and so elegance sometimes gets sacrifices for “it works”.   
> My typical deploy has been
>
> /var/www/html/my flex swf and html code
>
> And
>
> /home/projectname/current/djangositename
>
>  
>
> This works well, except that I have to use absolute URL’s in Flex 
> (including the server name) because Flex will use either absolute or 
> relative to the location of the .swf file.  This means I have to rebuild 
> for different servers.
>
>  
>
> Are there any recommendations of “best practices”
>
> 1.       I could have the django view return the html page that includes 
> the swf file.  This has the advantage of allowing django to pass in some 
> flashvars to the application,  the disadvantage is closer coupling (at 
> least for deploy) of client and server; or
>
> 2.       I could use the url redirect to allow a relative reference to 
> get redirected to my django home.
>
>  
>
> I’m not an Apache expert and so I defer to the community which is more 
> experienced with these issues for a clean, generic solution I can use going 
> forward as I port to Django 1.4 and CentOs 6.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/KqN3HWLknioJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

On Monday, June 4, 2012 10:47:02 AM UTC-3, fred wrote:
>
> That’s a nice clean solution requiring only a minimal edit on a 
> redeploy(server move). 
>
>  
>
> I had previously tried to semi-automate this using the javascript code 
> below; but that did not provide a host or hostname; however I’m not really 
> a javascript guru and may have missed something.
>
>  
>
>             var flashvars = {};
>
>             flashvars.hostname = window.location.hostname;
>
>             flashvars.host     = window.location.host; 
>
>             flashvars.port     = window.location.port;
>
>             flashvars.mode     = "fred put this in to test";
>
>             var params = {};
>
>             params.quality = "high";
>
>             params.bgcolor = "${bgcolor}";
>
>             params.allowscriptaccess = "sameDomain";
>
>             params.allowfullscreen = "true";
>
>             var attributes = {};
>
>             attributes.id = "${application}";
>
>             attributes.name = "${application}";
>
>             attributes.align = "middle";
>
>             swfobject.embedSWF(
>
>                 "${swf}.swf", "flashContent", 
>
>                 "${width}", "${height}", 
>
>                 swfVersionStr, xiSwfUrlStr, 
>
>                 flashvars, params, attributes);
>
>  
>
>  
>
> *From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *Joni Bekenstein
> *Sent:* Friday, June 01, 2012 9:40 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: django 1.4, wsgi, flex deploy best practices
>
>  
>
> You can configure a basePath through flashvars as you said, but you don't 
> have to make django serve the index.html to set that dynamically. You can 
> put it by hand, allowing you to deploy on different servers in a decoupled 
> manner.
>
>  
>
> Maybe I'm missing something here but I don't see anything wrong with that 
> approach. I almost always use flashvars to specify at least one location, 
> probably for a configuration file, which contains the paths to the backend 
> services, external assets, etc. 
>
>  
>
> Another thing you could do is configure a CNAME record so that 
> backend.frontendserver.com points to backendserver.com. 
>
>  
>
>
> El jueves, 31 de mayo de 2012 15:54:35 UTC-3, fred escribió:
>
> I use Flex for the client side and XML between client and server.  I am a 
> “one man team” and so elegance sometimes gets sacrifices for “it works”.   
> My typical deploy has been
>
> /var/www/html/my flex swf and html code
>
> And
>
> /home/projectname/current/djangositename
>
>  
>
> This works well, except that I have to use absolute URL’s in Flex 
> (including the server name) because Flex will use either absolute or 
> relative to the location of the .swf file.  This means I have to rebuild 
> for different servers.
>
>  
>
> Are there any recommendations of “best practices”
>
> 1.       I could have the django view return the html page that includes 
> the swf file.  This has the advantage of allowing django to pass in some 
> flashvars to the application,  the disadvantage is closer coupling (at 
> least for deploy) of client and server; or
>
> 2.       I could use the url redirect to allow a relative reference to 
> get redirected to my django home.
>
>  
>
> I’m not an Apache expert and so I defer to the community which is more 
> experienced with these issues for a clean, generic solution I can use going 
> forward as I port to Django 1.4 and CentOs 6.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/KqN3HWLknioJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/nNTn5rvAhT8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to