Pythonanywhere Loading data from local files - database

I'm new to pythonanywhere. I wonder how to load data from local csv files (there are many of them, over 1,000) into a mysql table. Let's say the path for the folder of the csv files is d:/data. How can I write let pythonanywhere visit the local files? Thank you very much!

You cannot get PythonAnywhere to read the files directly off your machine. At the very least, you need to upload the file to PythonAnywhere first. You can do that from the Files tab. Then the link that Rptk99 provided will show you how to import the file into MySQL.

Related

How to include external ASP file?

I have a "Main" SQL database - with 20 websites sending / receving data.
All sites Works with Classic ASP.
Today I create an include file to connect all sites to db.
My question is:
Its possible to create only one "conn file" and include this file to all sites?
Why?
because I need to change the connection - and now I need to change 20 files for all sites..
any idea?
Place that file to include in a folder on the server.
Create a virtual directory in each site pointing to that folder.
Add the following to the either the pages that need the connection or a global include file for each site.
<!--#include virtual="/virtualdir/connfilename"-->

Best way to store documents ( pdf , word ...) in a database ( postgres 9.4)

Problem :
To save documents such a pdf file or word...
Approach :
but it seems to me not a good idea to store it directly in the database.
I prefer to store only the address of the file in a column and to save the file itself on a folder beside my database.
Todo :
Is there a trick to create a folder beside the database (mdf ldf) and to store the relativly to the mdf I mean (.. /document) for example?
after read all comments
suppose our website is xyz.com/index.html for Production and
xyz.com/Dev/index.html for Development
under this application we would have one folder /Doc
for production application path would be xyz.com/
and Development application path would be xyz.com/Dev/
we will save the path in DB table colummn is DOC/doc1.pdf etc ...
when we bring the data from DB then we have to write a code on client end
that would be application path + DB path in column
for Production path would be xyz.com/DOC/doc1.pdf and
for Development path would be xyz.com/Dev/DOC/doc1.pdf
so you will get always right path to show your doc on websites

How to restore websites in localhost

I am newbie in Composite, I already backup and download C1 websites (www.solve.sg), I also have installed (and working) Composite in localhost. So how to restore websites in localhost?.
I already used method to rename folder CompositesC1 to CompositesC1old, then extract and put extracted web in CompositeC1 folder at localhost but not working and gave me error.
Please help the right method how to read online backup websites and to read that at localhost
I dont know what Composite is, but you probably need to go back to your cPanel / backend of your webhost, dump the DB powering solve.sg and import that into your local instance.
Your hosting provider will probably have a tool called phpMyAdmin; go in there and find the 'Export' tab at the top of your DB and dump it out as a .sql file. You will then import that file into your local environment, probably also using phpMyAdmin.
You may also have to change around some of the settings files that show where your database is relative to your application.

Can i use a centralized external config file for c#?

I found an article on using external config files here. While I was able to extract my config settings, I was unable to put them in a central location.
When i tried to do something like this:
<connectionStrings configSource="C:/dev/Configs/ConnectionStrings.config" />
It causes a type initializer exception. If i put the file in a folder under the bin directory, it's ok. Problem is, I want to keep the config files central to all apps so i can reuse it in a lot of places.
Is it just not doable?
I ended up using Symbolic Links. I created a subfolder under each app that symlinked back to the master config folder. All apps share the same Connection Strings now.

How to download a file from CakePHP?

I'm working on a College Application project.
I want to ask how to download the files that previously uploaded by user.
Here's the clear view :
User will upload the files.
Controller will handle the request and save the name of the files into database.
How admin can download the file ???
I try to access the localhost/system/files/upload.doc but doesn't got any luck.
Consider using Media views: http://book.cakephp.org/1.3/view/1094/Media-Views
These will allow you to go to a path and load the database information about the file and then present the file with necessary download headers to the user.
yes use media views. They are the best way to keep your files from being publically accessible. So an admin can be "Served" the file and others can not get to them .
You can rename the file and things like that as you serve it to the user as well. Very nice feature of cake.

Resources