How to create a django model from an existing specific database table? - sql-server

Can I use inspectdb, if so how can I use it in pycharm? I am new to django. Thanks

To run a Django command in PyCharm you should create a new configuration.
So, first of all click on Run in the top bar menu. Then click on Edit Configuration.
Now, a new window should be opened which display all your configurations. In the top-right corner you can find a plus (+) symbol, click on it and choose Django server.
In this way, you have created a new Django configuration.
Then, you should compile all information that you needed.
I think that for inspectdb command you should insert the following parameters:
Custom run command -> inspectdb
Additional options -> only if you want, if i remember well you can specify the table name
Environment variables
Python interpreter
At the end click on Apply and Ok
To run the command click on Run and choose the new command.

Related

How to add a custom web page in Jenkins?

I am trying to make a web-page which displays the dynamic web page - basically it displays a table comprising of Name, IP_Address, and Group Name with used check/uncheck box. This webpage can run on a different tcp socket so it can be
https://myjenkins:5909 . Next, I want to add this table information in the mongo-db and read back the data and show on the web page - that table. What are the required steps for me? First is it possible? Here is my understanding that I have to write a back hand code using Jenkins plugin. Now, how to add the front end page like my custom page in Jenkins. Also, how database can be handled by the backhand Jenkins plugin? Sorry, I am new to these things. Any idea or details will help me. Also, is it possible to use LDAP based user id and password in my form.

Sharing databases between projects within Intellij

I use Intellij to inspect databases, run sql, view data in tables etc. This all works fine but the only thing I am missing is the ability to define these datasources once and view them in all my projects i.e. that I can share them between other projects and not have to redefine them for new projects. Is this possible in Intellij?
Go to the Database tool window and click on the Data Source Properties button. Select the data source you want to make global. Click on the Make Global button in the tool bar above.
The Make Global button looks like this:
Now you can use the data source from all your projects. However a global data source is not stored in the project files, so any other developers working on the same project will need to define their own data source.
The Make Global button is no longer green (Intellij Ultimate 2018.02).
It's located above the datasource list, as in the (crappy) screenshot.
In Intellij 2020.1, click on the Database view, then click on "Data Source Properties" (database with wrench icon). On the dialog that opens, click on "Make global", which is the 5th icon (screenshot below).
In IntelliJ 2019.1, 2019.2 to share connection to DB with multiple projects:
Open Database panel
Datasource Properties
Make Global
So how I did it on 2018.3 was to go to the Database tool window then right click on your datasource you want to copy then Database Tools -> Copy Datasource to Clipboard. In the Database window for the project you want to copy to click the + at the top left and it has an option to Import from Clipboard.
In IntelliJ 2019.3 to share connection to DB with multiple projects:
. Open Database panel
. Data source Properties
. Click the blueMake Global button

App Engine - How to create project in region us-central

I need to create a new project on Google App Engine in the region "us-central" since my SQL database is located in this region and I can not connect projects from other regions to the SQL database.
If I create a new project, it is located by default in EU. There is no option to choose the region during project creation. See the attached screenshot. Is there a way to create a project in "us-central"?
From Setting the server location:
When you create your project, you can specify the location from
which it will be served. In the new project dialog, click on the link
to Show Advanced Options, and select a location from the pulldown
menu:
But it seems the documented project region selection procedure is changing, as the Show Advanced Options link is, as you observed, nowhere to be seen anymore.
Empirically I have discovered the following method. But being undocumented it may change at any time, so YMMV.
Just click on the CREATE link in the screen you're showing.
You'll see a screen asking you to choose the app language (the popup is a bit flakey, I had to reload the page to actually be able to make the selection):
After you select the language you'll see the location selection screen:
It seems the app created sequence is now persisted, you'll also be automatically directed to the correct screen if, at any time, you attempt to go to the GAE app settings for the newly created app.

Liferay auto upgrade custom db

I'm trying to change the build properties update for liferay custom tables made with service builder.
I would like to control if the deploy has to upgrade the database or not, since now it does or does not ramdomly (apparently).
I'm trying to follow this solution: https://issues.liferay.com/browse/LPS-642 but I can't set the base.path property... Where should I put it in order to use it successfully?
In your portlet at below path
your-custom-portlet/docroot/WEB-INF/src/service.properties
Which will have below properties
##
## Properties Override
##
#
# Specify where to get the overridden properties. Updates should not be made
# on this file but on the overridden version of this file.
#
include-and-override=${base.path}/service-ext.properties
##
## Build below properties will be specific to your portlet as this file is auto generated one it is created / updated while you do ant build-service
##
build.namespace=SN
build.number=5
build.date=1379913470395
build.auto.upgrade=true
At least I found where to put my custom properties and that is in:
include-and-override=${base.path}/service-ext.properties as said before.
But... If the last deployed packet had the build.auto.upgrade=false, you change the database schema, build the services and deploy forgetting to set build.auto.upgrade=true there will be obviously no change. Then if you set build.auto.upgrade=true without building another time the services there will be another time no change, and this is why I was confused before.
Another thing to remember is that if you delete the service-ext.properties file in your project and deploy it, the old file service-ext.properties in the server will not be deleted and will continue to be used, so you have to delete it manually.

How to make .exe file programmatically set to run as admin always in vista?

I have written a winform application in C#. When I run the program for some functionality it required admin permission. After Installation If I set the .exe file to run as admin manually (by clicking right mouse button on .exe file) then my program run perfectly.
Now I need user not to set the run as admin property after installation by clicking right mouse button. I need to set this programaticaly somewhere in the code that user no need to bother about this. This specific problem is only arise for Windows Vista. Can anyone help me out?
You need to add a manifest to the app that specifies it require admin privileges. Read more on MSDN.
Update: You can add a manifest to your project by right-clicking on the project and selecting Add / New Item / Application Manifest File. This will add a new file called app.manifest to your project and will reference it from the project properties, in the Manifest dropdown on the Application tab. The default manifest template even has a nice comments on how exactly to change the required UAC execution level.
You need to specify the requestedExecutionLevel in the manifest.
See here for a detailed explanation:
http://petesbloggerama.blogspot.com/2007/04/making-your-assembly-run-as.html

Resources