publish

why pusher works on localhost but not on a live website

自作多情 提交于 2019-12-02 05:59:25
I've used Pusher API to put a simple push notification in place. I've tested everything and Pusher works on my localhost . When I put the same code on a live website, Pusher doesn't publish my message. That's interesting to note that if I push from localhost I can see the message on the live version. It seems that I have no problem subscribing to a channel, but the problem is that I cannot publish a message on the channel. This is my code: // Create pusher event $pusher=Yii::app()->pusher; $data = array('message'=>"myMessageContent"); $pusher->trigger('test_channel','my_event',$data); Is there

Running Target after files are published to FileSystem

空扰寡人 提交于 2019-12-02 05:54:00
I am trying to create publish profile which would copy all published files to various folders. Unfortunately I read that's not possible to do it directly through publishUrl and it's advised to publish to one folder from which to copy all the files. I managed to write the copy target functionality, but the order of when targets are run is wrong. I'm trying to run the publish directly from VisualStudio 2015, through Build > Publish Web. Here is my publish profile: <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>FileSystem

MySql 表操作

て烟熏妆下的殇ゞ 提交于 2019-12-02 05:07:18
表中字段的详细操作 create table t2( id int primary key auto_increment, x int, y int ); insert into t2(x, y) values(10, 20), (100, 200), (1000, 2000); ''' 1.修改字段信息 alter table 表名 modify 字段名 类型[(宽度) 约束]; alter table t2 modify x bigint default 0; # 模式不同, 涉及精度问题 2.修改字段名及信息 alter table 表名 change 旧字段名 新字段名 类型[(宽度) 约束]; alter table t2 change y c char(10) not null; # 模式不同, 涉及类型转换问题 3.添加字段名 # 末尾添加 alter table 表名 add 字段名 类型[(宽度) 约束], ..., add 字段名 类型[(宽度) 约束]; alter table t2 add age int, add gender enum("male", "female", "wasai") default "wasai"; # t头部添加 alter table 表名 add 字段名 类型[(宽度) 约束] first; # 指定位添加:指定字段后

发布时间

懵懂的女人 提交于 2019-12-02 04:58:23
from datetime import datetime from datetime import timedelta if "刚刚" in publish_time: publish_time = datetime.now().strftime('%Y-%m-%d %H:%M') elif "分钟" in publish_time: minute = publish_time[:publish_time.find("分钟")] minute = timedelta(minutes=int(minute)) publish_time = ( datetime.now() - minute).strftime( "%Y-%m-%d %H:%M") elif "今天" in publish_time: today = datetime.now().strftime("%Y-%m-%d") time = publish_time.replace('今天','') publish_time = today + " " + time elif "月" in publish_time: year = datetime.now().strftime("%Y") publish_time = str(publish_time) print publish_time publish_time =

SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified for MDF file

余生长醉 提交于 2019-12-02 04:41:06
I have added a database file ( .mdf ) to my application using Visual Studio built-in functionality. Database is in the App_Data folder. It is running fine. But when I publish it and upload it to server it gives this error. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) I visited similar situation but

Application is incompatible with tablets

北战南征 提交于 2019-12-02 03:05:58
I have a project created in Xamarin Studio that seems to have some problems when I publish in Google Play: When the application is published, I can install in phones normally, but when I try to access the application in Google Play through a tablet it says the application is incompatible with the device. I'm new to android development, so I have some questions about this... I tried to had the compatible screens in the application manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="my.package.name" android:versionName="1

Your app contains non-public API usage

我与影子孤独终老i 提交于 2019-12-01 20:47:08
I'm trying to submit my app on the App Store but I'm getting this msg: Your app contains non-public API usage. Please review the errors, correct them, and resubmit your application. The app references non-public symbols in Payload/XXX.app/XXX: CFUserNotificationDisplayNotice Where "XXX" -- application name. Can anybody help me with this issue? A private API is an API that is not intended to be used by outside developers. This is to prevent breaking changes when the SDK is updated. The behavior of a private API is not guaranteed. The methods may be removed in the future updates of the platform.

表关系-断关联-序列化-反序列化

核能气质少年 提交于 2019-12-01 20:24:42
目录 复习 课程准备 多表设计 基表 断关联多表关系 序列化 反序列化 序列化与反序列化整合(重点) 复习 """ 1、解析模块:全局局部配置 REST_FRAMEWORK = { # 全局解析类配置 'DEFAULT_PARSER_CLASSES': [ 'rest_framework.parsers.JSONParser', 'rest_framework.parsers.FormParser', 'rest_framework.parsers.MultiPartParser' ], } form rest_framework.parsers import JSONParser, FormParser class User(APIView): parser_classes = [JSONParser, FormParser] def get(): pass 2、异常模块 REST_FRAMEWORK = { # 全局配置异常模块 'EXCEPTION_HANDLER': 'api.exception.exception_handler', } def exception_handler(exc, context): response = drf views 中的 exception_handler 先处理 if response is None: 通过context

多表、序列化反序列化、群增单删群删接口

杀马特。学长 韩版系。学妹 提交于 2019-12-01 19:54:27
配置:settings.py INSTALLED_APPS = [ # ... 'rest_framework', ] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'dg_proj', 'USER': 'root', 'PASSWORD': '123', } } """ 任何__init__文件 import pymysql pymysql.install_as_MySQLdb() """ LANGUAGE_CODE = 'zh-hans' TIME_ZONE = 'Asia/Shanghai' USE_I18N = True USE_L10N = True USE_TZ = False MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') 路由 # 主 from django.conf.urls import url, include from django.contrib import admin from django.views.static import serve from django.conf import settings urlpatterns = [ url(r'^admin/',

What is the equivalent of Web.config transform in ASP.NET Core?

孤街浪徒 提交于 2019-12-01 17:54:19
ASP.NET Core documentation suggests we should use appsettings.json file, along with a file per environment, containing overriding values. The problem is that all these files are published, though only appsettings.json and appsettings.[Environment].json are relevant. The other problem is that to change a config value on server one must inspect both files: base and environment specific. So my question is: what is the cleanest way to have one configuration file in each deployment environment? The key difference is that ASP.NET Core apps are not deployed for a particular configuration, as ASP.NET