static

How to make a Tkinter window not resizable?

How to make a Tkinter window not resizable? Question: I need a Python script that uses the Tkinter module to create a static (not resizable) window. I have a pretty simple Tkinter script but I don’t want it to be resizable. How do I prevent a Tkinter window from being resizable? I honestly don’t know …

Total answers: 1

Creating a static class with no instances

Creating a static class with no instances Question: All of the tutorials I see online show how to create classes with __init__ constructor methods so one can declare objects of that type, or instances of that class. How do I create a class (static in Java) so that I can access all methods and attributes …

Total answers: 5

django how to include javascript in template

django how to include javascript in template Question: I’m working on a project and following the documentation. I didn’t succeed to include javascript. Here is my settings: STATIC_URL = ‘/static/’ STATICFILES_DIRS = ( os.path.join(BASE_DIR, "static"), ) STATIC_ROOT = ‘/static/’ TEMPLATE_DIRS = ( os.path.join(BASE_DIR, ‘templates’), ) So, I have created a static folder with a javascipt …

Total answers: 5

How to declare a static attribute in Python?

How to declare a static attribute in Python? Question: How can I declare a static attribute in Python? Here is written how I can declare a method: Static methods in Python? Asked By: Romulus || Source Answers: All variables declared inside the Class’ body are ‘static’ attributes. class SomeClass: # this is a class attribute …

Total answers: 5

What is the absolute path of BASE DIR?

What is the absolute path of BASE DIR? Question: Django newbie here. I have trouble understanding the meaning of: BASE_DIR = os.path.dirname(os.path.dirname(__file__)) and STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), ‘static’) STATICFILES_DIRS = ( os.path.join(os.path.dirname(BASE_DIR), “static”, “static”), ) What’s happening here? I take it the “file” is the settings.py file we are in (?), so the BASE_Dir is two …

Total answers: 8

Django cannot find static files. Need a second pair of eyes, I'm going crazy

Django cannot find static files. Need a second pair of eyes, I'm going crazy Question: Django will not serve my static files. Here’s the error returned: [13/Jun/2014 06:12:09] “GET /refund/ HTTP/1.1” 200 2927 [13/Jun/2014 06:12:09] “GET /static/css/bootstrap.min.css HTTP/1.1” 404 1667 [13/Jun/2014 06:12:09] “GET /static/css/cover.css HTTP/1.1” 404 1643 [13/Jun/2014 06:12:09] “GET /static/js/bootstrap.min.js HTTP/1.1” 404 1661 [13/Jun/2014 …

Total answers: 6

django not found static files in the subfolder of static

django not found static files in the subfolder of static Question: django 1.6.5 My static files is under subfolder of static. djangoprj djangoprj settings.py urls.py wsgi.py __init__.py static myapp mystaticfiles … apps myapp … templates *.html … In my templates file, I link static file as full path. <img src=”/static/myapp/images/my.png” /> But those file are …

Total answers: 2

Django admin not serving static files?

Django admin not serving static files? Question: Django 1.6 I’m having trouble serving my static files for my Django Admin. urls.py: urlpatterns = patterns(”, url(r’^$’, ‘collection.views.index’, name=’home’), url(r’^collection/’, include(‘collection.urls’)), url(r’^admin/’, include(admin.site.urls)), ) if settings.DEBUG: urlpatterns += patterns(”, url(r’^media/(?P<path>.*)$’, ‘django.views.static.serve’, { ‘document_root’: settings.MEDIA_ROOT, }), url(r’^static/(?P<path>.*)$’, ‘django.views.static.serve’, { ‘document_root’: settings.STATIC_ROOT, }), ) settings.py … MEDIA_ROOT = ‘/Users/me/projectdir/media/’ …

Total answers: 7

python – should I use static methods or top-level functions

python – should I use static methods or top-level functions Question: I come from a Java background and I’m new to python. I have a couple scripts that share some helper functions unique to the application related to reading and writing files. Some functions associated with reading, some with writing. While searching for the correct …

Total answers: 5

How load Static Files in Models Admin File from Django?

How load Static Files in Models Admin File from Django? Question: I have my Django static files in Amazon Servers, and I trying to load these files in my Model Admin File, but its only work with absolute URLs. In my Django templates I load and call my static files with {% load admin_static %} …

Total answers: 1