I am using Jazzmin theme in my Django admin panel and I am wondering if there is any recommended library to handle media files?
I've installed django-filer but I see no option to integrate it with my summernote/tinyMCE or CKEditor. It doesn't matter for me which one I will be using. The most important is to have an option to insert uploaded images from body field in my model (it is textfield).
I want to integrate it only in admin panel.
For those who are also looking for such library I managed to find a plugin to CkEditor django-ckeditor-filebrowser-filer. Link to repo is here. The library works fine on Django 3. I am not sure about Django 4
django-cms is a django project itself. So there must be a file called settings.py
But I couldn't find it, where it is? how is database connection taking place?
The settings.py file is created when you create your django project (the one that will host the django-cms application). Since django-cms is a django app (similar to django-tables2, django-filters etc) it does not provide a settings.py but will just use the one your project already has.
For more info check out the how to install: https://github.com/divio/django-cms/blob/ddd39215286971ca14f2608510d3e0ba5f4e0772/docs/how_to/install.rst#create-a-new-project - the same guide lists a bunch of required settings for django-cms installation.
I have developed a Scrum Based Team Management System on django (mostly admin) and everything works fine, after I upgraded to 1.6.x, raw_id opens with ?e=1 querystring and popups opens in edit mode.
My source code address is
https://github.com/serj1975/tms
and I have a issue on this at
https://github.com/serj1975/tms/issues/1
I finally found the solution.
The problem was after I developed my apps on django 1.5, I ran collectstatic command and it fills my static folder with current version static files.
When I upgrade my solution with higher version (1.6) and started testing it, the problem I mentioned raised. After I removed all static files and add needed files one by one I found the reason.
I'm learning python and Django coming from PHP. This is all really exciting, and I would love to use Bootstrap with Django to create sexy web pages.
As I understand it (I'm following the Django tutorial on their website), Django uses "apps" which can be included in your settings.py file. I did a quick search and found several bootstrap-themed apps, but have no knowledge on how to pick the right one. Is there a standard app most people use? All I need are the bootstrap.css and bootstrap.js files.
I'm sure I could manually place them in my root, but I'd enjoy an "all inclusive" setup within my Django install.
Re-reading your question, it seems that you're searching for a way to install Twitter Bootstrap as a Django app. While there are some apps out there that facilitate using Twitter Bootstrap with Django, you don't really need to use any of them.
You can simply include the Twitter Bootstrap CSS and JS at either the project or app level and refer to them in your Django templates.
To include Twitter Bootstrap in a Django app, your best bet is to:
Use Static Files
In your settings.py, add the path to Bootstrap (which you should download and place in your Django app under a folder named static:
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
'/path/to/my_project/my_app/static/',
)
Also, make sure your STATIC_URL prefix is set:
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
Now, download Twitter Bootstrap and place it in the path there:
/path/to/my_project/my_app/static/bootstrap/
Include Twitter Bootstrap in your templates
I would link to Twitter Bootstrap documentation, but there isn't any, really. Your best bet is to take a look at the source of their starter template. Using the Django templating system is a bit beyond the scope of this question, but I'll give you this hint: Anywhere in the starter template where you find a link to a .css or .js, replace it with your STATIC_URL.
So:
<link href="../assets/css/bootstrap.css" rel="stylesheet">
becomes
<link href="{{ STATIC_URL }}/bootstrap/css/bootstrap.css" rel="stylesheet">
I use the starter template as my base.html and include {% block content %} blocks in base.html that can be replaced by the actual content in my templates, which {% extend base.html %}.
Or, use a 3rd party app to guide you
You might investigate is the Django Bootstrap Toolkit, which I have not used myself. I would suggest doing it yourself manually first, however, as a way to explore the project and to really understand what is going on. It's not too hard at all!
Welcome to the world of Python/Django. Like you, after years of doing web development in PHP, I've migrated to creating dynamic websites and robust web applications using this language/framework pair.
One of the really nice features of django is their automatic admin interface. I use an app called Django-Admin-Tools and django-admintools-bootstrap which transforms the default interface into a slick looking admin. https://bitbucket.org/salvator/django-admintools-bootstrap
The easiest way to install django apps or other python modules is by using pip. I would read up on using virtualenv http://readthedocs.org/projects/virtualenv/ to manage your django projects. When you set up a python virtual environment, it allows you to install django apps and python modules in a separate python install on your system.
Then, installing additional django apps is a breeze - pip install django-admin-tools - django grappelli - south - are all some of my favorites.
What if you simply install twitter-bootstrap using pip:
follow the instructions:
https://pypi.python.org/pypi/django-twitter-bootstrap/
for the simple configuration.
None of the mentioned answers worked for me, the simplest way of all I will say is directly add CDNs in your base.html which will be used to extend and you can add it in standalone/static pages as well
Read here for the bootstrap CDN and integration.
I just started working at a place as a front end developer where I need to build Django templates. I never worked with these before, does anyone know where I can download a sample template so I can look through the code structure?
I won't be doing any application development using the Django framework, only taking the variables the developer gives me and incorporating the in the html/css templates I build.
There are lots of Open Source django apps that you could look at for inspiration. One example is Zinnia which is a blogging application - there are dozens of templates in this project, see this directory. There are many other open source django projects on http://github.com and http://bitbucket.org
You should also take a look at the official template documentation, there are lots of snippets there that are very useful.
Here's a nice little tutorial.
http://www.webmonkey.com/2010/02/use_templates_in_django/
Also, Check out the Django Docs.
http://docs.djangoproject.com/en/1.3/ref/templates/builtins/