Question

So I was installing an app in order to bootstrap my Django admin interface, and I thought this app was going to be Project specific but it appears to be installed on a global Django level.

http://riccardo.forina.me/bootstrap-your-django-admin-in-3-minutes/

https://github.com/riccardo-forina/django-admin-bootstrapped

My question is how can I uninstall it if I need to do so at a later date? I wanted my project to be as independent as possible. I was also wondering if there was a way of doing the installation within the project so that people that download my repository will automatically get it.

Also some minor questions are that after adding "add django_admin_bootstrapped into the INSTALLED_APPS list before django.contrib.admin" I was not required to run a syncdb command like we usually are when installing models. I guess this applications doesn't creates tables on my database so that is probably why, but I just wanted to know your thoughts.

I know it is a lot to answer but any clarification is appreciated. Thanks.

Was it helpful?

Solution 2

If you're writing something that you want other people to use, and it relies on other packages (whether Django apps or more generic Python packages) it's standard to use pip. This makes it easy to install and uninstall packages, and specific versions of those packages. You can then create a requirements.txt file, which you include with your project. This lets other people know what packages are required, and they can easily install them using pip.

So, first off, install pip.

Then you would install django-admin-bootstrapped by doing:

$ pip install django-admin-bootstrapped

You can also install django using pip:

$ pip install django

If you then do this:

$ pip freeze > requirements.txt

you'll end up with a requirements.txt file that lists any packages you've installed with pip, and which version of each. Include that file with your project when you share it with others (on GitHub or wherever). Those people would then do this, to install the same packages:

$ pip install -r requirements.txt

It would also be worth installing and using virtualenv – this lets you have separate environments for your python work, so that when you pip install something it's only available in that environment. Then you can have different versions of packages (eg, different versions of Django) in each environment. Virtualenvwrapper also makes some of the common virtualenv tasks a little easier.

It's a lot to get to grips with at first, as I know from experience, but it's worth doing so and will make development easier in the long term.

As to your other question, it looks like django-admin-bootstrapped doesn't have any models, so it doesn't require any updating of the database after installation.

OTHER TIPS

If you have installed the django app using pip do:

pip uninstall app_name

Or you have to go manually to your site-packages directory and remove it.

After that,

Remove the app from INSTALLED_APPS. django-admin-boostrapped might have overridden your templates. After you are done, do ./manage.py collectstatic and ./manage.py syncdb

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top