Where do you install django-registration-redux module? - django

I have my own project called "polling". I am looking to install the django-registration-redux submodule to create the log-in process. Where should I same the Django-registration-redux module? Another way to ask this is what does the directory structure look like?
Should I save it within the polling directory? or on the same level as polling because it is a separate project that I'm importing?

From the docs:
Automatic installation via a package manager
Several automatic package-installation tools are available for Python; the recommended one is pip.
Using pip, type:
pip install django-registration-redux
Manual installation from a downloaded package
If you prefer not to use an automated package installer, you can download a copy of django-registration-redux and install it manually... From a command line in that directory, type:
python setup.py install
Bottom line, just run the setup installation process and it will "install" it to the right place.

Related

Install extra packages in Flatpak sandbox

There are some Flatpak apps that have optional dependencies that are not bundled with the app. E.g the plotting package Veusz is available as a Flatpak and it can optionally use the Python package h5py to open HDF5 files. But h5py is not bundled with the Flatpak version. I saw a flatpak command flatpak enter that the documentation says allows us to
Enter the flatpak sandbox.
So I started the Veusz flatpak app and used flatpak ps to get its PID. Then I tried sudo flatpak enter PID pip3 install h5py but it installed h5py in my host operating system!
TLDR; Is it possible to install custom packages (not just Python packages) in a Flatpak application's sandbox? If yes, how shall I do it?
In general, you need to add an extension point and create a new package.
For example, add an extension point for the directory you need to add files (here lib/GL):
[Extension org.gnome.Platform.GL]
version=1.4
directory=lib/GL
and make a new flatpak package with the files to add (here org.gnome.Platform.GL).
In this case though, there may be some sort of issue. Looking at the metadata file for the Veusz flatpak here, they seem to be including hdf5 and h5py already. If you're missing this functionality you probably want to raise an issue in the repo.

how to run a django project (made on linux) on windows?

I am new to programming and started working on Linux, now I want to switch to windows and open my project there, look at the tutorials, it is written to activate the virtual environment in the Settings / activate.bat folder. but in my project there is no such folder and such file with the extension .bat. what should I do?
Please download & Install interpreter from https://www.python.org/downloads/
(make sure you are using windows 10, because previous
version create problems)
Download pycharm professional addition (if you have university account) other wise go for community https://www.jetbrains.com/pycharm/download/
Click for Django project
Set the interpreter
Go to. manage.py task
Run command migrate
Enjoy
First thing get all the requirements like the library you installed through pip inside
a txt file by writing this command pip freeze > requirements.txt.
Get only the source folder where you made the project and app.
Create a folder.
Create an environment inside the folder. (virtualenv name_of_the_env)
Go inside the env you created and activate the Script. (.\Scripts\activate)
Copy the source folder inside the env and either you can install all the library
manually using pip or you can use requirement.txt that you have created to install the
library by writing this command pip install -r requirement.txt.
You need python and pip installed to work

Can and should pip install to a packages folder?

I'm coming from a .Net and Node background where packages from the package manager e.g. NuGet or NPM get installed into a specific /packages folder.
I'm learning python and when I do a pip install my packages either end up in a global store or I can tell pip to put them into a specific place.
Is it good practice to put them into a separate folder or does that upset the Zen of python?
I want to do this so I can docker ignore that folder and then pip install them inside the docker container based on my production operating system from a requirements.txt file.
Is there a good reason I shouldn't do this? Why does Python not do this as default as it seems to be a clean and portable approach to package management?
Usually you install them in the default location or within a python virtual environment.
virtual environment
Do the virtual environment when you don't want to clutter up your default python environment.

offline install for py2neo in ubuntu

I downloaded the .zip from the py2neo github and placed in the site-packages folder and ran
pip install py2neo
Everything looks like it's in the right place (I compared to windows setup and they both contain the same files in the same places) but when I run a .py I get:
ImportError: No module named batch *
It sounds like your paths aren't setup correctly. To install, I would recommend simply running the pip install py2neo line without first downloading the zip and allowing pip to pull py2neo from PyPI. Alternatively, if you are trying to avoid using a network connection from your server, run python setup.py install from within a copy of the GitHub repository.
Note: You will want to checkout the latest release branch from the GitHub repository before installing. At the time of writing, this is named release/1.6.4.

Is it possible to install a django package without pip?

I am trying to install django-dash to run one of the dashboard examples and see what it's like.
I am on Windows running Python 2.7 and Django 1.6.5. I know the usual approach is to download pip then install the package using pip. However, I am on a work computer with no administrative rights so I can't access my Internet Option Settings to find my proxy URL to follow the instructions below:
Proxy problems
If you work in an office, you might be behind a HTTP proxy. If so, set the environment variables http_proxy and https_proxy. Most Python applications (and other free software) respect these. Example syntax:
http://proxy_url:port
http://username:password#proxy_url:port
I had the same issue when trying to install Django but was able to get it to work by moving the django directory under Python27/Lib/site-packages. Is there something similar I can do with django-dash?
I also tried downloading the sources and running python setup.py install. I received the following error:
File "setup.py", line 3, in <module> from setuptools import setup, find_packages ImportError: No module named setuptools
Link to django-dash: http://django-dash.readthedocs.org/en/latest/
Yes, you can probably get the sources from The Python Package Index
Once you have them, uncompress the files and install them manually (this will depend on you OS).
On Linux systems:
python setup.py build
python setup.py install
Here's the full reference
EDIT : Note that when manually installing those packages, you must also install any missing dependencies, eg. setuptools in your case