How does django call the .py files at root directory? [closed] - python

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am working on a Django project that someone else started, and I'm new to Django, so I'm not sure about the workflow.
I see that there is a file called load_fixtures.py in the root directory (so the file is a sibling of manage.py) , but I don't understand why (and when) is that file called.
When? Does it get called only during syncdb?
Why? i.e. which file includes / calls it? Is it called just because it's in the root directory? Or does a line from settings.py include it?
Thanks in advance !

That is not a part of a standard Django project and is not automatically called by Django itself. I guess it's just a standalone file that the developer created, to run from the command line to populate the db.

Related

Python package only working for root user not for others | Using linux suse [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have installed Python package 'forcast' using root and it runs fine but all other Linux users wont be able to see this package or import it in code .
Please help me, i have checked /usr/lib/ all package are present.
Is it possible that users do not have permission to access the files? check the access modes to the files in the package - you need +rx for directories and +r for files.
Another option is that this path is not searched by default, and you need to add it to PYTHONPATH for the users.

Set environment variables in FLASK [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
The environment variables are cleared when you exit the terminal and it is required that we need to set them again when we launch the terminal.
In vs code using bash in Ubuntu, if that is the case, look for setting the env variables in the .bash_profile so that it remembers the variables even after the terminal program is closed.
I suggest you use .env file in order to handle environment configuration in Flask.
It's a file that stores all the necessary environment data and should be changed between development, production, etc.
There is an excellent tutorial about flask by Miguel Grinberg, the part about the environment is
here.

Write a script that generates several directories, makes empty files, and then lists all file under the current directory [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm extremely new to linux and I have very very little experience with it.
The work I want to do:
write a script that generates a few directories, then
makes at least 5 empty files, and then
lists them all under the current directories.
I don't know how to start doing this.
check shell script for writing a linux script then use:
mkdir [folder name] : command to create directory
touch [file name] : to create a file
ls : to list file and directories
learning is fun and welcome to linux :D
Try to use the benefits of Linux itself.
Use a bash script instead of python, and use touch.
Google for both to know what to do.

use quickly to make a config folder in home [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I need to make a ~/folder/configFile to use with my aplication. when the deb package is created by "quickly" should create this folder with this file. Someone can teach me to do it?
By the way, can also tell me where should I put my axillary files ".py" in the project folders (like classes and stuff)?
See homepath in the docs. You can put your axillary files in the same folder as your application's or in a subdirectory and make them part of packages.

How do I run a Python script on my web server? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I've just started learning Python, and I'm pretty lost right now. I want to run my script on my server that is hosted through hosting24.com. Their FAQ says they support Python, but I have no clue where to put my script for it to run.
There is a folder called cgi-bin in my root, I'm guessing that is where I put my script? Can someone explain to me how this works?
Very simply, you can rename your Python script to "pythonscript.cgi".
Post that in your cgi-bin directory, add the appropriate permissions and browse to it.
This is a great link you can start with.
Here's another good one.
Hope that helps.
EDIT (09/12/2015): The second link has long been removed. Replaced it with one that provides information referenced from the original.

Categories

Resources