i'm new python/django , created simple django website using pycharm. site works fine running on computer, i'm lost when comes taking site onto host (dreamhost). i'm able upload files correct directories fine, , believe made correct changes database on mysql. i'm not sure go there though. right now, page shows files rather site. direction appreciated. much! you should not run django application using python manage.py runserver on production. how run application on django depends on server (apache, nginx) want use for apache - https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/modwsgi/ for nginx - https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-14-04 the mysql database should, of course, exist , have correct credentials. or, if choose use sqlite, file should accessible, readable , writable www-user (may different depending on linux distributive)
i have made rest web service send smss using hsdpa usb modem. using smslib in java send smss. every time web service invoked, create gateway start service, send message, stop service , remove gateway. takes 20 seconds each message. found starting service takes lot of time. part of code use send smss service.getinstance().addgateway(gateway); service.getinstance().startservice(); outboundmessage msg = new outboundmessage(phonenumber, message); if (service.getinstance().sendmessage(msg)) { result = "message sent successfully!!"; } else { result = "could not send message."; } service.getinstance().stopservice(); service.getinstance().removegateway(gateway);//remove gateway is there way can start service once if not started , use send message when ever web service invoked? why dont group messages , send in 1 go? service.getinstance().sendmessages(messa...
so have been playing pyqtgraph , came problem needed add strings x axis tick label (instead of default float). looked around , found show string values on x-axis in pyqtgraph the solution kind of need (the first solution on page, second 1 cause problems because on python 3.5). tried modified first solution, did not work. from pyqt4 import qtcore import pyqtgraph pg x = ['a', 'b', 'c', 'd', 'e', 'f'] y = [1, 2, 3, 4, 5, 6] xdict = dict(enumerate(x)) win = pg.graphicswindow() stringaxis = pg.axisitem(orientation='bottom') stringaxis.setticks([xdict.items()]) plot = win.addplot(axisitems={'bottom': stringaxis}) curve = plot.plot(xdict.keys(),y) if __name__ == '__main__': import sys if sys.flags.interactive != 1 or not hasattr(qtcore, 'pyqt_version'): pg.qtgui.qapplication.exec_() the error getting typeerror: 'dict_keys' object not support indexing on line curve = plot.plo...
Comments
Post a Comment