how to string format when string have {

2014-04-20 Thread Mariano DAngelo
I have the following string: nginx_conf = ''' server { listen 80; server_name dev.{project_url}; location / { proxy_pass http://127.0.0.1:8080; include /etc/nginx/proxy.conf; } location /media { alias

import class from string

2012-07-04 Thread Mariano DAngelo
Hi I'm trying to create a class from a string This is my code, but is not working 'myshop.models.base' module_name, class_name = model.rsplit(., 1) module = importlib.import_module(module_name) class_ = getattr(module, class_name)() Anyone know what I'm doing wrong or another way?